TMUX on Terminal: Install, Setup & Practical Guide Complete Beginner to Pro Guide
Learn TMUX on terminal with install steps, setup guide, practical examples, tips, common mistakes, and FAQs for beginners and developers.
If you work on the terminal daily - whether for development, server management, or DevOps - you’ve probably wished you could split your screen, keep sessions running after logout, or manage multiple shells efficiently.
That’s where TMUX comes in.
tmux is a powerful terminal multiplexer that allows you to run multiple terminal sessions inside a single window. You can split panes, detach sessions, reattach later, and manage workflows like a pro.
In this complete guide, you’ll learn:
What TMUX is
How to install and configure it
Common mistakes to avoid
Benefits of using TMUX
Let’s get started.
What is TMUX?
TMUX (Terminal Multiplexer) is a command line tool that lets you:
Run multiple terminal sessions inside one window
Split your screen into multiple panes
Detach sessions and reattach later
Keep processes running after SSH disconnect
It’s widely used by developers, system administrators, and DevOps engineers working on remote Linux servers.
If you frequently use SSH or manage background services, TMUX is a must know tool.
Why Use TMUX?
Here’s why developers love TMUX:
Run long processes safely (even after logout)
Manage multiple services at once
Improve productivity
Work efficiently over SSH
Organize terminal workflows
How to Install TMUX
TMUX is available on most Linux distributions and macOS.
Install on Ubuntu / Debian
sudo apt update
sudo apt install tmuxInstall on CentOS / RHEL
sudo yum install tmuxInstall on Arch Linux
sudo pacman -S tmuxInstall on macOS (Homebrew)
brew install tmuxVerify Installation
tmux -VIf installed correctly, you’ll see the version number.
Basic TMUX Usage
Start TMUX
tmuxYou’ll enter a new TMUX session.
Default Prefix Key
The default prefix key is:
Ctrl + bMost TMUX commands start with this prefix.
For example:
'Ctrl + b' then 'c' -> Create new window
'Ctrl + b' then '%' -> Split vertically
'Ctrl + b' then " -> Split horizontally
Understanding TMUX Structure
TMUX has three main layers:
Session -> A full workspace
Window -> Like a tab
Pane -> Split terminal inside window
How to Create and Manage Sessions
Create a Named Session
tmux new -s myprojectList Sessions
tmux lsAttach to a Session
tmux attach -t myprojectDetach from Session
Press:
Ctrl + b then dYour session continues running in background.
Splitting Panes:
Vertical Split
Ctrl + b then %Horizontal Split
Ctrl + b then "Switch Between Panes
Ctrl + b then Arrow KeysResize Panes
Ctrl + b then Ctrl + Arrow KeyWorking with Windows
Create New Window
Ctrl + b then cSwitch Windows
Ctrl + b then n (next)
Ctrl + b then p (previous)Rename Window
Ctrl + b then ,How to Customize TMUX
You can configure TMUX using a config file:
~/.tmux.confExample Basic Configuration
set -g mouse on
set -g history-limit 10000
bind r source-file ~/.tmux.conf \; display "Reloaded!"Reload configuration:
Ctrl + b then rThis enables mouse support and increases scroll history.
Common TMUX Mistakes
1. Forgetting Prefix Key
Beginners often press commands directly without:
Ctrl + bAlways use prefix first.
2. Closing Window Instead of Detaching
Typing 'exit' closes pane/window.
Instead use:
Ctrl + b then dTo detach safely.
3. Not Naming Sessions
Avoid:
tmuxUse:
tmux new -s project-nameEasier to manage multiple sessions.
4. Ignoring Configuration
Default settings are basic. Add:
Mouse support
Better keybindings
Custom status bar
Benefits of Using TMUX
1. Session Persistence: Your processes continue running after logout.
2. Productivity Boost : Split panes reduce window switching.
3. Better SSH Workflow: Essential for remote servers.
4. Lightweight & Fast: Consumes minimal system resources.
5. Professional Development Workflow: Most DevOps and backend engineers use TMUX daily.
Advanced Tips
Kill a Session
tmux kill-session -t myprojectKill All Sessions
tmux kill-serverCopy Mode
Ctrl + b then [Use arrow keys to scroll.
Press 'q' to exit.
TMUX vs Screen
GNU Screen is another terminal multiplexer.
Feature | TMUX | GNU Screen |
|---|---|---|
Modern UI | ✅ | ❌ |
Active Development | ✅ | Limited |
Customization | Advanced | Basic |
Mouse Support | Yes | Limited |
Conclusion
TMUX on terminal is one of the most powerful productivity tools for developers and system administrators.
It allows you to:
Split screens
Manage multiple sessions
Keep processes running
Work efficiently over SSH
If you work on Linux servers or remote machines regularly, learning TMUX will drastically improve your workflow.
Start with basic session management, then move to pane splitting and customization. Within a week of usage, you’ll never want to work without it.