install

  1. npm install pm2@latest -g
  2. # or
  3. yarn global add pm2

start

  1. pm2 start app.js
  2. pm2 start python-app.py --watch
  3. pm2 start binary-file -- --port 1520

manager

  1. pm2 [list|ls|status|logs|monit|plus|save|update]
  2. pm2 restart app_name
  3. pm2 reload app_name
  4. pm2 stop app_name
  5. pm2 delete app_name
  6. pm2 stop all # Stop all processes
  7. pm2 restart all # Restart all processes
  8. pm2 reload all # Will 0s downtime reload (for NETWORKED apps)
  9. pm2 stop 0 # Stop specific process id
  10. pm2 restart 0 # Restart specific process id
  11. pm2 delete 0 # Will remove process from pm2 list
  12. pm2 delete all # Will remove all processes from pm2 list

file

  1. pm2 ecosystem
  2. pm2 start process.yml
  3. pm2 startup