We help MSPs migrate from their UniFi controllers to UniHosted (included in the MSP plan)

How to install UniFi Controller on Linux?

Published onby Iron (edited on )

Installing the UniFi Network Application (previously UniFi Controller) on a Linux system is a great way to manage your UniFi network with greater flexibility and control. However, it can be challenging to get the installation right. This guide will walk you through the installation steps in a Linux environment.

If you want what others to do this for you, check out UniHosted.

Table of Contents

Preparing for Installation

Requirements

Before starting, ensure you have backed up the UniFi Network Database and that the user has sudo permissions. For more information on adding a user to the sudo list, see this Debian article.

UniFi Network APT Steps

  1. Install required packages:

    sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https
    
  2. 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-ubnt-unifi.list
    
  3. Add the GPG Keys:

    • Method A (recommended):
      sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
      
    • Method B:
      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
      
  4. Install MongoDB for a new UniFi Network Server:

    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
    

    Note: This step may not be required depending on your Linux distro. Refer to the MongoDB installation guide for Ubuntu or Debian.

  5. Install and upgrade the UniFi Network application:

    sudo apt-get update && sudo apt-get install unifi -y
    
  6. Access the UniFi Network application:

    • Open a browser and navigate to the local or public IP address of your computer. If it is not launching, start the service:
    sudo service unifi start
    

Other Helpful Commands

  • Stop the UniFi service:
    sudo service unifi stop
    
  • Restart the UniFi service:
    sudo service unifi restart
    
  • Check the status of the UniFi service:
    sudo service unifi status
    

Post-Installation Tips

  • Firewall Settings: Ensure traffic is allowed on port 8443, used by the UniFi Controller.
  • Regular Updates: Keep your UniFi Controller software updated for the latest features and security enhancements.
  • Backup Your Configuration: Regularly back up your UniFi Controller configuration to prevent data loss.

Final Thoughts

Installing the UniFi Controller on a Linux server provides a robust and flexible way to manage your UniFi network. For a more streamlined solution, consider our cloud-hosted UniFi Controller services at UniHosted.

Our cloud solution eliminates the need for local hardware and software management, providing an efficient, secure, and scalable way to control your UniFi networks.

We host UniFi Controllers in the Cloud

Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.

Deploy Now

Free tier available

Get the best support

Join 1660+ customers

No credit card required