How To Setup UniFi Controller On Ubuntu: A Comprehensive Deployment Guide

How To Setup UniFi Controller On Ubuntu: A Comprehensive Deployment Guide

Unifi Network Lan Setup at Kathaleen Velasquez blog

Deploying the UniFi Network Application on an Ubuntu server provides a robust, centralized architecture for managing enterprise-grade access points, switches, and gateways. This guide covers manual installation via the official repository, firewall configuration, and MongoDB dependency management to ensure a production-ready environment.


Pre-Operation & Server Architecture Checklist

Setting up a dedicated UniFi Network Application instance on Ubuntu requires careful resource allocation and software dependency planning. Unlike consumer-grade network management tools, the UniFi controller relies heavily on Java runtime environments and a dedicated NoSQL database instance to handle telemetry, client logs, and device configurations in real time.



  • Essential Gear & Tools: A dedicated Ubuntu Server (versions 20.04 LTS, 22.04 LTS, or 24.04 LTS), administrative root or sudo-level access, and a static local IP address assigned to the host machine.
  • Mandatory Prerequisite Standards: Familiarity with Linux terminal navigation, basic firewall administration via UFW, and an understanding of TCP/UDP port mapping for remote device adoption.
  • Estimated Budget & Duration Benchmarks: Zero monetary cost for the open-source controller software; deployment takes approximately 30 to 45 minutes depending on system updates and repository synchronization.

Step-by-Step Ubuntu Deployment Workflow



Step 1: System Update and Core Dependency Installation

Log into your Ubuntu server via SSH and ensure the underlying operating system packages are fully updated to prevent version conflicts during software installation. Execute a system update and upgrade cycle, then install essential utilities including ca-certificates, apt-transport-https, gnupg, and software-properties-common. Verify that your system time is synchronized using Network Time Protocol, as time drift causes SSL certificate validation failures and device adoption timeouts.

Warning: Never skip package updates before adding external third-party repositories, as mismatched system libraries frequently break the Java Runtime Environment installation.



Step 2: Configuring the Java Runtime Environment

The UniFi Network Application requires specific Java versions depending on the controller build you are targeting, with Java 17 being the standard requirement for recent software iterations. Install the appropriate Java Development Kit or Java Runtime Environment package through the standard Ubuntu package manager. Confirm that the correct Java version is set as the system default by checking the runtime version output, and ensure the JAVA_HOME environment variable is properly exported in your shell profile if prompted by custom installation scripts.



Step 3: Adding the UniFi and MongoDB Repositories

Because Ubiquiti maintains its own software distribution channels and relies on specific database engines, you must add their official GPG signing keys and repository sources to your APT sources list. Import the Ubiquiti signing key using the secure keyring method rather than deprecated apt-key commands, then append the official UniFi repository URL to your sources list directory. Additionally, ensure the required MongoDB database repository is active on your system, as the controller utilizes MongoDB for persisting configuration metadata and historical analytics data.

Pro-Tip: Always verify the repository URL matches your specific Ubuntu codename (such as focal, jammy, or noble) to prevent broken package dependencies during installation updates.



Step 4: Installing and Initializing the UniFi Network Application

Update your local package index once more so that the system recognizes the newly added Ubiquiti and MongoDB repositories. Execute the installation command for the unifi package, which will automatically trigger the installation of dependent database packages and initialize the background service daemon. Monitor the installation progress to ensure no package configuration errors occur, particularly regarding port bindings or database user permissions.



Step 5: Firewall and Network Port Configuration

For your managed Ubiquiti hardware to discover, adopt, and communicate with the Ubuntu controller, specific ports must remain open on your server firewall. Enable the Uncomplicated Firewall if it is not already active, and create explicit rules allowing inbound traffic on TCP port 8080 for device communication, port 8443 for the management user interface, port 8880 and 8843 for guest portal redirection, and UDP port 10001 for device discovery. Reload the firewall ruleset and verify active listeners using network diagnostic utilities to confirm the service is running on the expected interfaces.



Port Number Protocol Direction Functional Purpose
8080 TCP Inbound Device-to-controller communication and management traffic
8443 TCP Inbound Secure web management user interface and API access
3478 UDP Inbound STUN service for remote device discovery and NAT traversal
10001 UDP Inbound/Outbound Ubiquiti device discovery broadcast protocol

Install UniFi OS Server on Ubuntu 24.04 LTS | ComputingForGeeks

Install UniFi OS Server on Ubuntu 24.04 LTS | ComputingForGeeks

Common Site Failures and Field Fixes

Even with a meticulous installation process, environmental factors and package updates can occasionally disrupt controller operations.



  • Root Cause: Java version mismatch causing the controller service to fail on startup.

    • Actionable Fix: Check the system journal logs using systemctl status unifi.service, identify the missing runtime version, install the precise Java Development Kit required by your controller version, and restart the daemon.
  • Root Cause: Database corruption resulting from an unexpected power loss or hard server reboot.

    • Actionable Fix: Stop the unifi service, repair the MongoDB instance using the built-in repair flag or restore the most recent configuration backup JSON file from your automated off-site backups.
  • Root Cause: Managed switches and access points stuck in an adopting or disconnected state.

    • Actionable Fix: Verify that TCP port 8080 and UDP port 3478 are fully accessible through intermediate firewalls, and issue a manual set-inform command via SSH on the affected hardware pointing to your Ubuntu server IP address.

Frequently Asked Questions



What hardware specifications are required to run a UniFi Controller on Ubuntu?

For small to medium deployments under fifty devices, a virtual machine or dedicated server with two CPU cores, 4GB of RAM, and 50GB of fast SSD storage is sufficient. Larger multi-site deployments managing hundreds of network elements require scaling up to 8GB or more of RAM and high-IOPS disk storage to handle continuous database logging.



How do I access the UniFi Controller web interface after installation?

Open your preferred web browser and navigate to the secure HTTPS URL using your Ubuntu server IP address or domain name followed by port 8443. Because the initial SSL certificate is self-signed by the local system, your browser will display a security warning which you can safely bypass to proceed through the initial setup wizard.



Can I migrate an existing UniFi backup from a Cloud Key to my Ubuntu server?

Yes, the UniFi Network Application configuration is entirely cross-platform as long as the target controller version is equal to or newer than the source backup version. Simply export a backup file from your old controller via the maintenance settings, install a fresh instance on Ubuntu, and upload the backup file during the initial setup wizard or via the management dashboard.



How do I update the UniFi Controller on Ubuntu?

Because the repository was added during the initial installation phase, updating the controller is handled natively through the Ubuntu package manager. Simply run a system package update followed by an upgrade command targeting the unifi package, and the system will gracefully handle the binary replacement and database schema updates automatically.

Secure your network infrastructure today by deploying a scalable, production-ready UniFi Network Controller on your Ubuntu server environment.


การติดตั้ง Unifi Network Server บน Ubuntu Linux

การติดตั้ง Unifi Network Server บน Ubuntu Linux

Read also: How to Get Chalk Paint Off a Chalkboard: The Complete Restoration Guide