PM2 is a production process manager for
Node.js applications, that allows you to keep applications alive forever and reload them without downtime. PM2 also enables you to manage application logging, monitoring, and clustering.
npm install -g pm2
Then, run the
node.js app using
pm2 start server.js --name "my-app"
Following commands are useful while working with
List all running processes:
Stop an app:
pm2 stop my-app
Restart an app:
pm2 restart my-app
To view detailed information about an app:
pm2 show my-app
To remove an app from PM2’s registry:
pm2 delete my-app