4 min read

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 tmux

Install on CentOS / RHEL

sudo yum install tmux

Install on Arch Linux

sudo pacman -S tmux

Install on macOS (Homebrew)

brew install tmux

Verify Installation

tmux -V

If installed correctly, you’ll see the version number.

Basic TMUX Usage

Start TMUX

tmux

You’ll enter a new TMUX session.

Default Prefix Key

The default prefix key is:

Ctrl + b

Most 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 myproject

List Sessions

tmux ls

Attach to a Session

tmux attach -t myproject

Detach from Session

Press:

Ctrl + b then d

Your session continues running in background.

Splitting Panes:

Vertical Split

Ctrl + b then %

Horizontal Split

Ctrl + b then "

Switch Between Panes

Ctrl + b then Arrow Keys

Resize Panes

Ctrl + b then Ctrl + Arrow Key

Working with Windows

Create New Window

Ctrl + b then c

Switch 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.conf

Example Basic Configuration

set -g mouse on
set -g history-limit 10000
bind r source-file ~/.tmux.conf \; display "Reloaded!"

Reload configuration:

Ctrl + b then r

This enables mouse support and increases scroll history.

Common TMUX Mistakes

1. Forgetting Prefix Key

Beginners often press commands directly without:

Ctrl + b

Always use prefix first.

2. Closing Window Instead of Detaching

Typing 'exit' closes pane/window.

Instead use:

Ctrl + b then d

To detach safely.

3. Not Naming Sessions

Avoid:

tmux

Use:

tmux new -s project-name

Easier 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 myproject

Kill All Sessions

tmux kill-server

Copy 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.

Frequently Asked Questions

What is TMUX used for?
TMUX is used to manage multiple terminal sessions inside a single window. It allows splitting panes, detaching sessions, and running long processes safely.
How do I start and stop TMUX?
Start TMUX with: tmux
Does TMUX keep processes running after logout?
Yes. TMUX allows you to detach from a session and reattach later, keeping all processes running in the background.
What is the difference between TMUX and Screen?
TMUX is more modern, actively maintained, and offers better customization compared to GNU Screen.
How do I vertical split the screen in TMUX?
Ctrl + b then %
How do I horizontal split the screen in TMUX?
Ctrl + b then "
How do I reattach to a TMUX session?
List sessions: `tmux ls` Attach: `tmux attach -t session-name`
Is TMUX good for remote servers?
Yes. TMUX is widely used on remote Linux servers because it keeps sessions alive after SSH disconnects.

Related Articles