Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vishalm's avatar

Best Practices for Running Laravel Scheduler and Queue Worker Together on Production

Hello,

I'm currently working on a Laravel 10 project where I need to set up the scheduler and queue worker to work in tandem. Specifically, I am trying to run the following commands on production environment to ensure both the scheduler and queue are running correctly:

php artisan schedule:work – to run the Laravel scheduler.

php artisan queue:work --queue=Importing,default – to handle jobs on the Importing and default queues.

However, I'm facing some challenges when setting this commands up on a production. So please provide your advice on best practices for setup these commands on a production environment. Is there any recommended way to automate these commands run effectively?

Thanks!

0 likes
3 replies
EmilMoe's avatar

What are the challenges? Otherwise it's hard to address them.

Myself, I set them up in 2 individual Docker containers and have no issues.

puklipo's avatar

First, learn the general usage of running it on a VPS with Laravel Forge.

Don't jump right in and learn unusual usage like using Docker.

For the scheduler, use cron to run php artisan schedule:run every minute. schedule:work is for local development so don't use it.

For the queue, use supervisor and run php artisan queue:work as a daemon. Once you're familiar with it, step up to Horizon.

Learn cron and daemon separately from Laravel. The reason why "Laravel cannot be used by only learning PHP" is because knowledge other than PHP is required to use Laravel in depth.

1 like

Please or to participate in this conversation.