Unifi Controller Configuration
In the DHCP Server settings for the interface that the Unifi Controller is connected to be sure to enable DHCP Option 43. This essentially will allow additional devices to know how to contact the Unifi Controller for Adoption. This site can help calculate/convert the information needed for use with pfSense as well as other manufacturers
See Ubuntu Docs or Debian Docs
See Install Docs
This installs and enables the firewall (default: block all incoming) and then opens port for SSH access so we don't lose access to the server
sudo apt install ufw
sudo ufw allow OpenSSH
sudo ufw enable
Copy the included ufw firewall rules from the ufw_unifi file into a new file in the ufw application directory. This will open all the ports utilized by the Unifi Controller as documented here
cd /etc/ufw/applications.d
sudo vim unifi
then enable the rules
sudo ufw app update unifi
sudo ufw allow Unifi
Copy the contents of the docker-compose.yaml
file into your docker-compose.yaml
file. Depending on your use case you may have the Unifi Controller listening on the default machine interface IP in which case you can remove [IP_ADDR]:
from the relevant lines as you only need to map the ports and not to a specific IP address.
sudo mkdir /apps
sudo chmod -R johnsoga:johnsoga: /apps
mkdir /apps/docker/unifi
vim docker-compose.yaml
cd /apps/docker/unifi
XUID=$(id -u $USER) XGID=$(id -g $USER) docker pull
XUID=$(id -u $USER) XGID=$(id -g $USER) docker compose up -d
cd /apps/docker/unifi
XUID=$(id -u $USER) XGID=$(id -g $USER) docker-compose pull