UniFi Network Server on QNAP NAS

This Post describes, how to install the UniFi Network Server as Docker image on a QNAP NAS.

The first step is to make sure you’ve installed Container Station from the QNAP App Center.
After this, open Container Station, go to “Applications” and click “Create”.
Give your application a name, for example “unifi-and-mongodb”.
Upload this yaml-code for docker-compose, replace “UNIFIPASSWORD” with a secure password, you will use this later to configure the database:

Container Station now creates two new containers and installs the necessary files. This takes some time. After this, UniFi is not yet able to connect to the database, because we need first to setup an user and grant some rights.

Click on “Containers” and then on the “mongodb” container. Click on “Execute”, choose /bin/bash and execute again. You are now connected to the terminal in this container.

Enter the following to connect to mongodb shell and create the unifi user.
Modify the password “UNIFIPASSWORD” to match the password in the yaml code.

The user is now created.
It takes now again a few minutes to fill the database.
After this, you should be able to conntect to your UniFi Network Server on https://<nas-ip>:8443
You can then import a backup or create a new config.

To adopt existing UniFi AP’s you could ssh into them and replace the inform-URL with:
set-inform http://<nas-ip>:32778/inform

And here are some helpful docker commands which can be executed from the ssh shell of your NAS:
Show running containers: docker ps
Start/stop/restart containers: docker start/stop/restart <containerName>
Show mounted volumes of a container: docker inspect -f ‘{{ .Mounts }}’ <containerName>
Show container config: docker inspect <containerName>
List networks: docker network ls
Show network config: docker network inspect <networkName>

If you want to update your UniFi Network Server, go to the Application and click on the cogwheel. Choose “Recreate” and you will be able to recreate the containers with the newest docker image. The data stays on the mounted volume as long as you don’t delete any volumes.
You can also anytime get a backup from the UniFi Network Server Config, delete everything and recreate the containers as described. Then just upload your backup.

Leave a Reply