I have created a droplet that hosts a server. Droplet has Ubuntu as OS. For setting up the server in the droplet, I have accessed the droplet console through SSH public key from a local ubuntu machine. The server is spun successfully. However, closing the SSH connection kills all live sessions of the server. How Do I ensure that server continues to spin even after I kill the SSH connection?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
Can you share details about the configuration of the server you run inside the Ubuntu droplet?
I’ll recommend using Docker to run containers if possible. In this way, you’ll have more access in terms of managing the containers and access via ssh when needed.
I’ll recommend using PM2. Here is a tutorial which will help you configure it :
This tutorial aims to help you setup up an Ubuntu server to run Node.js applications, including apps based on Express, Geddy, or Sails. These instructions will help you avoid some security mistakes, as well as provide some surprising benefits such as:
You will not run your app as root; therefore, your app will be more secure.
You will be using port 80 to run your app, which typically can only be accessed by the root user. (You will able to run your app using a custom URL such as http://mysite.com - but you will not have to specify a port.)
Your application will restart if it crashes, and it will keep a log of unhandled exceptions.
Your application will restart when the server starts - i.e. it will run as a service.
Now, if you are using a different service, there are other tutorials which include PM2.