I am new to VPS hosting and successfully migrated my .NET-based Discord bot from a different hosting provider to a Droplet so I could have more control over the bot’s hosting machine. I am able to launch the bot using the command line, but I have found that I need to keep the console open while the bot is running; if I close the console window (or turn off my computer, etc.), the bot stops running. I imagine closing the window automatically logs out the user, which in turn stops the process.
It is a little inconvenient for me to keep a separate window open and either keep my computer running 24/7 or face mandatory downtime whenever it is turned off. Is there a way to keep the process running even after I close the console window? Thanks!
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!
Accepted Answer
Hi there,
One option would be to use the screen
command:
That way you will be able to start your process in a screen session and then detach for it and close your terminal.
An alternative option, is to create a Docker image and then start a Docker container with your app.
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.