Skip to main content

Installing Unifi Controller on Debian 11 Bulleyes

Manual Installation

Debian 11 Bulleyes is the latest version of Debian as of 2022-03. Unfortunately, Unifi Controller relies on older software dependencies such as Java 8 and MongoDB 3, both of which are not available in the default Debian repository.

SSH into your Debian 11 install, or login to the console.

Install the following packages if your Debian system does not already have it:

#apt-transport-https allows for repository access via HTTPS
sudo apt install apt-transport-https 

#This package holds the up to date Certificate Authorities 
sudo apt install ca-certificates

#GnuPG complete and free implementation of the OpenPGP standard
sudo apt install gnupg

#Haveged is a package that will make sure the Linux RNG have sufficient entropy
sudo apt install haveged

Screenshot 2022-09-17 170347.png

Since Java 8 is not in the default Debian repository, we can use AdoptOpenJDK 8 from the AdoptOpenJDK Project (https://adoptopenjdk.net/) repository instead:

#Add Repository Key
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

#Add Repository
echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list

Screenshot 2022-09-17 170535.png

MongoDB 3 can be added from the official MongoDB repository:

#Add Repository Key
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -

#Add Repository
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

Screenshot 2022-09-17 170602.png

Finally, add the Unifi Controller repository:

#Add repository key
wget -qO - https://dl.ui.com/unifi/unifi-repo.gpg | sudo apt-key add -

#Add repository
echo "deb https://www.ui.com/downloads/unifi/debian stable ubiquiti" | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

Screenshot 2022-09-17 170658.png

Update the package repository, and install Java 8, MongoDB, and Unifi Controller.

sudo apt update
sudo apt install adoptopenjdk-8-hotspot mongodb-org unifi

Screenshot 2022-09-17 170757.png

To auto start the Unifi Controller and its dependencies at boot:

sudo systemctl enable mongod.service
sudo systemctl enable haveged.service
sudo systemctl enable unifi.service

Screenshot 2022-09-17 171736.png

That’s it! You can access the Unifi Controller GUI through the controller’s IP or FQDN in your we browser on port 8443.

Screenshot 2021-08-15 174643.png

Bash Script Installation

The above commands can be turn into a simple bash script to automate the Unifi Controller install. Copy the following script and save it as a bash file, and execute it on the system with sudo.

#!/bin/bash

#apt-transport-https allows for repository access via HTTPS
sudo apt -y install apt-transport-https 

#This package holds the up to date Certificate Authorities 
sudo apt -y install ca-certificates

#GnuPG complete and free implementation of the OpenPGP standard
sudo apt -y install gnupg

#Haveged is a package that will make sure the Linux RNG have sufficient entropy
sudo apt -y install haveged

#Add AdoptOpenJDK 8 repository
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list

#Add MongoDB repository
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

#Add Unifi Controller repository
wget -qO - https://dl.ui.com/unifi/unifi-repo.gpg | sudo apt-key add -
echo "deb https://www.ui.com/downloads/unifi/debian stable ubiquiti" | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list

#Update and Install
sudo apt update
sudo apt -y install adoptopenjdk-8-hotspot mongodb-org unifi

#Autostart services
sudo systemctl enable mongod.service
sudo systemctl enable haveged.service
sudo systemctl enable unifi.service