Docker - Unifi Controller Container Setup

Here I describe my setup of the Unifi Controller container.

I run this Docker container on a Ubuntu VM that runs via [[ Proxmox VE ]]. I perform the following on the CLI.

Docker pull command:

docker pull jacobalberty/unifi

Within my home folder I have created a Docker folder where I create a subfolder for each container:

cd ~
mkdir -p docker/unifi
cd docker/unifi

Also create folders where the data and log files can be stored:

mkdir data
mkdir log

I use the Nano text editor to create a shell script:

sudo nano

With this shell script we are going to create the container. Copy the following into

IDu=$(id -u $(logname)) # Saves the logged in user id in the IDu variable
IDg=$(id -g $(logname)) # Saves the logged in user group in the IDg variable

docker run -d \
 --init \
 --name=unifi \
 --hostname=unifi \
 --net=host \
 -v $PWD/data:/unifi \
 -e TZ="Europe/Amsterdam" \
 -e RUNAS_UID0=false \
 -e UNIFI_UID=$IDu \
 -e UNIFI_GID=$IDg \
 --cap-add=NET_ADMIN \
 --restart=unless-stopped \

If necessary, adjust the following:

Choose the location for the Unifi Controller data. In this example it is the data map we created

-e ‘TZ=Europe/Amsterdam’
Pick the right timezone

Exit Nano (CTRL-X) and save the changes.

Now create the container:

sudo sh

Check if the container is running properly.

If the container fails to start because port 8080 is already in use, the port can be modified as follows:

docker stop unifi
cd data #unifi/data map
sudo nano

And add the following:


Exit Nano (CTRL-X) and save the changes. Now you can start the container again:

docker start unifi

Using Unifi Controller

The website can be reached via the URL:

http://<IP DOCKER SERVER>:8080/

Optionally adjust the port if it has been changed within the
Now you will be redirected to https://<IP DOCKER SERVER>:8443/manage/wizard/

See also my notes about updating containers with Portainer or via the CLI. With Synology’s Docker Application, updating a container is also very easy.

Read other notes


    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.


    Notes mentioning this note

    Notes Graph