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
-
Download and Install Entware:
-
Entware is a software repository for embedded devices like Synology NAS. It provides a package management system similar to
apton Debian oryumon 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
-
-
Initialize Entware:
-
After the installation script runs, it will set up Entware. You might need to add the Entware binary path to your
PATHenvironment variable:Terminal window echo 'export PATH=/opt/bin:/opt/sbin:$PATH' >> ~/.profilesource ~/.profile
-
Step 2: Install tmux using opkg
-
Update the Entware Package List:
-
Ensure you have the latest package list:
Terminal window opkg update
-
-
Install
tmux:-
Now, you can install
tmux:Terminal window opkg install tmux
-
-
Verify Installation:
-
Check if
tmuxis installed correctly:Terminal window tmux -V -
You should see the version number of
tmuxif 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:
-
Ensure Docker is Installed:
- Install the Docker package from the Synology Package Center if it’s not already installed.
-
Run a
tmuxDocker 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 tmuxtmux
-
Troubleshooting
- Missing Commands: If you encounter errors like
command not found, make sure that/opt/binand/opt/sbinare included in yourPATH. - Permission Issues: Ensure you have root access or use
sudowhere 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.