Skip to main content

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

  1. Process fails to start
    • Check whether the command path is correct
    • Check user permissions
    • ViewLogfile
  2. Process restarts too often
    • Increase the startsecs value
    • Check whether the program itself has an issue
  3. Configuration does not take effect

Best Practices

  1. Separate config files: use one config file per program.
  2. Set reasonable log sizes to avoid filling up the disk.
  3. Use dedicated users for better security.
  4. Use process groups for easier batch management.
  5. Use environment variables to separate config from code.
  6. Add alerting by integrating with monitoring systems.
  7. 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