If you have Unifi network gear you also need the Unifi Controller. And it is best to keep the controller running 24/7, so where are you going to install it? If you have a Synology Nas then you could use a Docker Image to run the Unifi Controller. In this article, I will guide you through the installation of Docker and Unifi on your Synology in 5 minutes.
Before we can start we need to make sure that your Synology supports Docker. You can check this in two easy ways:
- Login to your Synology and go to the Package Center, search in the top left corner for Docker. If it doesn’t return any results, then Docker isn’t supported for your model
- On the website of Synology, you will find information about the add-on Docker and which models support it. Check if your model is listed there under the applied model’s section.
Installing Docker on your Synology
First, we are going to install Docker. Docker allows you to run applications in containers. The advantage of containers is that a developer can create a package, in this case, the Unifi Controller, with all the parts it needs (like Java and MongoDB). Leaving the user with only downloading and starting the image up inside the container. This way other application on the same machine won’t be harmed.
- Login to your Synology Nas with an admin user.
- Open the Package Center
- Search in the top left corner for Docker
- Install Docker (blue whale icon)
Installing the Unifi Controller
Installing the Unifi Controller is just a few mouse clicks. We are going to download the Unifi Controller image (700Mb) and configure the Docker Container for it.
Downloading the image
Docker starts up after you installed it. Go the register on the left side and search for Unifi.
Starting the Unifi Container Image
Select jacobalberty/unifi and click on download. It may take a few minutes to download the image, you can see the progress on the Image tab. When the download is complete, select the image and click on Launch
Configure the Unifi Container
After you clicked on Launch, the container configuration wizard will start. We need to change some settings so we can reach the Unifi Controller from another computer (then only from the Synology), store the files somewhere and limit the resources.
- Give the Container a name, like Unifi-Controller. Something you will recognize later.
- Enable resource limitation, this way the Unifi Controller can’t use all the resources of the Synology. This is really recommended if you are running more applications on your NAS.
- Click on Advanced Settings
On the next screen, enable Auto-restart. This way the Unifi Controller will be restarted when your Synology turns is rebooted (after an update for example)
Set Disk Volume
Click on the tab Volume. We need to map the file storage of the Docker to the disk of the Synology.
- Click on Add Folder
- Select docker
- Click Create Folder
- Name it Unifi
- Click on Select
Next, we need to map the newly created folder. In the column, Mount Path enter /unifi
Click on the network tab and select Use the same network as Docker Host. This way we can reach the Unifi Controller on the same IP Address as our Synology NAS.
- Click on the last tab, Environment.
- Scroll all the way down and change the following values:
RUNAS_UID0 FalseClick on Apply
- Click on Next and Apply again.
The Unifi Controller will now start and is accessible on your Synology address on port 8443. So if you can open your NAS on https://192.168.1.2 then you can find the Unifi Controller on https://192.168.1.2:8443. Make sure you put https in front of it.
Configure your Synology Firewall
By default, the Synology firewall is turned on. This will prevent you from accessing and using the Unifi Controller. You don’t need to turn the firewall off, you only need to open some ports to allow traffic to the Unifi Controller. You can do this as follows
- Open the Control Panel
- Select Security
- Select Firewall
Here you will see the Enable Firewall is turned on. Below that you will find the Firewall Profile. Click on Edit Rules to open the ports for the Unifi Controller.
- Click on Create to add a Firewall Rule
- Select under Ports > Custom and again Custom (button)
- Protocol is TCP
- Ports (Separate with commas): 8080,8443,8843,8880,6789
- Click Ok and Ok
- Click on Create again
- Select under Ports > Custom and again Custom (button)
- Protocol is UDP
- Ports (Separate with commas): 3478,10001
- Click Ok (3x times)
You should now be able to access the Unifi Controller. If this controller is still not accessible then it might be necessary to restart your Synology NAS. The Unifi Controller will start automatically after the reboot.
Updating the Unifi Controller Container
Updating the Unifi Controller on the Synology is a little bit different compared to a Linux/Windows/Rasberry Pi installation. You can’t just download the latest version and run the installer inside the Docker container. There is no auto-update feature either, so when a new version comes out, you will need to download a new version of the Docker Unifi Image. Tip: subscribe to my email list in the sidebar to receive a notification when a new version is available!
Before you start with updating you should always make and download a backup of your Unifi Controller. Log in to the controller and select Maintenance. Scroll down to Backup and download the backup file.
Downloading the latest version
To update the controller you need to follow these steps:
- Open Docker on the Synology
- Click on Registry and search again for Unifi (just like we did during the installation)
- Select the jacobalbert/unifi and click download.
- Wait until the download is completed (check the image tab or wait for the notification)
Updating the container
When the download is finished we can start with updating or actually replacing, the Docker image. In Docker select Container:
- Stop the Unifi Controller container by flipping the on-off switch. Wait until the status is changed to stop
- Select the Unifi Controller container again
- Click on Action and select Clear
- Acknowledge that all the data in the container will be lost. (Settings and data are saved in the mapped folder)
- Start the container again by filliping the on-off switch
You can now log in again on your Unifi Controller.
If you Synology doesn’t support Docker or you are planning to buy a new Synology NAS, then make sure you check the Docker Add-On page at the Synology website to see if it support Docker. For home networks, the Synology NAS DS218+ is a good and affordable choice. It will cost around $ 300 on Amazon for the diskless version. Don’t be tempted to go for the cheaper version, they don’t support Docker.
A cheaper alternative to run the Unifi Controller is a Rasberry Pi or the Unifi Cloud Key. The Cloud key cost only a third on Amazon of the Synology NAS and you only need to power it up to use the controller software.
If you have any questions just drop a comment below. Make sure you sign up for the newsletter to stay up-to-date with the Unifi Controller software.