TLDR;
- Set up tmux-resurrect and tmux-continuum to save/restore sessions after reboots
- Manual restore workflow: save before reboot, restore after with simple keybindings
Making Tmux Survive Reboots
Initial Setup
tmux-resurrect saves your complete tmux environment so you can restore it after a system restart. This includes sessions, windows, panes, layouts, and working directories.
The default keybindings are prefix + Ctrl-s to save and prefix + Ctrl-r to restore.
tmux-continuum adds background auto-saving every 15 minutes and can do auto-restore on tmux server start. We’ll use it only for auto-save and keep manual restore control.
Manual Installation (No TPM)
Both plugins support manual installation: clone the repos and load them via run-shell in your ~/.tmux.conf.
Clone both plugins to a stable location:
Add these lines near the bottom of ~/.tmux.conf:
Reload your tmux config from inside a running session:
| |
Enable Status Bar for Auto-Save
Continuum’s periodic autosave requires tmux’s status line to be enabled because it hooks into status-right.
If you’ve disabled the status bar, re-enable it:
| |
Add this to ~/.tmux.conf and reload.
Keep Auto-Restore Disabled
To maintain manual control, simply don’t add set -g @continuum-restore 'on' to your config. Continuum only auto-restores when this option is explicitly enabled.
Auto-restore (when enabled) happens exclusively on tmux server start, not when you re-source ~/.tmux.conf.
Your Reboot Workflow
Before rebooting (or anytime), manually save with:
| |
You’ll see “Tmux environment saved!” in the status bar.
After reboot, start tmux normally, then restore with:
| |
Your sessions, windows, and panes will be recreated.
With continuum installed, background saves happen every 15 minutes automatically, so you won’t lose more than 15 minutes of layout changes even if you forget to save manually.
Next Steps
- If you control remote servers, install tmux there and standardize a “remote tmux everywhere” workflow
- Explore
tmux-resurrectprogram restoration settings if you run specific tools in panes - Consider adding a pre-shutdown hook to save tmux sessions automatically (requires systemd or equivalent)
Verification
Test your setup: