This site runs best with JavaScript enabled.
laravelsupervisord

Setup Supervisord for Laravel Project

Setup Supervisord for Laravel Project

KL
Khoa Le
·
Setup Supervisord for Laravel Project

Photo by [Mohammad Rahmani](https://unsplash.com/photos/cY1SvvEfRwk)

Laravel worker should always run on the production environment to serve the jobs that application send to. To keep the process running, we use the Supervisord to help

Add Laravel Worker configuration on Supervisord

$ sudo vim /etc/supervisor/conf.d/laravel-worker.conf

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php8.1 /home/forge/your-project/artisan queue:listen database --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=forge
numprocs=1
stdout_logfile=/home/forge/.forge/laravel-worker.log

Let supervisord know about new config.

$ sudo supervisorctl reread
laravel-worker: available

Let supervisord start worker

$ sudo supervisorctl update
laravel-worker: added process group

Verify if supervisor started worker .

sudo supervisorctl
laravel-worker:laravel-worker_00
supervisor>