Home / Snippets / How to Install Supervisor in Ubuntu for Laravel Project
How to Install Supervisor in Ubuntu for Laravel Project cover

How to Install Supervisor in Ubuntu for Laravel Project

3.9K

3 years ago

0 comments

In this short snippet, you will learn how to install and manage Supervisor in Ubuntu machine. The steps is very straight forward so let's get started.

Step 1: Install Supervisor in Ubuntu


To install supervisor in ubuntu you can use "apt-get" command line. Do note that you need to use "sudo" in order to run this command.
sudo apt-get install supervisor

Step 2: Supervisor Configuration


The supervisor configuration can be located in "/etc/supervisor/conf.d" and from within this directory, you can create as many configurations as you like.
/etc/supervisor/conf.d
For this example, we'll set up Laravel Horizon supervisor configuration. To create a new file from within the supervisor config directory called "horizon.conf" and the content of the file should be as follows.
[program:horizon]
process_name=%(program_name)s
command=php /home/forge/example.com/artisan horizon
autostart=true
autorestart=true
user=forge
redirect_stderr=true
stdout_logfile=/home/forge/example.com/horizon.log
stopwaitsecs=3600

Step 3: Start Supervisor


Once you have created the configuration, you can start the supervisor process. To start supervisor you can run the following commands. 
sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl start horizon

Other Reads

notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this