When SSH connection to DigitalOcean closes, server doesn't respond any more!?

November 27, 2014 3k views

I’ve got a negroni server (for Go) running on CentOS and have an nginx proxy set up as well. When the command line ssh connection to my DigitalOcean server is open, the server works and I can call the endpoints, but as soon as I close it, it’s like the server shuts down or something! I can no longer get any responses…

Just to provide more information: the way I start the server is by doing “go install myApp” and then “myApp &” to start the server…

Any ideas what I’m missing?

Any help is much appreciated, thank you in advance!

1 Answer


You will know if your server shuts down if you could no longer contact it using ping or ssh, among others.

Reading your situation, my best guess was that your GO app stopped running because:

You run it using a user account that logged in on a TTY. But once the user account logs out (as in your case, i.e., you closed your SSH connection) or the TTY session closes, all child processes that are run by that user on that particular session will be stopped too even when you specifically said that a process should continue running the background (&).

In order to continue running a process in the background for a user logged in on a terminal (TTY), you could run the command with nohup. So in your case, it would be:

nohup myApp &

Try it out.

Have another answer? Share your knowledge.