• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 46
  • Last Modified:

Start and keep running node.js instance

I'm trying to figure out how to keep a node.js instance running.

Right now I open up ssh and run "node server" and everything takes off and goes.  As soon as I close SSH obviously the server goes down.  I tried screen, but then my server unexpectedly quit last night, is there a better solution for starting it up and keeping it running? If crashes then restart it?
0
Nathan Riley
Asked:
Nathan Riley
  • 2
2 Solutions
 
BigRatCommented:
Try the "forever" package. There's a tutorial here http://www.slidequest.com/q/70ang
0
 
Jan SpringerCommented:
And, use forever in an init script.  If you have ubuntu, you can use upstart or systemctl if it's a later version.  With CentOS, you can easily create an init script.

This way, your job will start on boot, as well.
0
 
Nathan RileyFounder/CTOAuthor Commented:
I agree with this, worked for me.
0
 
Jan SpringerCommented:
The author was provided with the best solution.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now