Run Node Service Automatically and Background

I found this amazing node tool when I realised that my node service in AWS was down when the SSH connection was broken due to network interruption. What I need is something that able to run my node service without an active SSH session. And even has the ability to start the service automatically when reboot the OS. The PM2 does a fantastic job for me. Simple tries as below.
Install it:
npm install pm2 -g

Start it by pm2. Go to your app root folder:
pm2 start index.js

Ask pm2 to start your server when reboot
pm2 save


To display all running services managed by pm2:
pm2 list

To stop a service managed by pm2: 0 is the id you can get from pm list (1st column)
pm2 stop 0


Check github for details.
https://github.com/Unitech/pm2

Comments