| by TheIneptOne | No comments

Ubiquiti Unifi Controller Setup

We had about 40 locations (now up to 90) that we had Unifi setup for our security network utilizing Ubiquiti’s Cloud Key for each site. The guy before me setup this up and it was a nightmare to manage. We also had a high number Cloud Keys kept dying on us.

My solution to this problem was to centralize the management by creating a VM and hosting the Unifi Controller in house. The provided a single pain of glass for management purposes with less complexity to the setup. Once completed, we simple exported and imported all locations into the centralized controller.

Virtual Machine Setup

We use Windows Server and Hyper-V in our environment, so I went with this. We’ll be using Ubuntu Server 20.04 LTS for our Guest os to host the Unifi Controller. I did have it on Windows and it ran inconsistantly for us.

Create a new VM with the following settings (adjust if needed):

  • Generation 2
  • 4096 MBs of RAM
  • 500 GB Dynamically Expanding Disk

Once the VM is created, make the following changes:

  • Under SCSI Controller, add a DVD Drive and attach the Ubuntu Server LTS ISO (can be downloaded at https://releases.ubuntu.com/)
  • Under Firmware, move the DVD Drive to the first on the list and move Network Adapter to the bottom
  • Under Security, change the Template to Microsoft UEFI Certificate Authority
  • Under Processor, assign 4 virtual processors
  • Under Integration Services, uncheck Time Sync
  • Under Checkpoints, check Automatic Checkpoints
  • Under Automatic Start Action, set Always Start… and use 15 seconds for the Startup delay

Ubuntu Setup

Install Ubuntu Server as you usually would. Then run updates to ensure you have the latest files

sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove -y

Next, reconfigure your Time Zone. I found that sometimes it doesn’t stick after the initial install. Select US and then the correct region

sudo dpkg-reconfigure tzdata

Unifi Controller Setup

More install information can be found at https://help.ui.com/hc/en-us/articles/220066768-UniFi-Network-How-to-Install-and-Update-via-APT-on-Debian-or-Ubuntu

Setup the repo

echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

Add the GPG Key

wget -qO - https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add -

Add the Mongo DB repo

echo "deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Run an update and install the Unifi Controller

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

That’s it. The controller is now installed and you begin the setup process by going to https://ipaddress:8443. It’s highly recommended that you setup an SSL certificate through Lets Encrypt or with a reverse proxy as well as automated backups of the controller.

Leave a Reply