Running a script in the background in linux can be done using nohup
, using nohup we can run node application in the background
$ nohup node server.js > /dev/null 2>&1 &
nohup
means: Do not terminate this process even when the stty is cut off> /dev/null
means: stdout goes to/dev/null
(which is a dummy device that does not record any output)