Tmux is a terminal multiplexer that enables managing multiple command-line sessions remotely. With Tmux you can start a session on a remote server, launch applications in that session, then detach and reattach from that session later.
Key benefits of using Tmux include:
• Resume remote sessions seamlessly - Detach and reattach sessions as needed, even if disconnected.
• Improved remote interactivity - Keep applications and processes running remotely.
• Advanced session control - Tmux supports multiple windows and panes.
• Enhanced productivity - Manage multiple terminals efficiently from a single terminal.
Tmux is highly recommended when working interactively over SSH. The ability to detach and reattach from remote sessions means you can resume seamlessly even if temporarily disconnected. Tmux also improves workflows by enabling multiplexing terminals, applications, and processes across local and remote machines. Other use cases optimized by Tmux include remote development, DevOps, infrastructure management, and any tasks involving remote terminals or command-line access.
Tmux lets you run tasks persistently on remote box, so you can safely disconnect/detach and reconnect/reattach without interrupting these running tasks. It is powerful, extensible and can save more working time when combined with the shortcuts.
Most platforms provide binary packages for tmux. Use the command below to install from binary.
# Debian, Ubuntu $ sudo apt-get install tmux # RHEL/CentOS/Fedora $ sudo yum install tmux # MacOS $ brew install tmux
If you need the latest version, use the commands below to install from source.
git clone https://github.com/tmux/tmux.git cd tmux sh autogen.sh ./configure && make
Or just download tmux and install without git cloning
wget https://github.com/tmux/tmux/releases/download/3.3a/tmux-3.3a.tar.gz tar xzvf tmux-3.3a.tar.gz cd tmux-3.3a ./configure make && sudo make install
Verify installed version
Now that you've completed the installation, type
tmux to start the first session:
Split your pane horizontally by typing:
Ctrl+b then %
Swhich pane by typing:
Ctrl+b then d
Attach to last session: