🚀 Install UniFi Network Controller on Ubuntu 20.04 – Step by Step Guide
Installing the UniFi Network Controller on Ubuntu Server is a reliable and efficient way to manage Ubiquiti network devices such as Access Points, Switches, and Gateways. The UniFi Controller provides a centralized web-based interface that allows IT administrators to monitor, configure, and maintain their network with ease.
In this step-by-step guide, you’ll learn how to install UniFi Network Controller on Ubuntu 20.04 by setting up all required dependencies, including Java, MongoDB, and the UniFi package. We’ll also walk through enabling the UniFi service, verifying the installation, and accessing the UniFi web interface.
This installation method is stable, secure, and suitable for home labs, SMBs, and enterprise environments. By the end of this tutorial, you’ll have a fully functional UniFi Controller ready to adopt and manage your network devices.
📌 Prerequisites
Before starting, make sure you have:
Ubuntu Server 20.04 (or 22.04 with additional notes)
Root or sudo privileges
Internet connection
🧩 Step 1: Install Java (UniFi supports Java 8 or 11)
UniFi Network Controller requires Java to run properly. First, update the system and install OpenJDK 11:
sudo apt update && sudo apt upgrade -y
sudo apt install openjdk-11-jre-headless -y
🗄️ Step 2: Add MongoDB Repository
UniFi requires MongoDB version 3.6 – 4.4 depending on the UniFi release.
Add the MongoDB 4.4 repository:
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
Update the package list:
sudo apt update
🛠️ Step 3: Install MongoDB 4.4
Install MongoDB:
sudo apt install mongodb-org -y
⚠️ Note for Ubuntu 22.04
MongoDB 4.4 is not officially supported. You will need to apply a patch or run MongoDB using Docker.
After installation, enable and start MongoDB:
sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl status mongod
🌐 Step 4: Install UniFi Network Controller
Download the latest UniFi .deb package from the official website:
👉 https://ui.com/download/unifi (select Debian/Ubuntu)
Example:
wget https://dl.ui.com/unifi/9.3.43/unifi_sysvinit_all.deb
Install the package:
sudo dpkg -i unifi_sysvinit_all.deb
sudo apt -f install -y
✅ Step 5: Verify Installation and Access Web Interface
Check the UniFi service status:
sudo systemctl status unifi
Access the UniFi Network Controller via browser:
https://<Ubuntu_machine_IP>:8443
https://192.168.16.177:8443
Follow the setup wizard to complete the initial configuration and start adopting your UniFi devices.
🏁 Conclusion
Installing the UniFi Network Controller on Ubuntu 20.04 is a robust and scalable solution for managing Ubiquiti networks. This step-by-step guide ensures a clean and stable installation with proper dependency handling.
Whether you’re deploying UniFi in a home lab, office network, or enterprise environment, this setup provides full control, flexibility, and reliability for long-term network management.
See also related articles
P5 – Update UniFi Network Controller on Ubuntu
UniFi – Update UniFi Network Controller on Ubuntu (P5 Step-by-Step Guide) Keeping your UniFi Network Controller up to date is critical for security, stability, and feature compatibility—especially in production environments running on Ubuntu Server. An outdated controller may cause device adoption issues, missing features, or even security vulnerabilities. In this...
Read MoreP4 – Set Bandwidth Limit for Each Client on UniFi WiFi
Unifi – P4 Set Bandwidth Limit for Each Client on UniFi WiFi 🔍 Overview In office networks or even advanced home networks with many connected devices, a few clients consuming excessive bandwidth is a very common issue. This often leads to slow, unstable connections and directly impacts critical services such...
Read MoreP3 – How to Backup and Restore UniFi Controller v9 (Complete Guide)
🔐 UniFi – How to Backup and Restore UniFi Controller v9 (Complete Guide) 🎯 Backing up UniFi Controller v9 is a critical task to protect your entire UniFi network, including configurations, devices, and site settings.In real-world environments, backups are essential for disaster recovery, hardware replacement, system migration, or unexpected failures....
Read More