'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
Solution 1:[1]
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 !
Solution 2:[2]
I will try the docker style next time because im running out of time. I found a way using :
"screen" command !
Solution 3:[3]
Actually the process stop after few hours with screen
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | jim2k |
| Solution 2 | xif |
| Solution 3 | xif |
