Apply for Free VPS

Keep work running with tmux

Updated 27 Nov 2026 tmux terminal

Leave long commands running after you disconnect and return to them later.

If your SSH connection drops, commands in that terminal normally stop. tmux keeps them running.

Install

sudo apt install -y tmux     # Ubuntu, Debian
sudo dnf install -y tmux     # AlmaLinux, Rocky

Basic use

tmux new -s work             # start a named session

Run your command. Then press Ctrl-b, release, and press d to detach.

tmux ls                      # list sessions
tmux attach -t work          # return
tmux kill-session -t work    # end it

Useful keys (after Ctrl-b)

Key Action
c New window
n / p Next or previous window
% Split side by side
" Split top and bottom
[ Scroll back; q to leave

Not for permanent services

A session ends when the server restarts. Anything that should always run belongs in a systemd service.

Was this helpful?

Report outdated or incorrect information