I have a VPS on DigitalOcean.com using Ubuntu and I was wondering how I can keep a program running 24/7 after I exit out of the terminal.
-
1Make it a daemon : http://www.linfo.org/daemon.html – Jesper Juhl Dec 18 '17 at 02:32
-
1Use [`nohup`](https://en.wikipedia.org/wiki/Nohup), or is there more specific functionality that you want? – Ken Y-N Dec 18 '17 at 02:33
-
@JesperJuhl look into it. – John Dec 18 '17 at 02:35
-
@Ken Y-N I'll No specific functionality. Just the ability to run 24/7. – John Dec 18 '17 at 02:36
1 Answers
One way is to use VNC. I do this myself with ubuntu. VNC is not too difficult to set up. It's remarkably easy to set, much easier than you might think. You basically have a VNC server that runs desktop sessions with XWindows and you connect from any machine. I use Tightvnc on the ubuntu machine, on my windows machine I connect with TightVNC viewer or RealVNC, on a ubuntu client I've used remmina for the client.
The reason I use it is precisely what you describe: I can run things in a windows session and then shut down my laptop and then connect back to it later.
Once you start a VNC session, it will exist 24/7, you can connect to it at any time, terminals and other programs running in the session remain running whether you are connected or not.
When you reconnect it is like you never left. This is different than running things in the background with nohup or as a daemon or whatnot.

- 4,344
- 16
- 30
-
This is way too much of an overkill. Besides, SSH is way easier to use and setup. You can connect to it from everythere, even from eg. a phone as it's just a terminal and does not require any mouse input. – Marko Zajc Jul 01 '19 at 12:17