Linux Guide

Install tmux on Ubuntu & Linux

Linux is the native home of tmux. Every major Linux distribution includes tmux in its official package repositories. Choose your package manager below — or build the absolute latest version from source to access every new feature the moment it ships.

Verified for Ubuntu 24.04 LTS, Debian 12, Fedora 40, Arch Linux · tmux v3.6a

Install by Distribution

Select your Linux distribution for the exact package manager command.

Standard

APT Package Manager

The easiest way for Ubuntu/Debian users. Note: The apt version may be one or two releases behind the latest upstream tmux release.

bash

$ sudo apt update && sudo apt install tmux

$ tmux -V

Latest Version

Snap Package

Snap installs the latest tmux version available, bypassing the potentially older distribution repository version. Works on Ubuntu 16.04+ and any distro with snapd.

bash

$ sudo snap install tmux --classic

$ tmux -V

DNF / YUM

Fedora / RHEL / CentOS

bash

# Fedora

$ sudo dnf install tmux


# RHEL / CentOS (enable EPEL first if needed)

$ sudo yum install epel-release

$ sudo yum install tmux

$ tmux -V

Pacman

Arch Linux / Manjaro

Arch mirrors typically carry the latest stable tmux release almost immediately after it's published.

bash

$ sudo pacman -S tmux

$ tmux -V

APK

Alpine Linux

Lightweight and fast — common in Docker containers and minimal server environments.

bash

$ apk add tmux

$ tmux -V

1

Install build dependencies

tmux requires libevent, ncurses, bison, and build tools:

bash

$ sudo apt install libevent-dev libncurses-dev build-essential bison pkg-config automake

2

Clone, configure, build, and install

build-linux.sh

$ git clone https://github.com/tmux/tmux.git

$ cd tmux

$ sh autogen.sh

$ ./configure && make

$ sudo make install

$ tmux -V

Ubuntu LTS Version Compatibility

Which version of tmux ships by default with each Ubuntu LTS release via apt.

Ubuntu LTS Released tmux via apt Latest tmux Recommendation
Ubuntu 24.04 LTS (Noble) Apr 2024 3.3a 3.6a Use snap or build from source for latest
Ubuntu 22.04 LTS (Jammy) Apr 2022 3.2a 3.6a Build from source for latest features
Ubuntu 20.04 LTS (Focal) Apr 2020 3.0a 3.6a Strongly recommend build from source
Ubuntu 18.04 LTS (Bionic) Apr 2018 2.6 3.6a EOL — upgrade OS or build from source

Persistent tmux Daemon via systemd User Service

Ensure your tmux server launches automatically upon system boot and persists across SSH disconnections.

1. Create systemd User Service Unit

Create ~/.config/systemd/user/tmux.service with the following daemon specification:

tmux.service

[Unit]

Description=tmux background daemon


[Service]

Type=forking

ExecStart=/usr/bin/tmux new-session -s default -d

ExecStop=/usr/bin/tmux kill-server

Restart=on-failure


[Install]

WantedBy=default.target

2. Enable Linger & Start Service

Enable user lingering so the daemon runs even when no interactive user sessions are logged in:

bash

$ loginctl enable-linger $USER

$ systemctl --user daemon-reload

$ systemctl --user enable --now tmux

3. Seamless Auto-Attach

Whenever you log in over SSH, simply attach to the running daemon without restarting processes:

tmux attach-session -t default

Linux System Clipboard Integration: Wayland vs. X11

Configure seamless copy-paste between tmux copy mode and your Linux desktop environment.

WAYLAND

Wayland Clipboard (wl-clipboard)

On modern Ubuntu 22.04+ and Fedora (GNOME/KDE Wayland sessions), install wl-clipboard:

sudo apt install wl-clipboard

Add to ~/.tmux.conf:

bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
X11

X11 Clipboard (xclip / xsel)

On traditional X11 desktop sessions, install xclip:

sudo apt install xclip

Add to ~/.tmux.conf:

bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
SSH

Headless SSH (OSC 52)

When connecting to a remote Linux server from your laptop, enable ANSI OSC 52 clipboard escape sequences:

set -s set-clipboard on

Troubleshooting on Linux

Resolutions for permissions, locale, and outdated package repositories.

Permission errors during install
Ensure you have sudo privileges. If you're on a shared server without sudo, build tmux from source into a local directory: pass ./configure --prefix=$HOME/.local during the build, then add $HOME/.local/bin to your PATH.
The apt version is too old — how do I get the latest tmux?
The tmux packages in Ubuntu/Debian repositories often lag behind the latest release by 1–3 versions. Your options are: (1) Use snap install tmux --classic for a more current version, (2) Build from source using the steps in the "Source" tab above, or (3) Wait for a backport. Building from source is the only guaranteed way to get the absolute latest version.
Locale / UTF-8 display issues
If tmux shows garbled characters or box-drawing symbols aren't rendering, set your locale to UTF-8. Run locale to check your current settings. Configure with sudo locale-gen en_US.UTF-8 and sudo update-locale LANG=en_US.UTF-8. Also add export LANG=en_US.UTF-8 to your ~/.bashrc or ~/.zshrc.
Colors not displaying correctly
Add the following to ~/.tmux.conf: set -g default-terminal "tmux-256color" and set -ga terminal-overrides ",*256col*:Tc". Also ensure your SSH connection or terminal emulator is passing through TERM=xterm-256color.
How to compile without root (non-sudo unprivileged user)
If you are on an institutional cluster or shared VPS without root access, compile libevent and ncurses locally: ./configure --prefix=$HOME/.local && make && make install, then configure tmux with PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig ./configure --prefix=$HOME/.local.

Other Install Guides

🍎 macOS

Install tmux on macOS via Homebrew, MacPorts, or from source.

macOS Guide →

🪟 Windows

Run tmux on Windows via WSL2, MSYS2, or Cygwin.

Windows Guide →