Solved

Start and keep running node.js instance

Posted on 2016-08-10
4
38 Views
Last Modified: 2016-08-30
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
Comment
Question by:Nathan Riley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
BigRat earned 250 total points (awarded by participants)
ID: 41751842
Try the "forever" package. There's a tutorial here http://www.slidequest.com/q/70ang
0
 
LVL 29

Assisted Solution

by:Jan Springer
Jan Springer earned 250 total points (awarded by participants)
ID: 41752044
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
 
LVL 11

Author Comment

by:Nathan Riley
ID: 41775043
I agree with this, worked for me.
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 41776021
The author was provided with the best solution.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question