Running Laravel Scheduler Without Cron Job: Is It Possible?

Published on May 7, 2025 4 min read

Typically, Laravel Scheduler runs with cron jobs that execute php artisan schedule:run every minute. But what if we try running it without cron at all? Is it possible? The answer is yes, with a few alternative techniques. This is perfect for those who like tinkering or are limited by access to cron (for example, on shared hosting).

1. Scheduler via Laravel Worker

You can create a PHP worker that runs in the background and triggers schedule:run every minute using a loop.

Example script:

while (true) {
    exec('php /path/to/artisan schedule:run >> /dev/null 2>&1');
    sleep(60);
}

Run it with:

php scheduler-worker.php &

Downside:

2. Use Systemd Timer (Linux Native)

A modern alternative to cron in Linux is the systemd timer. It’s more flexible, and the logs are neater.

Steps:

Create a service file: /etc/systemd/system/laravel-schedule.service

[Unit]
Description = Laravel Schedule Runner

[Service]
Type = oneshot
WorkingDirectory = /path/to/laravel
ExecStart = /usr/bin/php artisan schedule:run

Create a timer file: /etc/systemd/system/laravel-schedule.timer

[Unit]
Description = Run Laravel Scheduler every minute

[Timer]
OnCalendar = *-*-* *:*:00
AccuracySec = 1s
Unit = laravel-schedule.service

[Install]
WantedBy = timers.target

Enable and start the timer:

systemctl enable laravel-schedule.timer
systemctl start laravel-schedule.timer

This is more stable than cron, and you can view the status with systemctl list-timers.

Downside:

3. Web Scheduler Trigger via Ping (Push-Based)

Create an endpoint that can be pinged externally, for example, from services like UptimeRobot, GitHub Actions, or another server.

Example route:

Route::get('/run-scheduler', function () {
    Artisan::call('schedule:run');
    return 'OK';
});

Make sure to add authentication/token to avoid misuse.

Downside:

4. Use Queue Worker + Inline Scheduler

If your queue is always active, add the scheduler to the worker loop.

Modify the queue worker script:

while (true) {
    Artisan::call('schedule:run');
    Artisan::call('queue:work --stop-when-empty');
    sleep(60);
}

This is suitable for small systems without Supervisor, but make sure the load is light.

Downside:

Conclusion

So, can you run Laravel Scheduler without cron? Absolutely. You can use:

However, each method has its own downsides:

If you’re tinkering with Laravel on a small VPS or in a limited environment, these techniques can be a creative and efficient alternative solution, but consider the trade-offs for reliability and resource consumption.

Tags : scheduler worker
Octopy ID Octopy ID

2025 © Octopy ID — All Rights Reserved.