UniFi Controller

Ubiquiti UniFi is a line of networking equipment including Wi-Fi access points and switches. Most of these devices need a “UniFi Controller” to allow the device to be configured and managed. A LXC container in AstLinux offers a good method to act as a local UniFi Controller for Wi-Fi access points and switches.

Resource Usage: (minimum)

  • Memory: 1280 MB
  • Storage: 1.3 GB

Note -> At the time of this writing (June 2020), the UniFi Controller software is best matched with a Debian 9 distribution. The example below is based on a Debian 9 container.

Tip -> Alternatively, community supported UniFi Installation Scripts may be used for various Ubuntu / Debian distributions.

First, it is assumed the lxcbr0 interface is setup per the Quick Start Guide → Enable LXC Support.

Then from the CLI:

lxc-create -t download -n unifi -- -d debian -r stretch -a amd64 --no-validate
service lxc restart
lxc-attach unifi
  apt update
  apt install curl apt-transport-https openjdk-8-jre-headless
  echo 'deb stable ubiquiti' | tee /etc/apt/sources.list.d/100-ubnt-unifi.list
  curl -o /etc/apt/trusted.gpg.d/unifi-repo.gpg
  apt update
  apt install unifi

Following installation, via a web browser HTTPS on port 8443, access the web interface within the container and begin setup.

Tip -> If you prefer not to create a account, you may establish a local-only UniFi instance by clicking on “Switch to Advanced Setup” during “Sign in …” in setup.

The UniFi Controller can use a noticeable amount of CPU and RAM resources, depending on the number and type of device. For a small installation you can edit the /var/lib/lxc/unifi/config file and uncomment and edit the following line:

lxc.cgroup.memory.limit_in_bytes = 1280M

to keep the RAM usage from going over 1.28 GB. Larger installations may require 1536M or 2048M for good performance.

Related Info -> LXC container in AstLinux

UniFi DHCP option 43, Controller Assignment

If the UniFi controller is not in the same subnet (broadcast domain) as your UniFi devices, before adopting UniFi devices you can edit your /mnt/kd/dnsmasq.static file with the following:

## UniFi DHCP option 43, Controller Assignment

Replace the IP address with your controller's static address. In the web interface, select “Restart DNS & DHCP” to apply the change to the dnsmasq configuration.

  • userdoc/guest_lxc_container_unifi.txt
  • Last modified: 2020/06/12 17:50
  • by abelbeck