I have an MEAN application running on server through Amazon Lightsail. I installed my application in the /projects
folder and once I ssh onto the server and run node bin/www
(where my main startup scripts live) the site runs perfectly. The issue comes once I close the ssh shell the site goes down (node stops running). Does lightsail /
AWS provide any utilities to keep up the server or do I need to manually install a service that keeps it up so I can point a domain at the IP and it is consistently running?
Asked
Active
Viewed 306 times
0

Eugene Lisitsky
- 12,113
- 5
- 38
- 59

eric MC
- 766
- 2
- 10
- 36
-
https://stackoverflow.com/questions/26245942/how-do-i-leave-node-js-server-on-ec2-running-forever has been helpful but still looking into how to restart the screen process on reboot – eric MC Nov 14 '17 at 14:34
-
1I'm not familiar with lightsail but I would recommend looking at one of pm2, forever, nodedemon or strong-pm. I personally use pm2 for any node servers I run on AWS. – Razzildinho Nov 14 '17 at 14:38
-
1[These instructions](http://pm2.keymetrics.io/docs/usage/startup/) will help with starting the server on boot. – Razzildinho Nov 14 '17 at 14:40