Skip to content

tmux

Installing tmux: apt, dnf, pacman, apk, and from source

Install tmux with apt, dnf, pacman or apk, then check tmux -V — several distros ship a version too old for features like display-popup or true color.

The mtmux team6 min read

sudo apt install tmux on Debian and Ubuntu, sudo dnf install tmux on Fedora and RHEL, sudo pacman -S tmux on Arch, sudo apk add tmux on Alpine. All four give you a working tmux in one command. The thing worth checking afterward is the version — tmux -V — because several of these ship a tmux that's a year or more behind upstream, and a few common config options depend on the version you actually got.

By distribution

DistroCommandVersion you'll get
Ubuntu 24.04 (noble)sudo apt install tmux3.4
Debian 12 (bookworm)sudo apt install tmux3.3a
Fedorasudo dnf install tmuxCurrent stable release, usually within one or two versions of upstream
RHEL 9 / CentOS Stream 9sudo dnf install tmux3.2a
Arch Linuxsudo pacman -S tmuxCurrent upstream release — Arch tracks tmux closely
Alpine Linuxsudo apk add tmuxWhatever's current in the release branch you're on

Arch and Fedora track upstream closely because both are fast-moving distributions with short release cycles. Debian stable and RHEL are the two you're most likely to find running something noticeably older, because both distributions freeze package versions for years at a time in exchange for stability.

~ — install and verify
[object Object]

Debian and Ubuntu

sudo apt update
sudo apt install tmux

If you're on Debian and specifically want a newer version without a full distro upgrade, bookworm-backports carries a more current build:

/etc/apt/sources.list.d/backports.list
deb http://deb.debian.org/debian bookworm-backports main
sudo apt update
sudo apt install -t bookworm-backports tmux

Fedora, RHEL, and CentOS

sudo dnf install tmux

RHEL 9 and CentOS Stream 9 ship tmux 3.2a through the standard repos, which is recent enough for nearly everything in this series — including display-popup, covered below. If you're stuck on an older RHEL major version with an ancient tmux and can't add a repo, building from source (below) is the reliable path. Amazon Linux 2023 and Rocky/AlmaLinux both track RHEL's package set closely enough that the same dnf install tmux command and the same resulting version apply.

Arch Linux

sudo pacman -S tmux

Arch's rolling-release model means you're almost always within days of upstream, so version mismatches are rarely the problem here — configuration is.

Alpine

sudo apk add tmux

Alpine's version tracks whichever release branch (edge, or a versioned branch like v3.20) your /etc/apk/repositories points at. edge gets you the newest package; a versioned branch gets you whatever was current when that Alpine release shipped.

macOS

brew install tmux

Homebrew always builds the current upstream release, so version lag isn't a concern on macOS. The clipboard and terminal-integration details specific to Mac are covered in tmux on Mac rather than here.

Verifying your install

tmux -V

prints exactly one line, like tmux 3.3a or tmux next-3.5. next- prefixed versions are built from tmux's development branch rather than a tagged release — normal if you built from source against master, unexpected if a package manager gave you one.

When the packaged version is too old

Debian stable in particular is a common source of "why doesn't this config option work" reports, because a ~/.tmux.conf written against current tmux docs assumes options that Debian's frozen version doesn't have yet. Check what actually changed between your version and the one a feature needs before assuming your config is wrong:

FeatureMinimum versionWhat breaks below it
Unified mouse option (set -g mouse on)2.1Older configs need separate mouse-select-pane / mouse-resize-pane options instead
window-size option2.9No control over whether windows size to the smallest, largest, or manual client
RGB / true-color support2.2Truecolor apps fall back to 256-color even with a correct terminal-overrides line
display-popup3.2prefix-bound popup commands (fzf pickers, quick scratch popups) silently fail to bind

If tmux -V comes back below what a feature needs and your distro's backports don't cover it, building from source is the fix.

Building from source

tmux has two real dependencies: libevent and ncurses. You also need a C compiler, make, pkg-config, and a yacc implementation (bison works).

Install build dependencies

On Debian/Ubuntu: sudo apt install build-essential pkg-config libevent-dev libncurses-dev bison. Fedora/RHEL: sudo dnf install gcc make pkgconfig libevent-devel ncurses-devel bison.

Download a release tarball

Grab one from https://github.com/tmux/tmux/releases rather than cloning the repo — releases ship a pre-generated configure script, so you skip needing autoconf/automake.

Configure, build, install

./configure && make then sudo make install. This installs to /usr/local/bin/tmux by default, ahead of the distro package on PATH.

Confirm you got the right one

tmux -V and which tmux — the path should point at /usr/local/bin/tmux, not /usr/bin/tmux, confirming the source build is what actually runs.

If configure stops with curses not found even though libncurses-dev is installed, it's almost always a pkg-config path problem rather than a missing library — pass --prefix=/usr/local explicitly and check pkg-config --list-all | grep ncurses finds something before re-running configure. Missing libevent at link time produces a clearer error naming libevent directly, which is easier to diagnose than the curses case.

Two tmux binaries on the same machine

apt/dnf install to /usr/bin, a source build installs to /usr/local/bin by default. Since /usr/local/bin normally comes first on PATH, the source build wins without needing to uninstall the package version — but it's worth confirming with which tmux rather than assuming.

After installing

Once tmux is on PATH, tmux tutorial walks through the actual mental model and first session, and tmux commands is the reference to keep open while you get used to it. If you're setting it up specifically to check on a long-running job from somewhere other than the machine it's on, mtmux (npm i -g mtmux) attaches to sessions in the tmux you just installed and can push a notification when something finishes.

How do I check which version of tmux I have installed?

tmux -V. It prints a single line like tmux 3.3a.

Why does Ubuntu or Debian ship an old version of tmux?

Debian stable and Ubuntu LTS freeze package versions at release time and only backport security fixes, not new upstream versions, for the life of the release. Debian's bookworm-backports repository carries newer builds if you need one without a full distro upgrade.

What do I need to build tmux from source?

libevent and ncurses as dependencies, plus a C compiler, make, pkg-config, and a yacc implementation like bison. Download a release tarball (not a git clone) so configure is already generated, then ./configure && make && sudo make install.

Is tmux available on CentOS or RHEL by default?

It's not preinstalled, but sudo dnf install tmux pulls it from the standard repos on RHEL 9 and CentOS Stream 9, giving you tmux 3.2a.

Do I need to install anything else to use tmux?

No — tmux is a single binary with no required runtime dependencies once built or installed. A shell to run inside it is the only other thing you need, and every distro already has one.

Put this to work — mtmux attaches to the tmux server you already run.

Related reading