Updated: 22 October 2026 · Applies to: tmux 3.3a to 3.7c on Ubuntu 24.04 and 26.04, Debian 13, AlmaLinux 10 and Fedora 44 (tested); Windows through WSL according to Microsoft

Install tmux from your system's package manager: sudo apt install tmux on Ubuntu and Debian, sudo dnf install tmux on AlmaLinux, Rocky Linux and Fedora, and brew install tmux on macOS. The tmux project has no Windows version: on Windows, install WSL with wsl --install and run sudo apt install tmux inside Ubuntu, or simply connect to your Linux server over SSH and run tmux there. Then start a session with tmux new -s work, leave it running with Ctrl+b then d, and come back with tmux attach -t work.

What tmux does

tmux is a terminal multiplexer. It keeps your shells and programs running on the server inside a session, even when your SSH connection drops, and lets you split one terminal into several windows and panes. A long backup, upgrade or scan started inside tmux keeps going after you disconnect.

Install tmux on Linux and macOS

  • Ubuntu and Debian: sudo apt install tmux. We got tmux 3.4 on Ubuntu 24.04, 3.6 on Ubuntu 26.04 and 3.5a on Debian 13.
  • AlmaLinux, Rocky Linux and RHEL 10: sudo dnf install tmux. It comes from the BaseOS repository, so EPEL is not needed. AlmaLinux 10 installed tmux 3.3a (its tmux -V prints tmux next-3.4).
  • Fedora: sudo dnf install tmux (tmux 3.7c on Fedora 44).
  • macOS: brew install tmux with Homebrew, or port install tmux with MacPorts, according to the tmux wiki.

Check the installed version with tmux -V.

Install tmux on Windows

tmux needs a Linux or Unix-like environment. You have three options:

  1. Use tmux on the server, not on your PC. If you only want tmux for work on a Linux VPS or server, connect with SSH from PowerShell or Windows Terminal (ssh deploy@203.0.113.10) and run tmux on the server. According to Microsoft, Windows includes an OpenSSH client as an optional feature since Windows 10 build 1809. Nothing needs to be installed on Windows itself.
  2. WSL (recommended for a local tmux). According to Microsoft, open PowerShell as administrator, run wsl --install and restart; this installs Ubuntu by default on Windows 10 version 2004 (build 19041) or later and Windows 11. Open Ubuntu and run sudo apt update && sudo apt install tmux. Our guide How to Run Linux and Linux Apps on Windows 10 and 11 (WSL) walks through WSL.
  3. MSYS2. MSYS2 packages tmux for its own shell (its package list shows tmux 3.7c): open an MSYS2 terminal and run pacman -S tmux. tmux then runs inside that terminal, not inside PowerShell or Command Prompt.

Your first tmux session, step by step

  1. Start a named session: tmux new -s work. A status bar appears at the bottom of the terminal.
  2. Run your command, for example a long update or backup.
  3. Detach: press Ctrl+b, let go, then press d. You are back in your normal shell and the command keeps running.
  4. List sessions: tmux ls.
  5. Reattach: tmux attach -t work (plain tmux attach is enough when only one session exists). This also works from a new SSH connection.
  6. Finish: type exit in every window, or run tmux kill-session -t work.

Lab output from Ubuntu 26.04 (tmux 3.6), with a job started in the background:

tmux new -d -s backup 'for i in 1 2 3; do echo step $i; sleep 1; done; exec bash'
tmux ls

Output:

backup: 1 windows (created Mon Oct 12 13:20:23 2026)
work: 1 windows (created Mon Oct 12 13:20:23 2026)
tmux capture-pane -p -t backup | grep step

Output:

step 1
step 2
step 3

tmux new -d starts a session without attaching to it, and tmux capture-pane -p prints what a session shows, which is handy in scripts. Messages you may see: no sessions (nothing to attach to), duplicate session: web (the name is taken) and no server running on /tmp/tmux-0/default (no session exists at all).

Basic tmux shortcuts

Every shortcut starts with the prefix Ctrl+b, then the key. These are the defaults, checked with tmux list-keys:

  • c new window; n and p next and previous window; 0 to 9 go to a window by number; w pick a window from a list.
  • , rename the window; & close the window (asks y or n).
  • % split the pane left and right; " split it top and bottom.
  • Arrow keys move between panes; o goes to the next pane; z zooms a pane to full size and back; x closes a pane (asks y or n).
  • [ scroll back through output (copy mode; press q to leave).
  • s switch between sessions; d detach; ? list all shortcuts.

Customise tmux with ~/.tmux.conf

tmux reads ~/.tmux.conf when it starts. This example loaded without errors on tmux 3.3a, 3.4 and 3.6:

# Use Ctrl+a as the prefix instead of Ctrl+b
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Mouse support: click panes, drag borders, scroll
set -g mouse on
# Longer scrollback (the default is 2000 lines)
set -g history-limit 50000
# Number windows from 1
set -g base-index 1
# Reload this file with prefix + r
bind r source-file ~/.tmux.conf \; display "Config reloaded"
# Status bar colours
set -g status-style bg=black,fg=green

Apply changes to a running tmux with tmux source-file ~/.tmux.conf. Current versions already use tmux-256color as the default terminal (3.3a, 3.4 and 3.6 in our tests), so older guides' screen-256color line is no longer needed.

Related guides

Official documentation: tmux wiki: Installing and Microsoft Learn: Install WSL.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket