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

AbdallahSabri's avatar

How to make queue worker works on cloud hosting?

I have a project in laravel, to make this projects works correctly the queue worker command php artisan queue:work MUST run always, if I use SSH from my laptop it stops when I exit command line.

How to make queue worker works forever?

0 likes
5 replies
penkoad's avatar

Can't you setup supervisor ?

Anyway, you can go for

nohup php artisan queue:work &

And disconnect without the job quitting.

penkoad's avatar

I mean that it seems to me that you are running your own machine to host your project since you are connecting to it via SSH. In the documentation there is a paragraph to help you setup supervisor which is a daemon that will take care of your workers. They will always run no matter what and if anything happens supervisor will respawn them.

So you don't have to bother anymore...

https://laravel.com/docs/5.5/queues#supervisor-configuration

AbdallahSabri's avatar

@penkoad I create this supervisor configuration, it works but when I access any link in a project while processing the queue, it shows 504 Gateway Time-out. If I wait about 1 minute this error message will go and the project will work fine.

What should I do to avoid 504 Gateway Time-out page?

Please or to participate in this conversation.