Tag: node

  • 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

    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

    nodejs