Current time: 03-24-2017, 12:59 PM Hello There, Guest! (LoginRegister)

Post Reply 
How to keep Nodejs running
03-13-2017, 03:31 PM
Post: #1
How to keep Nodejs running
I have a nodejs running on one of my domains. I run `npm start` to start the server. Everything works just fine. However, when I close the terminal is kills the process and my website doesnt work anymore. All the answers on the web say to use the command `forever` but `forever` is not installed on the VPS. To install `forever` I need sudo access and we are not given sudo access on VPS.

How do I run my node server so it stays running?
Find all posts by this user
Quote this message in a reply
03-14-2017, 04:32 AM
Post: #2
RE: How to keep Nodejs running
(03-13-2017 03:31 PM)garyjamjohnson Wrote:  installed on the VPS. To install `forever` I need sudo access and we are not given sudo access on VPS.
How do I run my node server so it stays running?

See if this can help you:
https://discussion.dreamhost.com/thread-...#pid189352

I never installed Node.JS so I can't say if it can be done this way, but I have some permanent processes on my VPS (memcache and two python scripts). In the good old IRC days I also used to run eggdrop that way (not here, obviously).
Visit this user's website Find all posts by this user
Quote this message in a reply
03-14-2017, 09:05 AM
Post: #3
RE: How to keep Nodejs running
Agreed that the post referenced is a good suggestion, just run `nohup nom start &` and it will keep running when you close your terminal.

Justin Lund
DreamHost Product Mgr
Find all posts by this user
Quote this message in a reply
03-14-2017, 10:20 AM
Post: #4
RE: How to keep Nodejs running
Hi Gary, have you already tried enabling Passenger on your domain as described on https://help.dreamhost.com/hc/en-us/arti...le-Node-js ? That should do the trick. Let us know if you have other issues with it, happy to help you troubleshoot.
Find all posts by this user
Quote this message in a reply
03-18-2017, 06:30 PM
Post: #5
RE: How to keep Nodejs running
Neither of these work. I have passenger enabled and I tried the `nohup nom start &` suggestion. It ran my server for about a day and then the process was killed.

I am seriously confused why Dreamhost just doesn't have `forever` command installed on the VPS.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: