Unifi offers a free (but not open-source) controller solution based on Linux with an amazing web GUI and integration with their cloud service [Link].

INSTALLING UNIFI ON UBUNTU 20.04

sudo apt update
sudo apt install ca-certificates apt-transport-https -y
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg

Installing the controller service:

sudo apt-get update
sudo apt install openjdk-8-jre-headless unifi -y
sudo systemctl status --no-pager --full mongodb.service unifi.service

Preferentially using Chrome, navigate to the web user interface at https://10.0.0.1:8443/ (replace the IP accordingly).

Follow the 6 steps to create a local account for your private controller.

Give your controller a name and click next.

Alternatively, an Unifi account could be used and the controller could be exposed to the internet to accept connections from many sites (for managing client’s infrastructure for example). For now, skip the log on and switch to advanced.

Disable the cloud-based functionalities to make it standalone and create credentials for it.

Leave the defaults options.

If you have Unifi devices in the same network segment they might be discovered in this step. In any case just click next.

Define the name of your WIFI and give it a password.

Set the location and timezone. It is important when you schedule firmware upgrades and other functionalities.

Then your dashboard might look like the following:

Clean the system:

sudo apt clean -y
sudo apt autoremove -y

The service can be started and stopped with the following commands:

sudo systemctl start unifi
sudo systemctl restart unifi
sudo systemctl stop unifi

In case you ran into issues trying to connect your controller to the Unifi cloud, execute the following commands and try again after:

sudo systemctl stop unifi
sudo rm /etc/ssl/certs/java/cacerts &> /dev/null; sudo update-ca-certificates -f
sudo systemctl start unifi

And allow the used port to be accessible through the firewall:

sudo ufw allow 8080,8443,8843,8880,6789/tcp
sudo ufw allow 8080,8443,8843,8880,6789,3478,10001,1900,5514/udp

Note the following requirements for cloud access:

Optionally, I recommend changing the Launch using WebRTC. This way does not require to expose any port to the internet.


INSTALLING UNIFI ON DOCKER

The best advantage of running the Unifi Controller inside a container is the very lightweight, utilizing the middle resources of any other host in your network and even in a Raspberry Pi.

Supported processor architectures:

  • x86-64
    • Standard Intel/ADM processores.
  • ARM64
    • Raspberry Pi 3 or newer.
  • ARMHF (Hard Floating-point)
    • Raspberry Pi 2 (32 bits).
mkdir ~/unifi-config
sudo docker run -d --name=unifi -e PUID=1000 -e PGID=1000 -p 3478:3478/udp -p 10001:10001/udp -p 8080:8080 -p 8443:8443 -p 1900:1900/udp -p 8843:8843 -p 8880:8880 -p 6789:6789 -p 5514:5514/udp -v ~/unifi-config:/config --restart unless-stopped ghcr.io/linuxserver/unifi-controller