How to Fix bash: tmate: command not found in Minimal Linux Distributions

The tmate utility is an instant terminal sharing tool built as a fork of tmux, allowing developers and system engineers to collaborate remotely over secure SSH tunnels without complex NAT or port forwarding configuration. Minimal server builds, cloud instances, and lightweight container environments omit this remote terminal multiplexer by default, returning bash: tmate: command not found.

Install tmate via Native Package Repositories

Most popular Linux distributions maintain tmate in their default software archives:

  • Ubuntu and Debian:
    sudo apt update && sudo apt install -y tmate
  • Arch Linux:
    sudo pacman -S tmate
  • Fedora, CentOS Stream, and RHEL:
    sudo dnf install -y epel-release && sudo dnf install -y tmate
  • Alpine Linux:
    sudo apk add tmate

Deploy the Official Static Binary on Unsupported Platforms

If working in minimal environments without root access or missing repositories, deploy the precompiled static binary:

  1. Download the latest official static release tarball from GitHub:
    curl -LO https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-amd64.tar.xz
  2. Extract the archive:
    tar -xf tmate-2.4.0-static-linux-amd64.tar.xz
  3. Move the executable binary into your local user PATH:
    mkdir -p ~/.local/bin && mv tmate-2.4.0-static-linux-amd64/tmate ~/.local/bin/
  4. Reload the shell configuration:
    source ~/.bashrc

Verify Installation and Launch a Shared Session

Verify binary presence and generate instant SSH sharing tokens:

  1. Check version output:
    which tmate && tmate -V
  2. Launch an active session:
    tmate
  3. Display the connection strings (read-only and full access SSH URLs):
    tmate show-messages

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.