Say I'm running a minecraft server on my ubuntu server and I log into this machine from a remote ubuntu machine over ssh. I startup the server running a script I have e.g. minecraft.

If I want to log out and keep the server running, I usually minecraft &. say I actually log out after running minecraft &. I log back in an want to restore the same info window I get when I originally ran minecraft &. How would I restore this?


You can use screen or tmux to do this. screen is used more and installed by default, so if you are new to this it's probably best to start with that. Also recommended when you use screen is Byobu (screencast video here), which is a wrapper around screen that makes it easier to use and adds lots of useful extensions to screen (and in the future it will also support tmux).


You can use byobu. It can be installed easily by with

sudo apt-get install byobu

and can be started with


You can set an option through the menus that it will be automatically started when you ssh into the server.

byobu is a front-end that uses screen. It allows the convenient usage of multiple terminal windows through one ssh connection.

  • 1
    wow byobu is awesome so far! how do you close a window? nothing about it in their quickstart guide – tester Nov 2 '11 at 17:40
  • 1
    ah nevermind. found it in this guide: linuxaria.com/howto/screen-byobu?lang=en (Ctrl+a k) – tester Nov 2 '11 at 17:43
  • Say I setup byobu-enable (so it starts every time) and I reboot my server, will byobu restore my processes? – tester Nov 2 '11 at 18:43
  • after reading through this, it looks like screen doesn't do it by default.. brainscraps.wikidot.com/resurrect – tester Nov 2 '11 at 18:47

Look into GNU Screen. It allows long-running programs to execute, and you can "detach" and "reattach" to these sessions at will.

Search the software centre for "screen". The package name is screen.

To detach, just close the ssh session with the red X, (don't exit). Or type ctrl-a d.

To reattach, do

screen -r <screen-id>

Where can be obtained from

screen -list

If the server's interface is console-only, you can use GNU screen to get the persistence you want. If it's graphical, use VNC or nx for persistence.

Or if you don't care about reattaching the process later on, the nohup ("no hangup") command will run a process that ignores the terminate signal triggered when the ssh session ends.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.