How to run a server without leaving my pc on? Using putty or otherwise

June 4, 2017 1.1k views
Ubuntu 16.04 Linux Commands


Normally when I want to run some piece of code I just open PuTTy, log into my DigitalOcean server and run my python script. However, it seems to me like I have to keep PuTTy open and can’t turn of my pc. Is there any way I can run a command and actually turn of my pc?

My server runs on Ubuntu 16.04.1 x64 if that matters :)


1 Answer


Run your python script in a tmux session like this:

    python /path/to/

Then detach from the session using CTRL+B D and turn off your computer if you want.
When you come back and want to check the session use tmux a to connect to it again.

More about tmux can be found here

Hope this helps.

Have another answer? Share your knowledge.