Installing the Unifi Controller on a Synology Nas in 5 minutes

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:

  1. 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
  2. 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.

If you Synology isn’t supported you can also go for the Raspberry Pi solution or check out the Unifi Cloud Key


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.

Install Docker on Synology NAS

  1. Login to your Synology Nas with an admin user.
  2. Open the Package Center
  3. Search in the top left corner for Docker
  4. 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.

Installing Unifi Controller on Synology

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

Launch Unifi Controller Docker on Synology

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.

General Settings

Configuring Unifi Controller for Synology

  1. Give the Container a name, like Unifi-Controller. Something you will recognize later.
  2. 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.
  3. Click on Advanced Settings

Advanced Settings

Unifi Controller Docker Auto Restart

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

Create Volume on Synology for Unifi Controller

Click on the tab Volume. We need to map the file storage of the Docker to the disk of the Synology.

  1. Click on Add Folder
  2. Select docker
  3. Click Create Folder
  4. Name it Unifi
  5. Click on Select

Next, we need to map the newly created folder. In the column, Mount Path enter /unifi

Network Settings

Unifi Controller Same Network as Synology

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.

Environment Settings

Advanced Unifi Controller settings for Synology

  1. Click on the last tab, Environment.
  2. Scroll all the way down and change the following values:
    BIND_PRIV False
    RUNAS_UID0 FalseClick on Apply
  3. 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

  1. Open the Control Panel
  2. Select Security
  3. Select Firewall

Open Synology Firewall for Unifi Controller

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.

Adding Unifi Controller Ports to Synology Firewall

  1. Click on Create to add a Firewall Rule
  2. Select under Ports > Custom and again Custom (button)
  3. Protocol is TCP
  4. Ports (Separate with commas):  8080,8443,8843,8880,6789
  5. Click Ok and Ok
  6. Click on Create again
  7. Select under Ports > Custom and again Custom (button)
  8. Protocol is UDP 
  9. Ports (Separate with commas):  3478,10001
  10. 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!

Download Unifi Controller Backup

Before you start with updating you should always make and download a backup of your Unifi Controller. Login to the controller an 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:

  1. Open Docker on the Synology
  2. Click on Registry and search again for Unifi (just like we did during the installation)
  3. Select the jacobalbert/unifi and click download.
  4. 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:

Turn Unifi Container off

  1. Stop the Unifi Controller container by flipping the on-off switch. Wait until the status is changed to stop
  2. Select the Unifi Controller container again
  3. Click on Action and select Clear
  4. Acknowledge that all the data in the container will be lost. (Settings and data are saved in the mapped folder)
  5. Start the container again by filliping the on-off switch

You can now log in again on your Unifi Controller.

Alternatives

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.

Conclusion

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.

See also:

Get more stuff like this

IT, Office365, Smart Home, PowerShell and Blogging Tips

I hate spam to, so you can unsubscribe at any time.

41 thoughts on “Installing the Unifi Controller on a Synology Nas in 5 minutes”

  1. Hello. Thank you for the install guide. Brilliant and it worked 1st time! Maybe I’m being a bit thick… but I can’t find the subscribe button for controller updates? Thanks again.

  2. Hi Ruud,

    thanks for this easy to follow explanation. Worked like a charm.

    Could you please add me to your mailinglist? That would be great!

    Thanks and kind regards,
    Andreas

  3. Hi Ruud,

    Great Tutorial!!
    I also would like to be subscribed for the Unify Controller updates on the synology NAS, can you add me to the list as well?

    I didn’t change the two settings to “false” but left them on true. I guess that isn’t a problem. First I had some issues with the container restarting every minute due to ports conflict. Then I left the statements to false and it resolved. But probably it was another issue that made it work again I guess.
    Also I followed this https://www.youtube.com/watch?v=-acn1exo_aw video of your container. I changed however the path tot /Docker/Unifi as you described.

    I’m new to unifi and ubiquity stuff so I’m learning a lot.

  4. So for everybody who has problems with a regular error entry regarding the ports (like 8080) after first startup.

    Some other docker app or other application running on your diskstation is listing on the needed ports, so we need to tell the unifi to use other port numbers.

    There are at least two solutions:
    – Don’t use the same network as in the instructions above mentioned
    – you can now use the portmapping inside of docker like mapping 8448 of unifi to 18448 of your diskstation, remember that you give a dedicated port and don’t let docker decide on “auto” what the best ports could be, this will let in worst case to changing ports after each reboot.
    – or after a first succesfull boot of the unifi you can edit the system.properties file which should be in the following location, if you followed the instructions above: docker\Unifi\data

  5. Hi,

    Great guide. Question, do you know hwo to change the ports? I already have sites running on 8080 and 8443.

    Thank you!

  6. Hey Ruud,

    thanks for your great tutorial first – even for a noob like me its been pretty easy to install the Docker version of the Unifi Controller.
    Now I am up to the next task: my first update. After downloading a new image I find two options under Action/Clear, one simply called “Clear” (or “Löschen” in german) and another one “Inhalte löschen” – dont know the exact englisch translation for this button in the Synology DSM. Which one should I chose? 🙂

    Thanks for helping!

  7. Thanks for the guide. Works great on DS916+.

    Any idea if the MongoDB installed is 64 or 32 bits? How to check?

    Does this Docker installation shutdown the Unifi Controller prior to NAS reboot or shutdown?

  8. Hi Ruud,

    Thanks voor your manual.
    Everything up and running on a DS1513+
    Is there somewhere a manual which describes all the Unify options and settings
    I’d like to be subscribed for Unify Controller updates

  9. Hi Ruud – Your guide is the best thank you!

    After great success installing both the initial controller and the recently updated image, when I follow your steps, the controller updates to the new version but it appears this leaves dependencies on both the old and new image. Is this normal? I was hoping I can delete the older image version to save disk space. Thank you.

  10. Great tutorial! Especially the Update part was very helpful.

    Do you know how to automatize the update or doing it via shell? So that a cronjob script could check weekly for updates and perform them.

  11. Hi I am novice at using docker ….. I followed your tutorail and installed the Unifi Video sorfware. I also installed the latest Java. The Unifi Software seems to be running stably – although the CPU usage fluctuates a bit. (when I first installed without Java it crashed every minute).

    How do I access the NV software do I use the Unifi discovery tool from my main pc ………. ??? Also do I need to install some form of cloud key in another docker container??? I am a little confused can you help.

  12. I found a workaround to install the Unifi docker with the original ports.

    I had the feeling the DDSM (Docker DSM) was blocking/using all ports. So 1st I tried install Docker in DDSM. This is not possible. Synology does not accept a Docker inside a Docker.

    Then I went to VMM (Virtual Machine Manager) where I installed a Virtual DSM. Inside the New Virtual DSM I installed a clean Docker, in which I installed the Unifi Controller without any issues as described in this manual, and I can access it over https://IP_of_VDSM:8443

    I hope this workaround is useful for other users.

    So far, thanks!

  13. Hello,

    I think my issues are more or less the same as the issues of Frank Mauritz, David and Giuseppe A. Continisio.

    1st I installed according to your manual, using the “Use the same network as Docker Host” option. Doing this, the Docker crashes within 1 minute, with the error port 8443 is not reachable.

    2nd I installed using not tagging the “Use the same network as Docker Host”. When I go to the tab with the port settings, I change all ports to the standard ports. Docker reports all 6 ports “value already existing”. The docker is not starting.

    3rd I installed like the 2nd time, except assigning other ports (f.i. 18443 to 8443). Doing this, I was able to start the package, and to run run it over //ip_of_nas:18443/

    https://www.synology-forum.nl/overige-3rd-party-packages/poort-8443-not-available-bij-instal-unifi-controller-5

  14. The Error message in the Log file is:
    [2019-03-25T23:48:49,287] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:49:01,800] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:49:14,132] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:49:26,241] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:49:38,456] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:49:50,622] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:50:02,716] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:50:14,839] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:50:29,753] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:51:05,342] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:52:13,475] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:55:29,928] WARN system – reload system.properties failed: file not found
    [2019-03-25T23:59:17,251] WARN system – reload system.properties failed: file not found

  15. Hello,

    I tried to install the docker according to your manual on my DS1515+ / DS6.2.1 / 16GB, but the docker crashes within 1 minute every time I try to start it. Do you have any clue where I could search to solve this?

    Thanks in advance!

    Kind regards

    • I think re-installing docker should fix this. If you search on the error you will notice a few others that have the same problem. A few of them solved it with re-installing Docker. Make sure everything is up-to-date.

  16. Hi, I’ve been running UniFi in Docker on my Synology for a few months now and have already been through a few upgrade cycles. Currently running 5.10.19. Tried upgrading to 5.10.20 tonight using “latest”. Everything appears to go ok however UniFi loads as the old version. Any ideas?

    One other thing, when I stop the container and select Action > Clear, the container disappears. I need to close the Docker window and open it again for the container to be visable again.

  17. Hello Rudy
    fantastic information.
    Everything works OK but I run into a problem, I can not adopt any device in any SITE created in my controler.

    I use Unifi Discover and I pass the address of my controller on the NAS,

    http://MyNas.synology.me:8080/inform

    but the device never seems to be in the controller for adoption.

    What URL should I use in a Controller of this type?

    Thanks in advance.

    Regards,
    Jaume Duch

    • The address you are using won’t work. synology.me address is a online address, the Unifi needs a local address. Try to use the ip address of the Synology instead.

  18. Hi!
    The installation was done without any trouble. I downloaded a site saved on another controller. I can import it to the nas. When I reached the webpage of the controller, I got to enter a login and a password : it entered the one I use on my “old” controller, but it doesn’t work. I click to rest the password : impossible to do it.
    How to solve this?
    Thanks in advance!

  19. Hello Ruud

    thank you so much for sharing your know-how.
    I followed step-by-step your guide, and I was sure, everything was ok.
    Unfortunately after starting the process I was not able to reach the site on https://syno_ip:8443.
    If I have a look at the server.log file the only thing I find is the following sequence
    “[21:27:04,772] WARN system – reload system.properties failed: file not found”
    and this after every 14 seconds.
    The Synology notification says
    “Docker-Container: unifi-Controller wurde unerwartet gestoppt.”
    In the Docker Container I can observe how the cpu and ram jumps up and down.
    The protocol has for all 12 seconds the following entry
    “Port 8080 not available”
    “[2019-02-16 21:51:38,755] WARN: unifi service process ended without being singaled? Check for errors in /unifi/log.”
    “[2019-02-16 21:51:40,225] Starting unifi controller service.”

    I don’t know how to treat the port error.
    My Docker runs only this container.
    What could it be?

    I hope you have an idea.
    It would be glad.

    Best regards.
    Giuseppe

  20. Hi,

    thank you for the excellent tutorial. Could you help me with 2 questions please:
    1. why should be those 2 parameters set to false?
    2. I need to chage the communication ports, as the 8443 port is already used by different application, is it possible to change it somehow within the docker?

    Thank you

    David

    • Hi David,

      RUNAS_UID0 is set to false so the image will run as a special unifi user. Otherwise, it will run as root. The BIND_PRIV variable can be used to bind port below the 1024. But on some docker filesystems, this may not work.

      To change the ports, you should be able to change this in the system.properties file. You will find it in the File Station/docker/Unifi/data. More info about changing ports here.

      • Thank you for the reply.
        I wrote the path /Unifi and it did not save any files to the folder, when I changed it to /unifi files and folders showed up in the docekr/Unifi.

        However I have one more problem. When I start the container and restore the settings from backup everything works fine for a while. I can connect to the controller from the phone and everything works. When I quit the app on phone and reopen the controller on iMac it shows no devices and no clients. It looks like it does not remember the settings.

        Could you help me please? Homebridge container is running in the docker as well.

        In the terminal of the container I found following errors:
        Feb 12, 2019 7:31:26 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
        INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused (Connection refused)
        Feb 12, 2019 7:31:26 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
        INFO: Retrying request

        • Hi David,

          I looks like you need to update Java or change the path to your Java installation. You can try using this guide to update Java in your Docker, or try to update the path:


          Please edit the file "unifi" in /etc/default/

          For example:
          #JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt => old
          JAVA_HOME=/usr/lib/jvm/java-8-oracle => new

  21. Great information… Worked for me the very first time… I would however like a little more info on doing upgrades to my controller.

    How often do you update the links? And does the beta download correspond with Ubiquiti’s beta cycle?

    The reason I ask is I wanted to try the Beta controller to see what improvements it may contain and was not sure if your download link contained the latest beta code.

    Thanks in advance

    • Hi David,

      I don’t link to the beta downloads. I check the versions one in the month and update them if necessary. You can subscribe to the email list, then you will receive a notification when a new version is available.

    • Hi! Thank you for this! I have some problem with your instructions.
      I dont have button “advanced options” in general settings.
      How i can activate it?
      Nas 710+
      OS 5.2 this is the last for me.

  22. Hallo Ruud,

    danke für die gute Anleitung (Unifi Controllers/ Synology Nas). Nichtsdestotrotz habe ich ein entscheidendes Problem!
    Im Docker Container kann man sehen das der Controller funktioniert, aber ein Zugriff auf die Benutzeroberfläche ist nicht möglich.
    https://192.168.0.33:8443
    Die Controller Oberfläche öffnet sich nicht, sondern eine Collection Listing die einen Strukturbaum ähnelt. In der „Collection Listing“ befindet sich kein Eintrag hinsichtlich Unifi Controller.
    Gerne kann ich Ihnen hierzu auch Screenshots zusenden.

    Vielleicht können sie mir helfen, ich wäre Ihnen dankbar.

    Mit freundlichen Grüßen

    Frank Mauritz

    Hello Ruud,

    thanks for the good instructions (Unifi Controllers / Synology Nas). Nevertheless, I have a crucial problem!
    In the Docker container you can see that the controller is working, but access to the Unifi Controller is not possible.
    https://192.168.0.33:8443
    The Unifi Controller does not open, but a collection listing similar to a tree structure. In the “Collection Listing” there is no entry regarding Unifi Controller.
    I am happy to send you screenshots as well.

    Maybe you can help me, I would be grateful.

    Yours sincerely

    Frank Mauritz

    • Hi Frank,

      Do you have anything else running on your Synology that might be using the same port? You can find my contact details on the about page to send me a screenshot.

    • Hatte das gleiche. Bei dir ist der CARDDAV Server aktiv. Einmal Ausschalten!

      (translated: Had the same. With you the CARDDAV server is active. Turn off once!)

Leave a Comment