๐
P(rocess) M(anager) 2
PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
Start an application
sh
pm2 start app.js
List all processes

sh
pm2 ls
Monitor

sh
pm2 monit
Upgrade
sh
# save correctly all your processespm2 save# install the latest PM2 version from NPMnpm install pm2@latest -g# update the in-memory PM2 processpm2 update# When you upgrade your Node.js version, the node binary path will change.# To update the PM2 startup scriptpm2 unstartuppm2 startup