TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

Install UniFi Network Controller on Ubuntu 20.04 Step by Step Guide

Installing the UniFi Controller on Ubuntu Server is the best way to manage and monitor your Ubiquiti network devices efficiently. The UniFi Network Controller provides a powerful web interface for configuring access points, switches, and gateways all in one place. In this step-by-step guide, you’ll learn how to install all required dependencies such as Java, MongoDB, and the UniFi package on Ubuntu Server. We’ll also cover how to enable the UniFi service, access the web interface, and perform the initial setup wizard. This method ensures a stable and secure installation suitable for both home labs and enterprise environments. Whether you are using Ubuntu Server 20.04 or 22.04, the installation process is simple and reliable. By the end of this guide, you’ll have a fully functional UniFi Controller ready to adopt and manage your network devices. Perfect for IT administrators and network engineers who want a self-hosted, open-source compatible controller.

Step 1: Install Java (UniFi currently supports Java 8 or 11)

sudo apt update && sudo apt upgrade -y
sudo apt install openjdk-11-jre-headless -y

Step 2: Add MongoDB repo (if Ubuntu doesn’t have it yet)

UniFi requires MongoDB 3.6 – 4.4 (depending on version)

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

echo “deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt update

Step 3: Install MongoDB 4.4

sudo apt install mongodb-org -y
For Ubuntu 22.04, you need to patch or install MongoDB using docker because MongoDB 4.4 is not officially supported.

After installation, start MongoDB:

sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl status mongod

Step 4: Install UniFi Controller

Download the latest .deb package from https://ui.com/download/unifi (select Debian/Ubuntu).

wget https://dl.ui.com/unifi/9.3.43/unifi_sysvinit_all.deb
sudo dpkg -i unifi_sysvinit_all.deb
sudo apt -f install -y

Step 5: Check and access

sudo systemctl status unifi

Access UniFi Controller via browser:
https://<Ubuntu_machine_IP>:8443
https://192.168.16.177:8443