Unifi Controller Installation using Docker Portainer

Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.

Moderator: Lillian.W@AST

Post Reply
HughesyMNRH
Posts: 2
youtube meble na wymiar Warszawa
Joined: Mon Aug 07, 2017 2:03 am

Unifi Controller Installation using Docker Portainer

Post by HughesyMNRH »

Hi

I am wondering if anyone has managed to configure Unifi Controller software using Docker-ce and Portainer?

I am struggling to find how to install the software - ideally I would install it on my AS5002T NAS as it is on 24/7.

Would anyone be able to outline the steps required.

Thanks in advance

Mark
melgi
Posts: 51
Joined: Sun Apr 17, 2016 3:52 am

Re: Unifi Controller Installation using Docker Portainer

Post by melgi »

Interested in exactly the same here. Hopefully someone can help us getting this working!
melgi
Posts: 51
Joined: Sun Apr 17, 2016 3:52 am

Re: Unifi Controller Installation using Docker Portainer

Post by melgi »

I got portainer running and a unifi controller container created, however I can't get to the controller as it looks like I'm missing some portsconfiguration for the unifi controller. Anybody have an idea how to set this up?

Verstuurd vanaf mijn SM-G986B met Tapatalk
aragorn
Posts: 11
Joined: Tue Jan 05, 2021 9:59 am

Re: Unifi Controller Installation using Docker Portainer

Post by aragorn »

Install Unifi Network Controller on Asustor NAS

Summary: These notes are based off a few Unifi Controller installs I found documented on the web which I used as a guide (with some modification) to install and configure Unifi Controller on an AS6604T.

Prerequisite: Docker (via Portainer)

1) Create a Unifi folder to store the Unifi config files
- Using File Explorer in ADM create a folder named <Unifi> in the Docker folder
- ie: ADM/Docker/Unifi
◦ ** NOTE: Step 1 is not required but nice if you want to have a local backup when upgrading. This will be addressed later in step 3 below...

2) Install the jacob alberty docker image for Unifi controller
- Open Portainer
- Select Images,
▪ Registry: <DockerHub>
▪ Image: enter <jacobalberty/unifi> and pull image
- When download has completed, change to the containers tab

3) Add and Configure the Unifi Container
▪ Add container
▪ Name: <Unifi>
▪ Image configuration:
• Registry: <DockerHub>
• Image: <jacobalberty/unifi:latest>
• Enable Always Pull image
▪ Network Port Configuration:
• Select manual port Publishing, enter ports (same for both host and container)
◦ 8080/tcp - Device command/control
◦ 8443/tcp - Web interface + API
◦ 8843/tcp - HTTPS portal
◦ 8880/tcp - HTTP portal
◦ 3478/udp - STUN service
◦ 6789/tcp - Speed Test (unifi5 only)
◦ 10001/udp - Discovery
• Enable Access Control: Select <Administrators>

**NOTE: After this point if the advanced settings are unavailable do the following:
- select deploy
- stop service on this container
- open the container and select edit to modify the remaining settings
- when completed then redeploy the container

• Advanced container settings:
• Restart Policy: <Always>
• Advanced container settings:
• Command and Logging: <No Change>
• Advanced container settings:
• Runtime and Resources:
◦ memory limit <set as 1024k>
◦ Cpu Limit: <set as 2>
• Advanced container settings:
• Environment:
◦ Set BIND_PRIV to <false>
◦ Set RUNAS_UID0 to <false>
• Advanced container settings:
• Network: Set to <bridge>
• Advanced container settings:
• Volumes: [Select ADD and include these additional volumes, there are likely a couple of other entries there to start]
◦ container: /unifi/data/backup [Select BIND]
◦ host: /volume1/Docker/Unifi/data/backup [Select Writable]
◦ container: /unifi/data/firmware [Select BIND]
◦ host: /volume1/Docker/Unifi/data/firmware [Select Writable]

** NOTE: The section on adding volumes is required only if you want to utilize the folder created in step 1 above... I wanted to carve out just the backup and firmware directories, if you want everything (including the config, logs, etc) you can probably add a single mount point for /unifi and bind that and it should capture all. This allows the Unifi controller to save outside the container and on the NAS file system directly and in doing so you can destroy, recreate or upgrade the container while retaining this data. Keep in mind these PATHS will be specific to your NAS so you may need to confirm it is correct in your case.

4) Login to your Unifi server
• https://<server IP Address>:8443

Troubleshooting:

If unifi devices do not start to appear for adoption:
• then ssh into each device
• enter command to adopt:
◦ set-inform http://<server IP address>:8080/inform
• you may also need to create an alias in DNS for server name to be "Unifi" for registration to work
melgi
Posts: 51
Joined: Sun Apr 17, 2016 3:52 am

Re: Unifi Controller Installation using Docker Portainer

Post by melgi »

Aragorn,

Thank you very much for the detailed explenation! I will try to follow your install plan and report back as soon as possible.

Cheers,

Melgi

Verstuurd vanaf mijn SM-G986B met Tapatalk
melgi
Posts: 51
Joined: Sun Apr 17, 2016 3:52 am

Re: Unifi Controller Installation using Docker Portainer

Post by melgi »

Hi aragorn,

I finally found some time to perform the Unifi install through Docker. I managed to run through the instruction and successfully created the Docker Container. It is started succesfully.

When I go to https://<NAS server IP Address>:8443 , I get a message that the site is not reachable. What I don't understand is in Portainer the Unifi container shows as having ip-address 172.17.0.3, which is different than my IP-range of my network. Do you have any idea what I can do to resolve this?

I hope you can help me out with this.
aragorn
Posts: 11
Joined: Tue Jan 05, 2021 9:59 am

Re: Unifi Controller Installation using Docker Portainer

Post by aragorn »

Hi Melgi, that IP address <172.17.0.3> is the internal IP address of the docker container/instance. The IP that Unifi knows will be the internal IP address of the container instance so "https://<NAS server IP Address>:8443" should translate to that and work. Other than confirming the ports are correct (manual vs auto) and having it in bridge mode (advanced network tab) I am not sure what else to check. I have reconfigured my network a couple of times using different subnets and this config has worked.
melgi
Posts: 51
Joined: Sun Apr 17, 2016 3:52 am

Re: Unifi Controller Installation using Docker Portainer

Post by melgi »

aragorn, thanx for sharing that information. I haven't thought of actually using that URL to check my unifi controller. Will try it later! Thanx again for the suggestions!

Cheers,

melgi
aragorn
Posts: 11
Joined: Tue Jan 05, 2021 9:59 am

Re: Unifi Controller Installation using Docker Portainer

Post by aragorn »

I should add the following update on this install, I changed my configuration a while back just to make it easier to backup and restore the instance. In the Advanced Container Settings, under Volumes I use the two default entries from the jacobalberty/unifi:latest image, and added the following mount point so it should look something like:

Defaults:
Container: /var/unifi [Volume]
volume: xxxxxxxxxxxxxxx - local [Writable] *
Container: /unifi/run <Volume>
volume: xxxxxxxxxxxxxxx - local [Writable] *

Added:
Container: /var/lib/unifi [Bind]
Host: /volume1/Docker/Unifi [Writable] *

* PATHs will be unique to your NAS
Post Reply

Return to “Docker”