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

kizagila@gmail.com's avatar

Add Queue Listen as post deployment hook

Hello; I am using using envoyer to deploy to my application server. I am running redis on a separate server. I need to make the queue listen after every deployment. I have the following as my post deployment hook:

cd {{ release }}

php artisan queue:work

I am ending up with the following error:

In AbstractConnection.php line 155:

Error while reading line from the server. [tcp://179.45.208.11:6379]

NB: I have changed the server IP for the question. When remove the hook and I ssh into my application server and run php artisan queue:listen everything works perfectly. My question is, how should I run queue using Envoyer as a post deployment hook?

0 likes
4 replies
shez1983's avatar

have you got forge? if you do you could maybe hit its deployment process which just says php artisan queue:restart..

we have this, i just checked this is what we do:

cd {{release}} php artisan queue:restart

one thing we did do iirc is create a symbolic link to artisan outside of releases folder (ie one folder up)

shez1983's avatar

yes i know but you can hit the URL they give you in forge after your deployment is finished in envoyer.. (ie set a deployment hook and hit that URL) and it will just restart..

but like i said we are doing this in envoy without problems

When remove the hook and I ssh into my application server and run php artisan queue:listen everything works perfectly.```

here you use queue:listen but you are doing queue:work.. 

and which folder do you go and do this command? 
Drfraker's avatar
Drfraker
Best Answer
Level 28

In envoyer you can create a deployment hook from the ui.

Set it up to run after the "Activate New Release" event.

cd {{release}}

php artisan queue:restart

Please or to participate in this conversation.