Home > Enterprise >  Npm start in background on a server after SSH connection (EC2)
Npm start in background on a server after SSH connection (EC2)

Time:04-29

I have an app that I start with "npm start" I would like to run it in background. This app is hosted on aws EC2.

I tried :

  • npm start & Doesnt work if I disconnect ssh connection

  • nohup npm start & Same, it fail if I disconnect ssh connection

  • I tried to launch with root, or user, doesnt make any difference.

  • I also tried forever but I didnt manage to launch with npm start like "forever start npm start" doesnt work

Thanks a lot for your help

CodePudding user response:

You have to use docker. You will need to read a lot the documentation, because it's complicated to understand if you dont know it : https://docs.docker.com/get-started/

But it does exactly what you want, running app in background in a container. You can close everything your app will still run.

Enjoy reading !

CodePudding user response:

I will try the docker style next time because im running out of time. I found a way using :

"screen" command !

CodePudding user response:

Actually the process stop after few hours with screen

  • Related