How to restart a node.js server

If it’s just running (not a daemon) then just use Ctrl-C.

If it’s daemonized then you could try:

$ ps aux | grep node
you   PID  1.5  0.2  44172  8260 pts/2    S    15:25   0:00 node app.js
$ kill -2 PID

Where PID is replaced by the number in the output of ps.

Leave a Comment