Another catchy title, right? 😀
Decided that I want to move my UniFi network controller to Ubuntu based installation, which will be running on top of Raspberry Pi (3) device which was collecting dust.
UPDATE: If you’re having issues with Java 11 or path not being set, take a look at comment by G. Faria below.
This can be easily achieved by following these steps:
- take a backup of your current configuration (my controller was offline, so I’ve just copied the last automatic backup from /var/lib/unifi/backup/autobackup)
- prepare the SD card with OS installation (detailed info here) – I’ve selected Ubuntu Server 21.10:
- with prepared SD card, boot Ubuntu Server on your Raspberry Pi device
- first login is ubuntu/ubuntu, and you’ll need to change password immediately after
- next, you’ll probably want to set your Raspberry Pi to use static IP configuration – I’m using netplan to set it up:
- just in case, I removed all *.yaml files inside /etc/netplan/
- create new netplan template (YAML file) called 00-eth0.yaml in /etc/netplan/ (watch those white spaces!)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# 00-eth0.yaml network: version: 2 renderer: networkd ethernets: eth0: dhcp4: false set-name: eth0 match: driver: "smsc95xx" addresses: [192.168.13.4/24] routes: - to: default via: 192.168.13.1 nameservers: addresses: [192.168.13.1] |
-
- apply the configuration (your IP address will be reconfigured, so you’ll also lose the current SSH connection, if connected remotely(!))
1 2 |
netplan generate netplan apply |
- prepare for UniFi Network Application installation:
- two important prerequisites are MongoDB (available releases) and LibSSL (found it here):
1 2 3 4 5 6 7 8 |
sudo su - cd ~ wget http://launchpadlibrarian.net/555133932/libssl1.0.0_1.0.2n-1ubuntu5.7_arm64.deb dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.7_arm64.deb wget https://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.6/multiverse/binary-arm64/mongodb-org-server_3.6.23_arm64.deb dpkg -i mongodb-org-server_3.6.23_arm64.deb |
- install the UniFi Network Application:
- there is a nice official guide here, once you take care of prerequisites, but basically:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# install prerequisite packages apt-get update && apt-get install ca-certificates apt-transport-https # add Ubiquity repo (for ARM) echo 'deb [arch=armhf] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | tee /etc/apt/sources.list.d/00-ubnt-unifi.list # download and install GPG keys wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg # prevent updating OpenJDK apt-mark hold openjdk-11-* # update repos and install UniFi Network Application apt-get update && apt-get install unifi -y |
- restore from backup and start using it:
Note: If you’ll check your unifi service status, you may see “WARN Unable to load properties from ‘/usr/lib/unifi/data/system.properties’“:
This can easily be resolved by enabling the built-in “uncomplicated firewall” (ufw) – don’t forget to open ports you’ll need when it’s active! (such as SSH (22/tcp), inform endpoint for your devices (8080/tcp), UniFi Network Application web (8443/tcp), etc.):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# check if UFW is enabled already (probably not) ufw status # set exceptions ufw allow 22/tcp ufw allow 8080/tcp ufw allow 8443/tcp # enable UFW and recheck ufw enable ufw status # restart unifi service service unifi restart service unifi status |
* can be done more restricted, if needed
** full list of ports is available at https://help.ui.com/hc/en-us/articles/218506997-UniFi-Ports-Used – add them if needed (for instance, 6789/tcp is used when testing upload/download with mobile app)
*** be careful – it’s a firewall!
Note: If your access point is shown offline/timeout, maybe you forgot to open up the “inform port” 8080/tcp in UFW (been there, of course 😀):
And that’s it – you now have the fully functioning UniFi controller/UniFi Network Application running on top of your Ubuntu Server powered Raspberry Pi device!
Cheers!
P.S. Enable the autobackup feature… it’s useful (sometimes)! 😀
Great write up and guide on setting up Unifi Controller/Network on the Raspberry Pi. Just a couple of points that still caused me some trouble and could be added to make the guide more complete:
– Unifi app not configuring the path to Java correctly and this having to be done manually.
– In the guide you lock Java to version 11 but this did not work and Java 8 is the one that I had to configure to finaly get everything working. Also includiing the lines to install it just in case.
Thanks! Didn’t run into those with my setup, but I’ll include a note! Thanks again!