Supervisor process management
Supervisor is a Python-based process management tool for monitoring and controlling Unix/Linux processes on a system.
Detailed tutorial blog post
Overview
Supervisor can:
- start, stop, and restart processes automatically
- monitor process status and restart crashed processes automatically
- provide a web management interface
- record process output logs
- manage processes in groups
Installation
Ubuntu/Debian
CentOS/RHEL
Python pip
Configuration File
Main configuration file location:
- Ubuntu:
/etc/supervisor/supervisord.conf
- Per-program config files:
/etc/supervisor/conf.d/*.conf
Basic configuration structure
Common Commands
Manage the Supervisor service
Manage processes
Configuration examples
Python web app
Node.js app
Celery Worker
Process groups
Web interface
Enable the web management interface:
Visit:http://localhost:9001
Environment Variables
Log Management
Graceful shutdown
Multi-process management
Troubleshooting
ViewLog
FAQ
-
Process fails to start
- Check whether the command path is correct
- Check user permissions
- ViewLogfile
-
Process restarts too often
- Increase the
startsecs value
- Check whether the program itself has an issue
-
Configuration does not take effect
Best Practices
- Separate config files: use one config file per program.
- Set reasonable log sizes to avoid filling up the disk.
- Use dedicated users for better security.
- Use process groups for easier batch management.
- Use environment variables to separate config from code.
- Add alerting by integrating with monitoring systems.
- Back up configurations regularly and keep them under version control.
Alternatives
- systemd: Linux service management
- PM2: Node.js process manager
- circus: Python process management
- monit: system monitoring and process management
References
Last modified on April 17, 2026