Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MANUAL] Installation guide for docker-unifi-network-application on Synology [Unifi network controller 8.6.x] #121

Open
1 task done
allexmail opened this issue Nov 15, 2024 · 2 comments

Comments

@allexmail
Copy link

allexmail commented Nov 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

The instructions for installing Unifi controller on Synology DSM 7.1 are described here. This instruction will probably be useful for future DSM versions. It is assumed that you already have Docker installed on Synology.

You can download this manual for offline reading (PDF):
MANUAL.Installation.guide.for.docker-unifi-network-application.on.Synology.Unifi.network.controller.8-6-9.pdf

1. Mongodb preparation.

On your computer, create a database initialization script with the name "init-mongo.sh" the following contents without changing anything in it:

#!/bin/bash

if which mongosh > /dev/null 2>&1; then
  mongo_init_bin='mongosh'
else
  mongo_init_bin='mongo'
fi
"${mongo_init_bin}" <<EOF
use ${MONGO_AUTHSOURCE}
db.createUser({
  user: "${MONGO_USER}",
  pwd: "${MONGO_PASS}",
  roles: [
    { db: "${MONGO_DBNAME}", role: "dbOwner" },
    { db: "${MONGO_DBNAME}_stat", role: "dbOwner" }
  ]
})
EOF

You can download the finished file here (don't forget to unzip it): init-mongo.sh.zip

Connect to your Synology using ssh. In the terminal, enter the command "id your_admin_login" to view the UID and GID from which mongodb will be launched. Write down the received data. Usually, the first user created in Synology has a UID of 1026 and a GID of 100.

8

If you need a higher level of security on your network, use another user, but make sure that mongodb will work correctly under this user.

Let's create the necessary directories on Synology. In the "Docker" directory, create a "unifi" directory, and in it two directories "data" (1) and "db" (2). In the "data" directory, there will be a configuration of the unifi-network-application docker, and in the "db" directory there will be a mongodb database.
Upload a file init-mongo.sh to your Synology in the "db" directory (3). You should get such directories:

0

In the Synology main menu, open the Docker application. Go to the "Registry" section (1), type "mongo" in the search bar (2), select the official mongodb image (3), click download (4), and then select version 4.4 (5), which is recommended by the developer of unifi-network-application and click "Select" (6).

1

Wait until the docker download is finished and it appears in the "Image" section (1) (2). Do all the same operations, but write "unifi-network-application" in the Registry search bar, so that unifi-network-application also appears in the "Image" section (3). You can choose the version of the unifi-network-application that you need. I chose the latest 8.6.9.

2

Go to the Container section (1), click the Create button, select the mongo image (2) and click Next (3).

3

In the Network section, select how the container will use the network. In my case, I needed to use host addressing. If you select bridge, keep in mind that you will also have to configure port forwarding to the container according to the unifi-network-application developer's guide. So, select "Use the same network as Docker Host" (1) and click "Next" (2).

4

Specify the name of the container (1), check the box "Execute container using high privileges" (2). Set restrictions and auto restart, if necessary. Then click the "Advanced Settings" button (3).

5

Using the "Add" button (1), add environment variables after the already existing parameters, according to the screenshot below (2). Use this link to determine your time zone. PUID and PGID, write down the values that you received in the terminal using the "id your_admin_login" command. Come up with a name for the database and a password. In the MONGO_AUTHSOURCE parameter, specify the username that corresponds to your PUID. Save the data with the "Save" button (3).

9

In the previous window, click the "Next" button:

7

Click the "Add Folder" button:

10

Select the "db" directory (1) that you created earlier and click the "Select" button (2):

11

In the "Mount path" parameter for the selected "db" folder, specify the value "/data/db" (1), and then click "Add file" (2):

13

Select the file "init-mongo.sh" (2), which you uploaded to the "db" folder (1). Then click the "Select" button:

12

For the selected file "init-mongo.sh " specify the "Mount path" parameter as "/docker-entrypoint-initdb.d/init-mongo.sh" (1), check the "Read only" box (2), and click "Next" (3):

14

Check all the parameters (1) again, leave the check mark "Run this..." (2) and click "Done" (3):

15

Go to the "Container" tab (1), select the created container (2), make sure that it is running and click the "Details" button (3):

16

Go to the "Log" tab (1) and check all logs for errors. Make sure that the logs contain a line about the end of initialization (2) and close the window (3). Mongodb preparation is finished.

17

2. Configuring the unifi-network-application docker

Go to the "Container" tab in Docker (1) and click the "Create" button (2):

18

Select the previously downloaded unifi-network-application image (1) and click "Next" (2):

19

In the Network section, select how the container will use the network. In my case, I needed to use host addressing. If you select bridge, keep in mind that you will also have to configure port forwarding to the container according to the unifi-network-application developer's guide. So, select "Use the same network as Docker Host" (1) and click "Next" (2).

20

Specify the name of the container (1), check the box "Execute container using high privileges" (2). Set restrictions and auto restart, if necessary. Then click the "Advanced Settings" button (3).

21

Using the "Add" button (1), add environment variables after the already existing parameters, according to the screenshot below (2). Use this link to determine your time zone (TZ). PUID and PGID, write down the values that you received in the terminal using the "id your_admin_login" command. " In the "MONGO_AUTHSOURCE" parameter, specify the username that corresponds to your PUID.
In the "MONGO_USER" and "MONGO_PASS" parameters, specify the username and password for the ("MONGO_DBNAME") "unifi" database that you came up with earlier. Since we host everything on one Synology, we specify the local IP address - 127.0.0.1 in the "MONGO_HOST" parameters;
Save the data with the "Save" button (3).

22

In the previous window, click the "Next" button:

23

Click the "Add Folder" button (1):

24

Select the folder (1) where the unifi-network-application will save its parameters and operation logs; click the "Select" button (2):

25

In the "Mount path" parameter for the selected "data" folder, specify the value "/config" (1), and then click "Next" (2):

26

Check all the parameters (1) again, leave the check mark "Run this..." (2) and click "Done" (3):

27

The launch of docker unifi-network-application is finished.

3. Initial configuration of the Unifi Controller.

It may take some time for the unifi-network-application container to start for the first time while it creates data in the database, so after launching, you should wait a few minutes before trying to log into the Unifi web interface.

Let's look at the work log. Go to the "Container" tab (1), select the "unifi-network-application" container (2) and click the "Details" button (3):

28

Go to the "Log" tab (1), and make sure that the initialization process is finished (2). Look at what I have about 3 minutes between start and end. Close the window (3):

29

Open a new browser tab and go to "https://YOU_IP_ADDRESS:8443", where YOU_IP_ADDRESS is the ip address of your Synology. Since you currently have self-trusted certificates, the browser will inform you about the security risk. You need to take the risk and continue, after which you will find yourself on the Unifi installation screen:

30

Go through the initial configuration of Unifi. Select your region, language, and create an administrator account. I will not describe these steps.

In Unifi, go to Settings > System > Advanced, scroll down to the "Inform Host" option and check the box "Override" (1). In the field that opens, enter the IP address of your Synology (2). Apply the settings.

31

Connect your Unifi points to the network and wait a few minutes. Be patient, it takes time to determine the points. Then, in the Unifi interface, go to the "Unifi devices" tab, you should see your access points.

32

Now you can configure your points as you need. Please note that you need to properly configure the firewall on your Synology if you are using it. But during the setup, the firewall must be completely disabled.

Please keep the link to this page if you post this instruction on other resources.

The developers of the unifi-network-application can use this instruction for any purpose.

Expected Behavior

Launching the unifi-network-application on Synology.

Steps To Reproduce

  1. Not required. This is an instruction.

Environment

- OS: DSM 7.1

CPU architecture

x86-64

Docker creation

Not required.

Container logs

Not required.
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

2 participants