Laravel

Laravel Scheduler Operations on a VPS

Published 2026-11-29 · Updated 2026-11-29 · 9 min read · Sora Panel team

Run Laravel's scheduler from a correctly scoped cron entry, define tasks in application code and monitor the outcome of the work, not just cron itself. Plan for overlapping runs, multi-server locks, time zones, deployments and recovery from missed executions.

A Laravel schedule is application code, but it still needs an operating-system trigger and an operational owner. On a VPS, the usual arrangement is a cron entry that invokes Laravel's scheduler every minute as the application user. That starts the scheduler; it does not guarantee that every scheduled job completed successfully or that a queued task was processed.

Illustration: scheduled application tasks moving through a monitored server
Illustration, not a product screenshot.

Connect cron to the right application

On a conventional VPS, trigger Laravel schedule:run every minute and monitor the resulting work. Plan for overlap, time zones and missed work rather than assuming cron guarantees completion.

The Laravel scheduling guide explains that a single cron entry can invoke schedule:run, while task definitions usually live in routes/console.php. The scheduler checks the tasks due at that instant and runs them according to their definitions. Confirm your project's Laravel version and any custom schedule registration before changing its host configuration.

Choose a dedicated application user with the access needed by the scheduled tasks, not root by default. The user must be able to traverse the release path and read application code, while writable directories and secrets remain restricted to appropriate identities. Verify that the command-line PHP binary has the required extensions and version for the application; the binary used by a web server is not necessarily the same executable that cron resolves.

For an illustrative user crontab, after replacing the path with the actual stable release path and verifying the PHP binary, the entry is * * * * * cd /srv/example/current && /usr/bin/php artisan schedule:run >> /dev/null 2>&1. This line belongs in the application user's crontab, not an arbitrary shell. The && prevents execution in the wrong directory if the change of directory fails. The paths are examples, not commands to apply unchanged to a live server.

Inspect the current crontab first and preserve unrelated entries. Install or edit it using the normal administrative procedure for your distribution; make sure another automation system does not also manage the same entry. The example discards scheduler output, following Laravel's documented pattern, so configure separate task-level logging and monitoring before relying on it. If your policy captures cron output instead, protect logs and ensure output cannot reveal credentials or personal data.

From the application directory as the same user, php artisan schedule:list is a useful read-only inventory of definitions and next due times. It is not proof that cron is running or that an external side effect completed. Do not use schedule:run as a casual production test: it can execute any task due at that moment. Test a purpose-built harmless task in a representative staging environment instead.

Understand frequency and actual work

Frequency methods express when a task is eligible, not a guarantee of a successful outcome. The chart calculates eligible runs over a normal 24-hour day for unconstrained schedules from Laravel's documented frequency methods. It assumes the scheduler is invoked on every minute, with no filters, maintenance suppression, downtime or daylight-saving transition. It is an arithmetic planning aid, not an observed production measurement.

Scheduled task opportunities per day

Calculated for an uninterrupted 24-hour day without task constraints

  • everyMinute
    1,440
  • everyFiveMinutes
    288
  • everyFifteenMinutes
    96
  • hourly
    24
  • daily
    1
Eligible times are not observed executions or successful completions. 24 × 60 ÷ interval in minutes, or one daily; assumes no downtime, filters or DST transitions. Source: Laravel scheduling frequencies; arithmetic over 24 hours, viewed 2026-11-29.
View chart data
Itemeligible runs per dayNote
everyMinute1,440
everyFiveMinutes288
everyFifteenMinutes96
hourly24
daily1

A task that takes longer than its interval can overlap the next invocation. A scheduled job that merely dispatches a queued job has another dependency: a healthy queue worker must consume it. Running the scheduler more often does not by itself repair a stopped worker or a failing database. For worker lifecycle and deployment checks, see Laravel queue workers during deployment.

LayerWhat to verifyWhat it does not prove
CronCorrect user, path, binary and triggerBusiness task succeeded
SchedulerTask appears in schedule and is dueQueue worker consumed a job
WorkerExpected queue is being consumedExternal side effect is correct
Business resultDurable completion and expected outcomeFuture runs will succeed

Use the chart to estimate how much routine work a configuration attempts. Avoid treating these counts as an SLA or as an argument to increase frequency. Pick the cadence from the business deadline, expected runtime, load on dependencies and recovery strategy. A cheaper check may run frequently while an expensive report runs less often; both still need an owner and alert route.

