Like Denys Seguret said, this can be done using the forever node package. Here's how -
SSH into your server and install forever globally as root level user
sudo npm install forever --global
To run forever on a a node script, execute in terminal while in same directory as your server.js like this -
forever start server.js
Make sure to test if its working by launching your browser at the appropriate url. If you want to check the status of all of the forever scripts you have running on your server (you can run it on multiple scripts) run this command -
forever list
and to stop a forever script you can either run forever stop
which will stop all your forever scripts I believe, or run forever stop 0
where 0 is the index of your script in the forever list.
I use forever on all my gulp applications, haven't had any problems yet, but I don't think I have had any major shut down issues with my remote server. Maybe if that happens I'll have more to say about the credibility of forever. Some credits for this answer from this website.