Back to blog
backend February 07, 2020

Run Celery as a daemon with supervisor

First you need to install supervisor.

sudo apt-get install supervisor

Then you'll need to create the config file:

sudo nano /etc/supervisor/conf.d/celery.conf

And copy these settings:

[program:celery]
directory = /home/YOUR_PROJECT/
command = /home/YOUR_PROJECT/venv/bin/celery -A config worker --loglevel=info
autostart = true

venv is the virtual environment where you have installed Celery.

And now you will be able to start/restart/stop celery.

supervisorctl reload
supervisorctl start/restart/stop celery