How to install tmux in Synology NAS Server

Surendra Tamang

Surendra Tamang

10 min read
Synology Server

I was working on a project where my client wanted me to put all the crawlers and applications on his own Synology NAS. It was a new thing for me. He only knew that he was able to run containers on his server. The rest was my task to figure out. Among a lot of problems at each step of this project, I ran into this one too, so I am sharing it here.

Installing tmux on NAS can be frustrating.

To install tmux on a Synology NAS, you typically need to use ipkg or opkg because Synology’s DiskStation Manager (DSM) doesn’t include tmux by default, and it uses a busybox-based system that lacks many common Linux utilities.

Here’s a step-by-step guide on how to install tmux on a Synology NAS using opkg:

Step 1: Install Entware

  1. Download and Install Entware:

    • Entware is a software repository for embedded devices like Synology NAS. It provides a package management system similar to apt on Debian or yum on CentOS.

    • You can download and install Entware by following these steps:

      Terminal window
      wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh
  2. Initialize Entware:

    • After the installation script runs, it will set up Entware. You might need to add the Entware binary path to your PATH environment variable:

      Terminal window
      echo 'export PATH=/opt/bin:/opt/sbin:$PATH' >> ~/.profile
      source ~/.profile

Step 2: Install tmux using opkg

  1. Update the Entware Package List:

    • Ensure you have the latest package list:

      Terminal window
      opkg update
  2. Install tmux:

    • Now, you can install tmux:

      Terminal window
      opkg install tmux
  3. Verify Installation:

    • Check if tmux is installed correctly:

      Terminal window
      tmux -V
    • You should see the version number of tmux if it was installed successfully.

Alternative Method: Using Docker

If you prefer not to use Entware or have trouble with it, you can use Docker to run tmux. Here’s how:

  1. Ensure Docker is Installed:

    • Install the Docker package from the Synology Package Center if it’s not already installed.
  2. Run a tmux Docker Container:

    • You can use an existing Docker image with tmux. Pull a lightweight image like Alpine Linux:

      Terminal window
      docker run -it --rm alpine:latest /bin/sh
    • Inside the Docker container, install tmux:

      Terminal window
      apk add tmux
      tmux

Troubleshooting

  • Missing Commands: If you encounter errors like command not found, make sure that /opt/bin and /opt/sbin are included in your PATH.
  • Permission Issues: Ensure you have root access or use sudo where necessary.
  • Compatibility: Verify that your Synology NAS model supports Entware or Docker.

Summary

Installing tmux on a Synology NAS comes down to installing Entware and then using opkg. Entware also gives you a lot of other Linux utilities that DSM does not ship, so it is worth having anyway.