Linux

Keeping your server running after closing SSH: screen and tmux

If your game server stops when you close the terminal, it was tied to the session. With screen or tmux it keeps running and you can return to its console whenever you like.

1 min readUpdated on 6 October 2026

Everything you start in an SSH session dies when you close the session. To keep your server running, start it inside screen or tmux: they are "terminals that do not close", which you detach from and come back to.

With screen (the simplest)

apt install -y screen

# 1) Open a named session
screen -S minecraft

# 2) Inside it, start your server as usual
cd /home/minecraft/server && java -Xms4G -Xmx4G -jar paper.jar --nogui
  • Leave without stopping it: Ctrl + A then D.
  • List your sessions: screen -ls
  • Back to the console: screen -r minecraft

With tmux

apt install -y tmux
tmux new -s rust
  • Leave without stopping it: Ctrl + B then D.
  • List your sessions: tmux ls
  • Back: tmux attach -t rust

Common mistakes

  • Pressing Ctrl + C inside the session stops the server, it does not take you out. To leave without stopping it, use the combination above.
  • "There is no screen to be resumed": the session no longer exists, usually because the server closed or the VPS restarted.

It does not come back after a reboot

screen and tmux survive closing SSH, but not a VPS reboot. If you want the server to start by itself when the machine boots and come back up if it crashes, make it a service: how to create a systemd service.

Related articles

Back to the help centre

Can’t find what you need?

Open a ticket from your panel and we will answer in under 5 minutes.