This page covers the steps I went through to setup the UniFi Network controller on an Orange Pi Zero 3. For no reason obvious to me, this process was overcomplicated and very annoying.
This article is somewhat out of date now as Ubiquiti has introduced UniFi OS which changes how the Network controller is deployed. I have personally switched over to it and recommend it over all of this mess.
I purchased the Orange Pi Zero 3 because it was cheap and I wanted to move my UniFi controller out of the Docker container on my main server. The idea was to create a DIY UniFi CloudKey, hence I called mine shitty-cloudkey
. On the surface, this is rather trivial; Ubiquiti's apt repository includes arm64
packages and the UniFi controller itself is a Java application, making it rather portable.
The problem is that the UniFi controller depends on MongoDB for its database, and MongoDB's system requirements require the ARM V8.4-A microarchitecture at minimum (in english: Cortex A73 cores or later). The Zero 3 has Cortex A53 cores, which do not have the instruction sets required. I never really investigated the reasoning for this, but given that this makes Mongo's published builds incompatible with the Raspberry Pi 4, I find it rather strange, since that doesn't really strike me as an especially old SBC?
I'll be honest, I normally don't mess around with SBCs so had no idea what the go-to distro was for RasPi clones. After what was probably less than 30 seconds of searching, I decided to use Armbian since it did exactly what I needed: Debian 12 ready to go.
winget install balena.etcher
ssh root@<that ip address>
, default password is 1234
(Thank you armbian devs for letting you do the install process remotely)apt update && apt upgrade
, set a hostname and possibly static IP addresslibssl1.1
, I don't actually know if this is required anymore but it stops apt from complainingcurl -OL https://archive.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1n-0+deb10u3_arm64.deb
sudo dpkg -i libs<tab complete>
curl -OL https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.4/multiverse/binary-arm64/mongodb-org-server_4.4.29_arm64.deb
sudo dpkg -i mong<tab complete>
mongod
binary that actually works from a MongoDB employee's personal GitHub yes reallypi4
curl -OL https://github.com/themattman/mongodb-raspberrypi-binaries/releases/download/r7.0.14-rpi-unofficial/mongodb.ce.pi4.r7.0.14.tar.gz
tar xvf mong<tab complete>
sudo mv mongod /usr/bin/mongod
This next section is loosly modified from Ubiquiti's official setup instructions: https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux
sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https
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
curl -L -o /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
sudo apt update
sudo apt install unifi
UniFi should be up and running by this point, if it isn't then bash it with sudo systemctl restart unifi
until it shows something at https://<ip here>:8443
. If that still doesnt work, sudo cat /usr/lib/unifi/logs/server.log
may provide a clue, or maybe it wont. FEW MORE THINGS:
is_default=
to true
in /var/lib/unifi/system.properties
. Don't forget to change it back after you run through the setup again.