Control overlap and multiple servers

Laravel offers withoutOverlapping() for scheduled tasks that must not run concurrently. Its lock uses the configured cache; select a shared and reliable cache when the same task can be invoked across machines. Decide a sensible lock expiry for the expected maximum runtime and failure mode. A lock that expires too early can allow concurrent work; one that remains after a crash can delay recovery. Inspect the cause before clearing a lock, because clearing a live task's lock can start duplicate work.

For schedules evaluated on multiple servers, Laravel's onOneServer() uses an atomic lock to select one server, provided all servers use a supported central cache configuration. Give differently parameterized tasks distinct names when required by the framework documentation. Alternatively, operate the cron entry on a designated scheduler host and document how another host takes over. Neither arrangement eliminates the need for idempotent tasks: a crash after a side effect can leave completion uncertain.

Choose a consistent scheduling time zone and document it beside the business requirement. Laravel warns that daylight-saving changes can cause a local-time task to run twice or not at all. For time-sensitive billing or reporting, record the business period being processed, make repeat execution safe, and use a reconciliation process. A calendar day in one time zone is not interchangeable with a fixed elapsed interval in another.

Understand maintenance mode as well. Laravel normally skips scheduled tasks while the application is in maintenance mode unless a task is explicitly configured to run. Marking a task to run during maintenance should be a deliberate choice based on its dependencies, not a blanket workaround. A task that reads a partially migrated schema can be more harmful than a missed run.

Deploy without losing track of a run

Use a stable path that resolves to the intended release, and ensure the application user and CLI runtime can access it after the switch. Review what happens when an existing task continues on the old release while the next invocation starts on the new one. Keep schemas and shared files compatible for the overlap, or pause producers and wait for active work under an approved maintenance procedure. Keep a recovery point and do not assume a code rollback reverses database changes.

For schedules with sub-minute tasks, Laravel documents that schedule:run continues through the current minute. Its schedule:interrupt command can stop an in-progress scheduler invocation after a deployment so subsequent work uses the new code. Run it only in the intended environment as part of a tested deployment procedure. Do not use it as a substitute for waiting for or reconciling the work of a task that already started.

Review configuration caching as part of the release. The deployment guide explains that cached configuration changes how environment values are loaded. Ensure scheduler invocations see the same intended settings as the application; do not print secrets in deployment logs while debugging. Long-lived queue workers must separately be restarted so that scheduled queued work is handled by the intended release.

Monitor results and recover missed work

Instrument a task with a start record, a completion record and an outcome associated with the logical period or job identifier. Alert on an overdue expected completion, failures, abnormal duration and unexpected duplicate execution. A cron process exiting successfully does not prove an external API accepted a request or a queued job finished. Keep monitoring independent enough to report a complete failure of the application or host.

Use Laravel's task hooks and output facilities where appropriate, and protect any logs that include customer information. An external heartbeat can track whether a critical task reaches the end of its actual work, not merely whether it was dispatched. For queued work, send the success signal from the consumer after durable completion. Check alert routing and ownership with an intentional staging failure, rather than waiting for a production incident.

When a run is missing, first establish the time window, scheduler host, release, maintenance state, lock state and dependency health. Check whether the task ran late or whether a prior attempt already performed the external operation. Then use a reviewed, task-specific replay or reconciliation command with a defined date range and idempotency check. Do not assume cron catches up missed entries automatically, and do not run a broad command whose side effects you have not inspected.

Document the cron owner, deployment path, timezone, cache and queue dependencies, task owner, success signal and escalation route. Exercise host replacement and a missed-run recovery in staging. Review the inventory when hosts or releases change; duplicated cron entries during a migration can otherwise silently turn one intended run into concurrent work.

For context on application deployment, see deployment ownership. Sora Panel is not released yet. Read how it works on the homepage.

Frequently asked questions

Does Laravel's scheduler need a cron entry?

On a conventional VPS, use an operating-system trigger such as the documented every-minute cron entry for schedule:run. Plan for overlap, time zones and missed work rather than assuming cron guarantees completion.

Does schedule:list prove tasks ran?

No. It displays definitions and next due times, not a record of successful execution.

Do missed cron runs automatically catch up?

Do not assume that they do. Design task-specific reconciliation and replay for missed periods.

Does onOneServer remove the need for idempotency?

No. A crash or uncertain external side effect can still require safe retries and reconciliation.

Sources

Sora Panel is not released yet. Read how it works on the homepage.