pm2 process manager for node.js

Auto Start pm2 on boot
How to host static site using pm2

pm2 is a process manager for node.js applications. It is similar to forever.

http://pm2.keymetrics.io

Advertisement

First you need to install npm, on Ubuntu/Debian, run

apt install npm

To install pm2, run

npm install pm2 -g

Start an Application

pm2 start app.js

Start an Application with name

pm2 start app.js -n "app-name-here"

Start npm

pm2 start npm --name my-app -- run start

Start the Application in Cluster mode with

pm2 start app.js -n "app-name-here" -i 5

To Scale a clustered application, run

pm2 scale app-name-here 2

Start the processes on reboot

pm2 save
pm2 startup

List running applications

pm2 ls

Controlling running application

pm2 stop
pm2 restart
pm2 delete

Restart all running applications

pm2 restart all
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement