Skip to content

How to install Unifi controller on Ubuntu?

  • by
  • 4 min read

Installing packages in Ubuntu is made rather easy with the use of the apt command. While this does cover most packages the average Ubuntu user might need, certain packages require a bit more effort.

In this article, we’re going over how you can install the Unifi controller on your Ubuntu machine.

Also read: 25 essential Linux Terminal commands


How to instal the Unifi controller with APT?

To install the Unifi controller with the apt package manager, you’re first going to have to make a few changes. Most notably, we’re going to have to add the download repository to the apt repository list. 

Step 1: Open up a terminal and type the following command. Press enter when you’re done. This will update the apt repository list and will install all the dependencies we need. 

sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https
How to install Unifi controller on Ubuntu? | Candid.Technology

Step 2: Type the following command to add the new source to the apt repo list.

echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
How to install Unifi controller on Ubuntu? | Candid.Technology

Step 3: Now, we need to add GPG keys. You can do this using either of the two methods.

  • Install the trusted key into  /etc/apt/trusted.gpg.d: Type the following command in the terminal and press enter.
    sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
  • Using apt-key: Type the following command in the terminal and press enter.
    sudo apt-key adv –keyserver keyserver.ubuntu.com –recv 06E85760C0A52C50
How to install Unifi controller on Ubuntu? | Candid.Technology

Step 4: Use the following command to install and update the Unifi network controller.

sudo apt-get update && sudo apt-get install unifi -y
How to install Unifi controller on Ubuntu? | Candid.Technology

Note that on some distributions, you might get an incompatible Java error. To resolve this, use the following command before step four. 

sudo apt-mark hold openjdk-11-*

You should keep in mind if you’re running Ubuntu 18.04 to run the following commands before installing Unifi. It makes sure that your OS has MongoDB installed, which is a prerequisite for Unifi. 

wget -qO - https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add -
echo "deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update

How to install the Unifi controller on Ubuntu 20.04?

Installing the Unifi controller on Ubuntu 20.04 is rather easy, thanks to a shell script written by Github user davecoutts. This script downloads and installs all the prerequisites and the Unifi controller on your Ubuntu machine in no time. 

You can find davecoutts shell script here. 


Log files

Any log files that are generated during installation are stored in the following locations. You can refer to these to diagnose any issues during installation.

  • /usr/lib/unifi/logs/server.log
  • /usr/lib/unifi/logs/mongod.log

Tips and Tricks

  • If you’re running this installation in a VM or on a headless machine, you can encounter entropy issues. To resolve these, install haveged.
  • Since Unifi version 5.6.x and Unifi server don’t run as root, you cannot bind to privileged ports (<1024). The controller will fail to start if you use the wrong port.
  • When installed on Debian or Ubuntu, the Unifi controller will not have a GUI as it runs as a service.
  • Ubiquiti doesn’t support arm64, and hence the download isn’t available in the repository. A manual download and installation is required for such systems.
  • For users working with restrictive firewalls, the following command will help them add the GPG key — apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 06E85760C0A52C50

Also read: How to change MAC address on Windows and Linux?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>