What is UniFi controller ?

The Ubiquiti line of devices (network switches, wireless APs etc) do not have a built in environment for configuration/management. Instead they use a piece of software known as the UniFi network controller. With this application you can manage and configure any Ubiquiti device from one location and also remotely from the Ubiquiti portal. If you do not want your network infrastructure accessible via the cloud then you have two choices:

  1. Don’t use Ubiquiti devices
  2. Shutdown the controller application when not in use.

In this post I will describe you to install the UniFi network controller into Debian 11 (Bullseye). I’d suggest installing into a VM or container so that point two (above) can be accomplished as the controller will run as a service in Linux.

Preperation

UniFi network controller has two dependancies :-

  1. The Java Runtime Environment (JRE)
  2. MongoDB

Installation

Before proceeding we need to ensure that apt will be able to connect and use https based repositories.

apt install apt-transport-https ca-certificates

The Java JRE is reuired as the network controller is a java application. They recommend Java 8 but I have found that the JRE11 headless packed in the debian repo works fine.

apt install openjdk-11-jre-headless

Next the gpgp key needs to be installed for MongoDB.

# MongoDB 3.6
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

And the same thing for the UniFi repo key.

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

Now we can finally install the UniFi network controller.

sudo apt-get update && sudo apt-get install unifi -y

Once apt has completed, check the unifi service.

systemctl status unifi

systemctl should show that the unifi service is running and active.

unifi.service - unifi
     Loaded: loaded (/lib/systemd/system/unifi.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-01-30 09:56:43 AEDT; 11min ago
    Process: 361 ExecStartPre=/usr/sbin/unifi-network-service-helper init (code=exited, status=0/SUCCESS)
    Process: 415 ExecStartPre=/usr/sbin/unifi-network-service-helper init-uos (code=exited, status=0/SUCCESS)
    Process: 425 ExecStartPost=/usr/sbin/unifi-network-service-helper healthcheck (code=exited, status=0/SUCCESS)
   Main PID: 424 (java)
      Tasks: 100 (limit: 2337)
     Memory: 936.9M
        CPU: 38.822s

Browse to your UniFi network controller at https://your-controllers-ip-address:8443.

Note that you will need to create an account on the Ubiquiti portal as the network controller will ask for authentication. Login with your portal account and password.