• Home
  • run nodejs as a background by forever

run nodejs as a background by forever

March 27, 2015 Ning 0 Comments

How to run nodejs from background. Here is an easy way

$ nohup node app.js &

Howevery, the forever will do more things, such like export log files, js api…

$ sudo npm install forever -g   #install
$ forever start app.js          #start
$ forever stop app.js           #stop
$ forever start -l forever.log -o out.log -e err.log app.js   #export log and error

How to stop nodejs server?
list node process and kill it.

ps aux | grep node
kill ...

leave a comment

*