> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/tmux/tmux/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing tmux

> Install tmux on Linux, macOS, BSD, or build from source with detailed platform-specific instructions.

## Dependencies

Before installing tmux, ensure you have the required dependencies:

<CardGroup cols={2}>
  <Card title="libevent 2.x" icon="link">
    Event notification library required for tmux operation.
    Available at: [https://github.com/libevent/libevent/releases/latest](https://github.com/libevent/libevent/releases/latest)
  </Card>

  <Card title="ncurses" icon="terminal">
    Terminal control library for managing screen output.
    Available at: [https://invisible-mirror.net/archives/ncurses/](https://invisible-mirror.net/archives/ncurses/)
  </Card>
</CardGroup>

<Info>
  To build tmux from source, you'll also need: a C compiler (gcc or clang), make, pkg-config, and yacc (or bison).
</Info>

## Package Manager Installation

The easiest way to install tmux is through your system's package manager.

<CodeGroup>
  ```bash Ubuntu/Debian theme={null}
  sudo apt update
  sudo apt install tmux
  ```

  ```bash Fedora/RHEL/CentOS theme={null}
  sudo dnf install tmux

  # On older systems use yum:
  sudo yum install tmux
  ```

  ```bash Arch Linux theme={null}
  sudo pacman -S tmux
  ```

  ```bash macOS (Homebrew) theme={null}
  brew install tmux
  ```

  ```bash macOS (MacPorts) theme={null}
  sudo port install tmux
  ```

  ```bash FreeBSD theme={null}
  pkg install tmux
  ```

  ```bash OpenBSD theme={null}
  pkg_add tmux
  ```

  ```bash NetBSD theme={null}
  pkgin install tmux
  ```

  ```bash Solaris theme={null}
  pkg install terminal/tmux
  ```
</CodeGroup>

<Tip>
  After installation, verify tmux is installed correctly by running `tmux -V` to check the version.
</Tip>

## Building from Source (Release)

To build and install tmux from a release tarball:

<Steps>
  <Step title="Download the release">
    Download the latest release tarball from the official repository:

    ```bash theme={null}
    wget https://github.com/tmux/tmux/releases/download/VERSION/tmux-VERSION.tar.gz
    tar -xzf tmux-VERSION.tar.gz
    cd tmux-VERSION
    ```

    Replace `VERSION` with the desired version number.
  </Step>

  <Step title="Configure and build">
    Run the configure script and build tmux:

    ```bash theme={null}
    ./configure && make
    ```

    The configure script will check for required dependencies and configure the build for your system.
  </Step>

  <Step title="Install">
    Install tmux system-wide (requires root privileges):

    ```bash theme={null}
    sudo make install
    ```
  </Step>
</Steps>

<Accordion title="Optional: Enable utempter support">
  tmux can use the utempter library to update utmp(5), if it is installed. This allows tmux to properly register terminal sessions.

  To enable this feature, run configure with the `--enable-utempter` flag:

  ```bash theme={null}
  ./configure --enable-utempter && make
  sudo make install
  ```
</Accordion>

## Building from Git (Development)

To get and build the latest development version from version control:

<Warning>
  Building from Git requires additional tools: autoconf, automake, and pkg-config. The development version may contain unstable features.
</Warning>

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone https://github.com/tmux/tmux.git
    cd tmux
    ```
  </Step>

  <Step title="Generate configure script">
    Run the autogen script to generate the configure script:

    ```bash theme={null}
    sh autogen.sh
    ```
  </Step>

  <Step title="Configure and build">
    ```bash theme={null}
    ./configure && make
    ```
  </Step>

  <Step title="Install">
    ```bash theme={null}
    sudo make install
    ```
  </Step>
</Steps>

## Platform-Specific Notes

<AccordionGroup>
  <Accordion title="Linux">
    On most Linux distributions, both libevent and ncurses are available through the package manager:

    **Ubuntu/Debian:**

    ```bash theme={null}
    sudo apt install libevent-dev libncurses-dev
    ```

    **Fedora/RHEL:**

    ```bash theme={null}
    sudo dnf install libevent-devel ncurses-devel
    ```
  </Accordion>

  <Accordion title="macOS">
    On macOS, use Homebrew or MacPorts to install dependencies:

    **Homebrew:**

    ```bash theme={null}
    brew install libevent ncurses
    ```

    **MacPorts:**

    ```bash theme={null}
    sudo port install libevent ncurses
    ```

    Xcode Command Line Tools provide the C compiler and other build tools:

    ```bash theme={null}
    xcode-select --install
    ```
  </Accordion>

  <Accordion title="BSD Systems">
    On FreeBSD, OpenBSD, and NetBSD, tmux is available in the base system or ports:

    **FreeBSD:**

    ```bash theme={null}
    # Binary package
    pkg install tmux

    # Or from ports
    cd /usr/ports/sysutils/tmux && make install clean
    ```

    **OpenBSD:**
    tmux is included in the base system on recent OpenBSD versions.
  </Accordion>

  <Accordion title="Solaris">
    On Solaris 11 and later:

    ```bash theme={null}
    pkg install terminal/tmux
    ```

    For older versions, you may need to build from source after installing dependencies.
  </Accordion>
</AccordionGroup>

## Verify Installation

After installation, verify that tmux is working correctly:

<Steps>
  <Step title="Check version">
    ```bash theme={null}
    tmux -V
    ```

    This should display the tmux version number.
  </Step>

  <Step title="Start tmux">
    ```bash theme={null}
    tmux
    ```

    This should start a new tmux session with a command prompt and a status bar at the bottom.
  </Step>

  <Step title="Exit tmux">
    Type `exit` or press `Ctrl-d` to close the pane and exit tmux.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="configure: error: libevent not found">
    Install libevent development files:

    **Ubuntu/Debian:**

    ```bash theme={null}
    sudo apt install libevent-dev
    ```

    **Fedora/RHEL:**

    ```bash theme={null}
    sudo dnf install libevent-devel
    ```

    **macOS:**

    ```bash theme={null}
    brew install libevent
    ```
  </Accordion>

  <Accordion title="configure: error: curses not found">
    Install ncurses development files:

    **Ubuntu/Debian:**

    ```bash theme={null}
    sudo apt install libncurses-dev
    ```

    **Fedora/RHEL:**

    ```bash theme={null}
    sudo dnf install ncurses-devel
    ```

    **macOS:**

    ```bash theme={null}
    brew install ncurses
    ```
  </Accordion>

  <Accordion title="yacc: command not found">
    Install bison or yacc:

    **Ubuntu/Debian:**

    ```bash theme={null}
    sudo apt install bison
    ```

    **Fedora/RHEL:**

    ```bash theme={null}
    sudo dnf install bison
    ```

    **macOS:**

    ```bash theme={null}
    brew install bison
    ```
  </Accordion>

  <Accordion title="Permission denied when installing">
    Ensure you're using sudo for the install step:

    ```bash theme={null}
    sudo make install
    ```

    Or install to a user directory:

    ```bash theme={null}
    ./configure --prefix=$HOME/.local
    make
    make install
    ```

    Then add `$HOME/.local/bin` to your PATH.
  </Accordion>
</AccordionGroup>

## Next Steps

<Card title="Quick Start Guide" icon="rocket" href="/quickstart">
  Now that tmux is installed, learn how to use it with our quick start guide.
</Card>
