Tmux Documentation
Tmux is a terminal multiplexer that lets you run multiple terminal sessions inside a single window, detach from sessions, and reattach later — even after SSH disconnects.
Who This Track Is For
- Operators managing remote servers over SSH who need persistent sessions
- Developers running long-running processes, logs, and editors side by side
- DevOps engineers automating multi-pane terminal workflows and monitoring
What You Will Build
- A reliable persistent session workflow surviving SSH drops
- A custom Tmux configuration with intuitive key bindings
- Scripted multi-pane layouts for common server management tasks
- Automated session templates for application monitoring
How To Use This Track
- Follow the modules in order (1 to 11). Each lesson includes real commands and exercises.
- Start with a non-production server or a local VM to practice safely.
- Copy/adapt the config examples to your own
.tmux.confas you progress.
Learning Path
| Module | Focus | Lessons |
|---|---|---|
| 1. Introduction | Fundamentals and mental model | 3 |
| 2. Sessions | Create, attach, detach, kill | 3 |
| 3. Windows and Panes | Layout and splitting | 3 |
| 4. Navigation and Shortcuts | Key bindings and navigation | 3 |
| 5. Configuration | .tmux.conf and customization | 3 |
| 6. Copy Mode | Scrollback, search, and copy/paste | 2 |
| 7. Scripting and Automation | Scripted layouts and automation | 3 |
| 8. Plugins | Plugin manager and ecosystem | 2 |
| 9. Real-World Workflows | DevOps and server admin patterns | 3 |
| 10. Troubleshooting | Root-cause debugging | 2 |
| 11. Cheatsheet | Fast operational reference | 3 |
Core Architecture
How Tmux Works
flowchart LR
CLIENT[Terminal / SSH] -->|attach| SERVER[Tmux Server]
SERVER --> SESSION1[Session: work]
SERVER --> SESSION2[Session: logs]
SESSION1 --> WIN1[Window 1: editor]
SESSION1 --> WIN2[Window 2: shell]
WIN1 --> PANE1[Pane: vim]
WIN1 --> PANE2[Pane: terminal]
Detach and Reattach (SSH Safety)
sequenceDiagram
participant DEV as Developer
participant SSH as SSH Session
participant TMUX as Tmux Server
DEV->>SSH: Connect to server
SSH->>TMUX: tmux new -s work
TMUX-->>DEV: Session running
DEV->>TMUX: prefix + d (detach)
SSH-->>DEV: SSH drops / disconnects
DEV->>SSH: Reconnect
SSH->>TMUX: tmux attach -t work
TMUX-->>DEV: Session restored — nothing lost
warning
Without tmux (or screen), any process running in your SSH session is killed when the connection drops.
Quick Start
first-tmux-session.sh
# 1) Install tmux
sudo apt install -y tmux # Debian/Ubuntu
sudo dnf install -y tmux # RHEL/Fedora
# 2) Start a named session
tmux new-session -s work
# 3) Do your work...
# 4) Detach safely (keeps everything running)
# Press: Ctrl+b, then d
# 5) Reattach when you come back
tmux attach -t work
note
The default Tmux prefix key is Ctrl+b. Every tmux command starts by pressing this prefix, then another key.
Tmux vs Alternatives
| Tool | Use Case | Key Advantage |
|---|---|---|
tmux | Persistent sessions, multi-pane | Scriptable, widely available |
screen | Legacy persistent sessions | Simpler, older |
zellij | Modern terminal workspace | TUI, built-in plugins |
| SSH alone | Simple one-time tasks | No setup needed |
Prerequisites
- Linux shell basics (
ls,cd, paths) - SSH access to a server (or local terminal for practice)
- Basic understanding of processes and shells
Success Criteria
By the end of this track, you can:
- Start persistent sessions that survive SSH disconnects
- Split your terminal into multiple panes for simultaneous monitoring
- Write a script that launches a complete multi-pane layout automatically
- Customize Tmux with a
.tmux.confthat fits your workflow
Next Step
Start with What is Tmux.