How to Install tmux on Debian: Detachable Sessions, Windows and Panes
tmux is the terminal multiplexer: it runs many shells inside one terminal, split into windows and panes, and keeps them running after you disconnect. A tmux session lives in a server process, not in your terminal window, so you can detach, close the window or lose the ssh connection, and attach again later with every program still running where you left it. Inside a session you open windows like tabs, split them into panes, scroll back and copy with the keyboard, and drive all of it from a config file or a script.
Debian packages tmux, but a stable release freezes it for its whole life: Trixie ships 3.5a. Since then tmux has gained floating panes (3.7), modal panes, built-in light and dark themes and a fast window and session switcher (3.8), plus a long list of fixes to terminal handling. tmux publishes source code only, so there is no upstream binary to grab instead, and building it yourself means a C toolchain, the libevent and ncurses development packages, and repeating the exercise for every release.
The unofficial deb.griffo.io repository fills the gap: it builds every tagged tmux release into a standard Debian .deb called tmux, the same name as Debian’s package, so it upgrades the stock tmux in place and keeps it current through APT.
Install the Latest tmux on Debian: The Short Version
If you only came for the commands, this adds the repository and installs the latest tmux .deb package on Debian:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
sudo apt update
sudo apt install tmux
The rest of this guide explains what each command does, what changes when you replace Debian’s tmux, how to get started with sessions, windows and panes, and what to check when something goes wrong.
What Makes tmux Special?
- 🔌 Detach and reattach - Start a long build or a server inside tmux, detach, log out, and attach again from anywhere: everything kept running while you were gone.
- 🪟 Windows and panes - Each session holds windows like tabs, and each window splits into panes, so an editor, a shell and a log tail share one screen.
- 🎈 Floating and modal panes - Floating panes sit above the tiled layout, and modal panes take over the window until you close them, ideal for a quick command or a picker.
- 📋 Copy mode and clipboard - Scroll back through a pane’s history, search it and select text with vi or emacs keys; OSC 52 sends the selection to your desktop clipboard, even from a remote server.
- 🖼️ Images in the terminal - This build has sixel support enabled, so programs that draw sixel images can show them inside a pane when your terminal supports sixel too.
- 🧰 Scriptable to the core - Every action is a command you can bind to a key in
~/.tmux.confor run from a shell script to build a whole layout in one go.
Why Use the deb.griffo.io Repository?
- Same package name as Debian: the package is
tmux, soapt upgradereplaces the stock tmux in place and everything that depends on it (byobu, tmuxinator, tpm, python3-libtmux) keeps working. - Built from every tagged release from upstream’s release tarball, configured like Debian’s own package with systemd, jemalloc and sixel support enabled.
- Consistent terminal features everywhere: ncurses 6.6 is linked in statically, so the clipboard, cursor colour and style and styled underlines behave the same on Bookworm as on Sid.
- Integrated like the archive package:
/usr/bin/tmuxis registered in/etc/shells, and a systemd-tmpfiles rule keeps the server sockets in/tmpfrom being cleaned up under long-lived sessions. - Always tracks upstream releases, typically within hours.
- Works across supported Debian releases on amd64 and arm64, with the codename detected automatically.
Prerequisites
Before you start, make sure you have:
- A Debian-based system (Bookworm 12, Trixie 13, Forky 14, or Sid)
- An amd64 or arm64 machine (a Raspberry Pi 4 or 5 running a 64-bit OS counts as arm64)
sudoprivilegescurlinstalled (sudo apt install curlif needed)
Other architectures, such as armhf and i386, are not built. On those machines Debian’s own tmux remains the option.
Step 1: Add the deb.griffo.io Repository
Add the signing key and repository source:
# Create the keyrings directory
sudo install -d -m 0755 /etc/apt/keyrings
# Download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
# Add the repository (auto-detects your distro codename)
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
# Update the package list
sudo apt update
What each command does:
- Create the keyrings directory - ensures
/etc/apt/keyringsexists with proper permissions. - Install the GPG key - downloads the repository key and de-armours it into a dedicated keyring for verification.
- Add the repository - writes a
signed-bysource line, withlsb_release -scsupplying your Debian codename. - Update the package list - refreshes APT so it knows about the new packages.
Step 2: Update the Package List
If you skipped the last line, run the update now:
sudo apt update
Debian’s own tmux is visible too, so check which version APT is going to pick:
apt policy tmux
The candidate should come from https://deb.griffo.io/apt and carry a ~griffo suffix (for example 3.8-1~griffo).
Step 3: Install tmux
Install, or upgrade, the package with APT:
sudo apt install tmux
If Debian’s tmux was already installed, this replaces it in place: same package name, no conflicts, nothing else removed. The package brings the man page, upstream’s example configuration and its CHANGES file along with the binary.
Step 4: Verify the Installation
Confirm the version:
tmux -V
You should see output similar to:
tmux 3.8
tmux -V reports the client you just ran. If you upgraded while sessions were open, read the next section before assuming the new features are live.
Upgrading With Sessions Already Running
A tmux server keeps running the binary it was started with. After the upgrade, sessions that were already open still belong to the old server. The new tmux command attaches to them normally (the client and server protocol has not changed since 3.2a), but commands and options added since your old version, such as floating panes, only work once the server restarts. Exit your sessions, or stop the server outright:
tmux kill-server
The next tmux you start runs the new version.
Getting Started with tmux
Sessions
Start a named session, detach from it, and come back:
# Start a session called "work"
tmux new -s work
# Detach with the prefix key followed by d: Ctrl-b d
# List the running sessions
tmux ls
# Attach again, from this terminal or from an ssh login
tmux attach -t work
Everything you started inside work kept running while you were detached. That is the core trick, and it is what makes tmux so valuable on servers: run it on the remote host, and a dropped connection only detaches you.
# Connect and reattach in one step
ssh -t myserver tmux attach -t work
Windows and Panes
Inside tmux, every key binding starts with the prefix, Ctrl-b by default. The ones you use all day:
| Keys | Action |
|---|---|
Ctrl-b c | New window |
Ctrl-b n / Ctrl-b p | Next / previous window |
Ctrl-b % | Split into left and right panes |
Ctrl-b " | Split into top and bottom panes |
Ctrl-b + arrow | Move between panes |
Ctrl-b z | Zoom the current pane to full size and back |
Ctrl-b [ | Copy mode, to scroll back and select text |
Ctrl-b d | Detach |
Ctrl-b ? | List every key binding |
Floating and Modal Panes
Floating panes arrived in tmux 3.7 and tmux 3.8 filled them out. They sit above the tiled layout, like popups, but they are real panes: they keep running, and you can move, resize and switch to them.
# A floating pane (also bound to Ctrl-b *)
tmux new-pane
# A modal pane: it blocks the other panes until it exits
tmux new-pane -O htop
move-pane and resize-pane work on floating panes, break-pane can float a tiled pane and join-pane tiles a floating one again. In 3.8 the prefix followed by Tab opens a quick window switcher, and Shift-Tab does the same for sessions.
A Starting Configuration
tmux reads ~/.tmux.conf (or ~/.config/tmux/tmux.conf). A small, sensible start:
# Mouse support: click panes, drag borders, scroll
set -g mouse on
# Number windows and panes from 1, to match the keyboard
set -g base-index 1
setw -g pane-base-index 1
# vi keys in copy mode, and a longer scrollback
setw -g mode-keys vi
set -g history-limit 50000
# Let programs inside tmux set the clipboard through OSC 52
set -s set-clipboard on
# Reload the config with Ctrl-b r
bind r source-file ~/.tmux.conf \; display-message "config reloaded"
Apply it to a running server without restarting anything:
tmux source-file ~/.tmux.conf
The package also ships upstream’s annotated example configuration, a good place to look for more options.
Scripting a Layout
Because every key binding is just a tmux command, a whole workspace can be built from a shell script:
# A detached session with an editor on the left and a shell on the right
tmux new-session -d -s dev -n code
tmux split-window -h -t dev:code
tmux send-keys -t dev:code.0 'nvim' Enter
tmux attach -t dev
Tools such as tmuxinator do the same from a YAML file, and the tmux plugin manager (tpm) loads plugins from ~/.tmux.conf. Both drive the tmux command, so they pick up the new version with nothing to reconfigure.
Copy Mode and the Clipboard
Press Ctrl-b [ to enter copy mode. With mode-keys vi, move with the vi keys, search with /, start a selection with Space and copy it with Enter. Paste inside tmux with Ctrl-b ].
With set-clipboard on, copied text also reaches the clipboard of the terminal you are sitting at through OSC 52, which works through ssh too, as long as your terminal emulator allows OSC 52 clipboard writes.
Keeping tmux Updated
Because tmux arrived via APT, updates come with the rest of the system:
sudo apt update && sudo apt upgrade
Whenever deb.griffo.io ships a newer tmux, apt upgrade installs it. Remember that running sessions keep the old server: run tmux kill-server, or exit your sessions, when you are ready to switch.
Other Tools from deb.griffo.io
The repository packages plenty of tools that fit naturally alongside tmux:
- Zellij - a terminal workspace and multiplexer written in Rust, with layouts and plugins, if you want to compare approaches.
- workmux - git worktrees paired with tmux windows, so each branch gets an isolated dev environment.
- Neovim - the editor most often found in a tmux pane.
- fish - a friendly interactive shell for every pane.
Troubleshooting
GPG or Key Errors
If APT reports an unsigned repository or an invalid key, import it again:
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Package Not Found or Still the Old Version
If APT keeps offering Debian’s tmux:
- Re-run
sudo apt updateafter adding the repository. - Confirm your release is supported (Bookworm, Trixie, Forky, or Sid).
- Confirm your architecture is amd64 or arm64 with
dpkg --print-architecture. - Inspect the source list:
cat /etc/apt/sources.list.d/deb.griffo.io.list.
On Sid, APT Picked Debian’s tmux
Versions here end in ~griffo, which sorts below Debian’s own revision of the same release. When Sid’s archive has built the same tmux version, its package wins and APT installs it by itself. That is intended: you still get the newest tmux, whichever repository it comes from.
New Commands Report “unknown command”
If tmux new-pane or a new option fails right after the upgrade, you are talking to a server that was started before it. Check the version the server is running:
tmux display-message -p '#{version}'
If it is older than tmux -V, exit your sessions or run tmux kill-server.
Going Back to Debian’s tmux
To return to the archive version, install it explicitly, using the version apt policy tmux lists for Debian:
sudo apt install --allow-downgrades tmux=<version>
Uninstalling
Remove tmux with:
sudo apt remove tmux
To also drop the repository and key:
sudo rm /etc/apt/sources.list.d/deb.griffo.io.list
sudo rm /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Your ~/.tmux.conf and any plugins under ~/.tmux/ are left in place.
Conclusion
Installing tmux from deb.griffo.io gives Debian users the current tmux on every supported release, from Bookworm to Sid, under the same package name as Debian’s own. Floating and modal panes, the new switchers and themes, and every fix since your release froze arrive with a normal apt upgrade, and the packaging keeps Debian’s integration: /etc/shells, the systemd-tmpfiles rule, the man page.
Whether you keep long jobs alive on a remote server or live in a split screen of editor, shell and logs, the packaged tmux stays out of the way, and APT keeps it current.
Frequently Asked Questions
How do I install the latest tmux on Debian?
Add the deb.griffo.io APT repository and its signing key, then run sudo apt install tmux. The repository builds every tagged tmux release, so you get the latest version without compiling it yourself.
Will this conflict with Debian’s tmux package?
No. The package has the same name, tmux, and simply has a newer version, so APT upgrades Debian’s tmux in place. Packages that depend on tmux, such as byobu or tmuxinator, keep working.
Is there a .deb package for tmux?
Yes. deb.griffo.io publishes tmux as a signed .deb for Debian, and the packaging repository also attaches the .deb files to its GitHub releases. Adding the APT repository is the better option, since APT then picks up new versions on its own.
Why does tmux still behave like the old version after upgrading?
Your sessions are still served by the old tmux server process. Exit them, or run tmux kill-server, and the next session starts with the new version.
Which architectures are supported?
amd64 and arm64, on every supported Debian release. Other architectures are not built, so on armhf or i386 machines use Debian’s own tmux.
How do I install tmux on Ubuntu?
Exactly the same way; lsb_release -sc simply resolves to a different codename. There is a companion guide with the Ubuntu specifics: How to install tmux on Ubuntu.
Which Debian releases are supported?
Bookworm 12, Trixie 13, Forky 14 and Sid, on amd64 and arm64. Because the repository line is built from lsb_release -sc, the matching suite is selected for you.
Resources
- tmux GitHub Repository
- tmux Wiki
- tmux Packaging Repository
- deb.griffo.io Repository
- Install guide on deb.griffo.io
Disclaimer: The deb.griffo.io repository is an unofficial community project and is not affiliated with the official Debian or Ubuntu projects, or with the upstream tmux project.