NodeJS process management


A NodeJS daemon process manager to spawn/start/stop node app .

  supervizer list

  supervizer monit

  supervizer get myApp

  • Start/Stop/Restart a node process
  • Group any node process
  • Start/Stop/Restart a node group process
  • Hot change node process host, port, logs in live ;-)
  • Keep alive/Restart a node process when it crash
  • Monitoring resources (restart count, uptime, memory, cpu etc..) for every process
  • Watch directories/files management to restart process
  • Full RESTfull API management via HTTP
  • LOG files process management
  • PID files process management
  • User execution process management by uid:gid
  • Load/Save all node process configuration from/to json file

To install node supervizer module from npm repository :

  npm install -g supervizer

Or from source:

  git clone git:// 
  cd supervizer
  npm link -g

And run this command to start supervizer master server :


To install supervizer master as daemon, you must run this command as root :

  sudo supervizer --install

To make your process compatible with Supervizer, you must follow this code example to retrieve host and port parameters :

var host = process.argv[2] || '';
var port = process.argv[3] || '5000';

For example, if you use expressjs framework :

var express = require('express');
var server = express();
server.use(express.static(__dirname + '/public'));
server.get('/', function(reqres) {    
    res.end('Hello word!');
server.get('*', function(reqres) {
    res.send('Not Found!', 404);
server.use(function(errreqresnext) {      
    res.send(500, 'Something broke!');
var host = process.argv[2] || '';
var port = process.argv[3] || '5000';
console.log('Listening on port ' + port);

Add your app :

  supervizer add --name myApp --group myGroup --script /path/to/script.js 
  --host localhost --port 3000 --watch /path/to/watch --log /path/to/logfile.log

Start your app :

  supervizer start --name myApp

Stop your app :

  supervizer stop --name myApp

Update your app :

  supervizer set myApp --port 3001

Save all your apps :

  supervizer save --config /path/to/apps.json

Load your apps :

  supervizer load --config /path/to/apps.json

Start all your apps :

  supervizer startAll  
  supervizer [command<options>
    help <command>         print required/allowed options for each command.
    install                install supervizer as daemon
    uninstall              uninstall supervizer as daemon
    load                   load from a process configuration json file
    save                   save to a process configuration json file
    add                    add a node process
    remove                 remove a node process
    start                  start a new node process
    startAll               start all node process
    stop                   stop a node process
    stopAll                stop all node process
    restart                restart a node process
    restartAll             restart all node process
    list                   list all node process
    monit                  monitor all node process
    set <name>             setting process property value
    get <name>             getting process properties values
    -h, --help                  output usage information
    -V, --version               output the version number
    -v --verbose                display verbose data
    -f --force                  force supervizer actions
    -n --name <string>          specify app name
    -z --env <string>           specify comma separated environment variables
    -x --params <string>        specify node command line extra parameters
    -r --run <user:group>       specify user uid:gid to run app
    -g --group <string>         specify app group
    -s --script <path>          specify app main script
    -l --log <file>             specify app log output file
    -t --pid <file>             specify app pid file
    -k --keep <yes/no>          keep alive app (default:yes)
    -t --attempt <number>       max restart to keep alive (default:3)
    -w --watch <path>           specify path to watch
    -e --exclude <regex,regex>  specify regexes to exclude paths
    -h --host <address>         specify address to bind
    -p --port <port>            specify port to bind
    -a --auth <user:password>   specify user/password to use
    -c --config <file>          specify config file to load/save

Supervizer daemon has an RESTfull http interface wich allow you to control it remotely ;-)

GET/Show server banner
loadPOST/config/loadLoad all apps from file
savePOST/config/saveSave all apps to file
addPOST/appsAdd an app to run
removeDELETE/appsStop and Remove an app
startPOST/app/startStart an app
startAllPOST/apps/startStart all apps
stopPOST/app/stopStop an app
stopAllPOST/apps/stopStop all apps
restartPOST/app/restartRestart an app
restartAllPOST/apps/restartRestart all apps
listPOST/apps/listGet app state list
monitPOST/apps/monitMonitor all apps
setPOST/appSet an app property
getGET/appGet an app property

Theses commands actually doesn't work

* help
* install
* uninstall

Theses options actually doesn't work

* force
* auth