johnsoga / unifi

Unifi Controller Configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unifi

Unifi Controller Configuration

Prerequisistes

DHCP Server

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

Docker Installation

Docker

See Ubuntu Docs or Debian Docs

Docker Compose

See Install Docs

Firewall Configuration

UFW Firewall

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

Unifi Rules

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

Unifi Docker Configuration

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

Running

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

Updates

cd /apps/docker/unifi
XUID=$(id -u $USER) XGID=$(id -g $USER) docker-compose pull

About

Unifi Controller Configuration

License:GNU General Public License v3.0