Wednesday 25 January 2017

How to make a node.js application run permanently

How to make a node.js application run permanently

  1. Open putty
  2. Login to ssh with username and password
  3. Go to the folder where node file exist.
  4. Execute following command
  5. nohup node server.js &

    then execute following command
    rm nohup.out

  6. Now you can close the putty


Question: How to check nodeJS running?
top

Just look for "node", If its shown means running.



Question: How to stop/kill the node?
Get the "process id" from terminal and kill the same.
kill PROCESS_ID

OR
killall node



How to search the process using command?
ps -fC node