The next step is to install the UniFi Controller software.
Add the UniFi repository to the sources list, using the following commands:
echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee -a /etc/apt/sources.list.d/100-ubnt.list > /dev/null
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
sudo apt-get update
In the first command above, the source name stable represents the current supported UniFi release. However, if you wish to use a different release, you may use one of the following source names: UniFi 5.6 = oldstable UniFi 5.7 = stable UniFi 5.8 = testing
Install UniFi, using the following package install command:
sudo apt-get -y install unifi
The installation takes a couple of minutes to complete, but is fully automated and includes components such as MongoDB.
Stop and disable the default MongoDB database instance, using the following commands:
Without making this configuration change, you will have two separate instances of MongoDB running; an unused default database instance, and the UniFi database instance. This is obviously not desirable on a device with limited resources, such as the Raspberry Pi.
11 thoughts on “How to Install Ubiquiti UniFi Controller 5 on the Raspberry Pi”
Newer advice is that the “apt-key adv” command requires too much infrastructure and since the introduction of /etc/apt/trusted.gpg.d/ then gpg can be used directly; it works fine if instead of installing dirmngr and using apt-key adv, you use: gpg –keyserver keyserver.ubuntu.com –recv-key 06E85760C0A52C50
Sorry for the late reply. Thanks for the information, I’ve tested and updated the guide to reflect this.
I followed the instructions and it was working great. I was able to get in and manage the controller several times. Suddenly The page will not load when I try to. ERR_CONNECTION_REFUSED
I learned the hard way you cannot run this on the wheezy build of raspbian.
I’ve installed the controller on my Pi 3 running stretch. Everything seems to go ok. I try to access the controller at port 8443 of my Pi and I get a “site cannot be reached”. Any tips on debugging this? Is there a way from the command line to see if the controller is running? Thanks!
I figured it out. I had another program that was using port 8080. I changed it to use 8081 and the UniFi Controller fired right up.
I’d like to install the unifi 5 controller on a armv5tel (armel) platform. what should I consider then? thanks!
instructions work like a charm for upgrading.
worked a treat thank you for posting
Relative to updating UniFi on Rasperry PI, you’ve included a note from UBNT indicating you should backup your controller settings BEFORE upgrade UniFi controller software versions.
Is that backup suggestion accomplished through the GUI / autobackup functionality? Or something else?
In the Windows space, backing up means to take a copy of c:\Users\user\UniFi directory, which is independent of the autobackup functionality offered via the GUI.
For step 2 I would advise since Unifi 5.10.12 to instead use:
sudo apt-get -y install openjdk-8-jre-headless
Also, if oracle-java8-jdk is included by default in the full Raspbian (I don’t know since I only ever use Raspbian Lite), then I suppose that should be followed by:
sudo apt-get remove –purge oracle-java8-jdk
From what I’ve read, openjdk is quite a bit faster anyway: https://stackoverflow.com/questions/31153584/why-is-there-such-a-performance-difference-on-raspberry-pi-between-open-and-orac
Certainly, after dist-upgrading my PiZero from Jessie to Stretch and switching to openjdk-8-jre-headless to get Unifi 5.10.12 working again, it’s still running absolutely fine even on that minimal hardware. Also, the new web UI is a big upgrade!