To install supervisor, use the following command.
sudo apt-get install supervisor
After installation, create supervisor configuration file with instructions to run the processes. To create a configuration file, execute the following command.
sudo nano /etc/supervisor/conf.d/project-name-queue-worker.conf
[program:project-name-queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/project/artisan queue:work
autostart=true
autorestart=true
user=root
numprocs=3
redirect_stderr=true
stdout_logfile=/path/to/project/storage/logs/queue-worker.log
Now to start the queue worker.
systemctl enable supervisord
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-queue-worker:*
for any issues run
sudo supervisord