# Laravel queues and scheduler on fortrabbit

Source: https://docs.fortrabbit.com/guides/laravel/queues-scheduler
Published: 2026-10-24
Updated: 2026-10-24
Reviewed: 2026-10-24

> Run Laravel queues and the scheduler on fortrabbit: the database queue driver, a queue:work worker job and a schedule:run cron job.


## Queue

fortrabbit offers no Redis, so the `database` driver is the queue of choice. It uses the MySQL database. Laravel 11 and later ship the `jobs` table migration; older versions create it:



```shell
# Create a migration for the jobs table locally
php artisan queue:table

# Apply the migration locally
$ php artisan migrate

# Add, commit and push the migration file
$ git add .
$ git commit -m "queue migration"
$ git push

# Run the migration on the App via SSH remote execution
$ ssh {{app-env-id}}@ssh.{{region}}.frbit.app php artisan migrate --force
```

Set `QUEUE_CONNECTION=database` in the [ENV vars](/platform/settings/env-vars). Then add a [worker](/platform/jobs/workers) with this command:



```shell
php artisan queue:work --sleep=3 --tries=3 --max-time=3600
```

Use `queue:work`, not `queue:listen`: `queue:listen` boots Laravel for every job, `queue:work` boots it once and keeps running. `--max-time` restarts the worker every hour, which frees memory.

The worker and the scheduler cron are two jobs. [Jobs](/platform/components/jobs) XS holds one job, so both need Jobs SM or larger.

## Scheduler

Laravel's scheduler lets you define recurring tasks in code instead of managing many separate crontab entries. Add a single [cron job](/platform/jobs/crons) that runs every minute and let Laravel decide what's actually due:



```shell
* * * * * php artisan schedule:run
```

See [job usage](/platform/jobs/usage) for adding the cron job in the dashboard.

Two things to watch:

- Avoid `->runInBackground()`, it will not work at all with `schedule:run`. We have to keep the platform performant for everyone, so we kill any process still running after the job that started it exits - see ["do not detach"](/platform/jobs/tuning#do-not-detach). If you have to use `runInBackground()`, then it works better with a non stop job that calls `artisan schedule:work` instead, because that parent job stays running.
- Use `->withoutOverlapping()` on tasks that might run long. It stops Laravel from starting a new instance of a task while a previous run is still in progress, keeping `schedule:run` itself fast. Without it, slow tasks pile up invocation after invocation and can hit the platform's own limit on concurrent instances of the same cron job - see ["overlapping jobs"](/platform/jobs/tuning#overlapping-jobs).

---

- [Jobs usage](/platform/jobs/usage)
- [Laravel tuning](/guides/laravel/tune)
