Laravel scheduled tasks not running in production? Check these
Short answer: Laravel's scheduler doesn't run by itself: Laravel's documentation says the server needs one cron entry that runs php artisan schedule:run every minute; that command checks which tasks are due. If tasks never fire in production, that cron entry is usually missing, running as the wrong user, in the wrong folder, or failing silently. Run php artisan schedule:list to see what Laravel thinks is scheduled, run schedule:run by hand as the web app's user, and send the cron output to a log so failures stop being invisible. Then check maintenance mode, stuck overlap locks and time zones, which cause most of the remaining cases.
How the scheduler works
You define tasks in code, for example a daily report or a reminder email every 15 minutes. Laravel's docs explain that schedule:run evaluates all scheduled tasks and decides whether each needs to run based on the server's current time, so the server only needs a single cron entry calling it every minute:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Locally you don't need cron: the docs describe schedule:work, which runs in the foreground and invokes the scheduler every minute. That's why everything works on a laptop and nothing happens on the server.
Step 1: is there a cron entry at all?
Check the crontab of the user the app runs as (often the web server user or a deploy user) with crontab -l for that user. New servers, rebuilt servers and moves to a new host commonly lose it. On container platforms there's often no cron daemon; you need a separate scheduled process or the platform's own scheduled jobs feature running the same command.
Step 2: run it by hand
As the same user cron uses, from the project folder:
php artisan schedule:list
Laravel's docs describe this as an overview of scheduled tasks and when each will next run. If your task isn't listed, the schedule isn't being defined where Laravel loads it.
Then run php artisan schedule:run and watch the output. Errors here, such as database credentials, missing extensions or permission problems on storage folders, are what cron hits silently.
Step 3: stop sending output to nowhere
The common cron line discards all output to /dev/null. While troubleshooting, send it to a log file instead, so you can see errors. Also remember cron runs with a minimal environment: the crontab manual notes that cron sets SHELL to /bin/sh and takes HOME and LOGNAME from the user's account, and your interactive shell's settings don't apply. If php isn't found or a different PHP version runs, use the full path to the right PHP binary in the cron line.
Step 4: maintenance mode
Laravel's documentation states that scheduled tasks don't run while the application is in maintenance mode. A deploy script that puts the app into maintenance mode and fails before bringing it back up leaves all scheduled tasks paused. Tasks that must run regardless can use evenInMaintenanceMode, but mostly the fix is making sure deploys always exit maintenance mode.
Step 5: stuck overlap locks
withoutOverlapping prevents a task starting while a previous run is still going. The docs explain it uses your application's cache for locks, which expire after 24 hours by default, and that you can set a shorter expiry in minutes. If a server crashed mid-task, the lock can remain and the task won't run until it expires. The docs mention schedule:clear-cache to clear such locks. Set a realistic expiry for each task.
Step 6: several servers
With more than one app server, every server running the cron entry runs every task, so reports get generated three times. The docs describe onOneServer, which takes an atomic lock so only the first server runs the task. It requires a cache driver that supports this, such as database, Memcached, DynamoDB or Redis, with all servers using the same central cache server. Alternatively, run the scheduler on one designated server only.
Step 7: time zones and slow tasks
You can set a time zone per task or for all schedules. Laravel's documentation warns that around daylight saving changes, tasks scheduled in a time zone that observes it may run twice or not at all, and recommends avoiding time zone scheduling where possible. Keep the scheduler in UTC and convert in your task logic where you can.
Tasks also run one after another by default, so a slow task delays the rest. The docs describe runInBackground for commands, so they run simultaneously.
After every deploy
Add a short check to your deploy script or checklist: confirm the app is out of maintenance mode, run schedule:list to make sure the expected tasks are defined, and check the cron log shows a run within the last couple of minutes. It takes seconds and catches most scheduler problems on the day they're introduced, rather than a week later.
Monitor it
Once fixed, make silence visible: have important tasks record a heartbeat or ping a monitoring service when they finish, and alert if it doesn't arrive. Log each run's start, end and outcome.
A worked example
An illustrative Galway tour operator's Laravel booking system sent pre-trip reminder emails from a scheduled task. After moving to a new server, customers stopped receiving reminders, but nobody noticed for a week. The new server had no cron entry. Once added, nothing still happened: the cron user couldn't write to the storage folder, and output went to /dev/null. Fixing permissions, logging cron output and adding a heartbeat check for the reminder task got reminders flowing, with an alert if they stop.
FAQ
Do I need one cron line per task?
No. One line running schedule:run every minute handles all tasks.
Why does a task run twice?
Multiple servers without onOneServer, daylight saving changes, or two cron entries.
Can I run tasks every few seconds?
Laravel supports sub-minute frequencies, but consider a queue worker for frequent jobs.
What about queued jobs?
Scheduled tasks that dispatch jobs also need a running queue worker.
If your Laravel tasks aren't running reliably, describe your server setup and we'll help you get the scheduler working.