Unifi Controller on Odroid XU4 & Odroid N2

Aryo Pratama
3 min readJul 20, 2020

--

I am a huge fan of Unifi products when implementing WLAN infrastructure since 2015. Its the most favorable option besides Ruckus and Meraki.

I have done several Unifi Controller implementations using Raspi and Odroid to safe some rack spaces and electricity bill. I use Odroid XU4 for both of my home (3 years now, since Ubuntu 16.04) and its great performance as a small server.

Home Unifi Controller

Since armhf is not supported anymore by MongoDB it became problematic for me to use it but thanks to Dominic Chen who provide MongoDB 3.2 binary on https://www.github.com/ddcc/mongodb we can continue the updates and installation for Unifi controllers.

I just got a new Odroid N2 and would like to put it on action. Odroid N2 is an aarch64 and Mongodb available on aarch64 so it will be an easy setup. Besides Unifi Controller, I also have Unifi Video for my CCTV; Unifi G3 Pro, and Flex. I made some bash scripts to ease my job. Those simple scripts are for ordinary PC server, Odroid XU4 (armhf), and Odroid N2 (aarch64).

Basically, all of the scripts should do this sequences,

  1. Add needed repositories
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.listsudo 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.listsudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg

2. Update repo and upgrade the Ubuntu server

sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade

3. Install supporting & main apps

sudo apt install -y jsvc logrotate openjdk-8-jre-headless ufw libcap2 ca-certificates apt-transport-https gdebi debsums mongodb-org wget curl ufw speedtest-cli haveged unifi

4. Check services

sudo systemctl enable unifi
sudo service unifi restart

5. Open all necessary firewall ports

sudo ufw allow 3478/udp
sudo ufw allow 5514/tcp
sudo ufw allow 8080/tcp
sudo ufw allow 8443/tcp
sudo ufw allow 8880/tcp
sudo ufw allow 8843/tcp
sudo ufw allow 6789/tcp
sudo ufw allow 27117/tcp
sudo ufw allow 5656:5699/udp
sudo ufw allow 10001/udp
sudo ufw allow 1900/udp
sudo ufw allow 443
sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 8883/tcp

6. Configure Log

echo "** Add Log Rotation"
sudo bash -c 'cat >> /etc/logrotate.d/unifi << EOF
/var/log/unifi/*.log {
rotate 5
daily
missingok
notifempty
compress
delaycompress
copytruncate
}
EOF'

For those of you who wants to try this installation script can download it from my repo https://www.github.com/aryonp/unifi

The main difference between PC and the ARM SBC scripts is that you can install Unifi Video and VoIP besides Unifi Controller on PC. Its a quite dillema right now since Unifi Video already on its last steps before totally moving to Unifi Protect and users with standalone Unifi NVR will not receive migration function to Unifi Protect. There are several Unifi community users who provide Unifi Protect on container to test, you can try it with your own risk there.

Enjoy!

AP

--

--