Introduction
Recently i had some big challenges when screwing around with my home network (which consists of 5 vlan’s). Since my unifi controller was on a docker container. I was very lucky to have set a static ip on the os. This however made me realise. I should not run the unifi controller in a container (or pod for that matter). Best practise would be to run it on a rapsberry pi, but i figured since there a supply storages a VM would suffice.
Installing on Debian 10 “buster”
I’m using of the following packages/versions:
- Mongodb 3.6
- Java JDK 8 (hotspot)
- Unifi controller 6.4.54-16067-1
Prerequisites:
- install debian 10 or 11 vm
- sudo apt upate && sudo apt upgrade -y
Install necessary packages:
sudo apt install wget gnupg2 ca-certificates apt-transport-https dirmngr gnupg software-properties-common multiarch-support haveged
note: unknown in debian 11: multiarch-support
Installing MongoDB 3.6:
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
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
sudo apt update
sudo apt install mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod
Installing Java (8)
The unifi controller requires java 8 jdk. I tried hacking into the systemd service, but the amount of time it took to get a working hack was not worth the effort imho (in my humble opinion).
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo apt update && sudo apt install adoptopenjdk-8-hotspot
SET JAVA HOME for unifi:
Make sure that unifi knows where to find the $JAVA_HOME var. This doesn’t always seem to be placed and therefore it is better if you do it yourself, just to be sure
sudo su -
echo "JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64" > /etc/default/unifi
Install unifi controller software:
Now we’re finally off to installing the controller software. We use the package from the officia repo. But first we need to add the apt key. Afterwards the ubiquiti repo will be added to a custom file
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo apt update && sudo apt install unifi
Now go to <ipaddress-of-your-vm>:8443
and you’ll find your controller login page.
Good luck with configuring. I will add some tips and config possibilities in a blog post in the future!