How to save and restore tmux sessions across reboots
Install the plugins that persist sessions across restarts:
What survives what
Detaching survives anything short of a reboot — sessions live in the tmux server process. A reboot kills the server and everything in it; tmux has no built-in persistence. tmux-resurrect saves sessions/windows/panes/paths (prefix Ctrl-s to save, Ctrl-r to restore), and tmux-continuum automates it:
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'Set expectations
Resurrect restores layout and directories, not running state — your vim session, REPL history, and half-finished processes don't come back (vim/neovim session restore exists via an extra setting, imperfectly). Long-running programs must be restarted.
The scriptable alternative
A 10-line script that rebuilds your workspace (new-session -d, split-window, send-keys) is deterministic, versionable, and never corrupts. Many long-time users prefer it — see the send-keys page for a template. Tools like tmuxinator, tmuxp, and sesh formalize the same idea.
Related
Verified against tmux 3.6 · updated July 2026 · back to the full cheat sheet