简体   繁体   中英

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

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

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 !

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

"screen" command !

Actually the process stop after few hours with screen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM