Build Debian Unifi Controller Server


By Charles O. Lucas

Here are my notes on my completed project. At my current job, I want to monitor the network devices, bandwidth, etc. For the client’s budget, I am supplying them with Ubiquiti manage switches and APs.
Ubiquiti supplies a free software management controller with no additional license fees. I am currently switching out all the core equipment and starting to replace additional switches as desktops to allow a complete view of the network. So, I used a spare Dell Desktop; the instructions may change based on the hardware and Linux distro; I am using a Debian Linux.


Dell Desktop
Model: Inspiron 620
Harddrive: 1TB
Ram: 6GB DDR3 SDRAM,1333MHZ – 1x4G B/1x2GB
CPU: Intel Core i3-2100 processor(3MB Cache, 3.10GH z)

UniFi Network APT Steps

Install the required packages before you begin with the following command:

sudo apt-get update && sudo apt-get install ca-certificates apt-transport-

Use the following command to add a new source list:

echo ‘deb [ arch=amd64,arm64 ] https://www.ui.com/downloads/unifi/debian stable ubiquiti’ | sudo tee /etc/apt/sources.list.d/100-ubn

Add the GPG Keys.

Method A – Recommended

Install the following trusted key into /etc/apt/trusted.gpg.d

sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg

Method B

Using apt-key:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv 06E85760C0A52C50

For a new UniFi Network Server, install MongoDB. For Ubuntu 22.04, run the commands below. If you’re updating the UniFi Network Server to version 7.5, ignore these commands and refer to MongoDB’s help article (or use this community script) to update your database to the required MongoDB version 3.6.

wget -qO – https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add –
echo “deb [trusted=yes] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.6 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update

This step may not be required, depending on the Linux distro you have. If your distro does not come with MongoDB and is unavailable in their repo, please see the MongoDB installation guide (Ubuntu | Debian). 

Install and upgrade the UniFi Network application with the following command:

sudo apt-get update && sudo apt-get install unifi -yThe UniFi Network application should now be accessible at the computer’s configured local or public IP address, by typing that IP address in a browser’s navigation bar (Chrome is recommended). If it is not launching, use the following command:
sudo service unifi start

To disable sleep mode in Debian, you can use the following commands:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target 

Other Helpful Commands
To stop the UniFi service: sudo service unifi stop
To restart the UniFi service: sudo service unifi restart
To see the status of UniFi service: sudo service unifi status
Click here for possible suite names and code names.

Log Files Location
Log files are essential for any troubleshooting. Find them here:
/usr/lib/unifi/logs/server.log
/usr/lib/unifi/logs/mongod.log


Work Cited


Like my Content, subscribe, support, or donation

If you like my content and want me to create more, please support and donate; we have many options.

Published by Charles Onaje Lucas

otaku, martial artist, artist, and actor living in Flushing, Queens, New York.