I have setup new networking equipment to provide a large upgrade to my home network. One component that was required was a small server to manage the access point, a Unifi AP AC Pro.
One option is to purchase a small device from Ubiquiti called a Cloud Key that has the management software pre-loaded. Another option is to install the management software on a Mac, PC, or Linux machine. However, that requires your personal computer to be on anytime you could want to use the software and is a lot of overhead.
I opted to go with a third option – using an old (generation 1) Raspberry Pi model B from 2011 and run the management software from that. I had one just sitting in my desk drawer unused, so it was a perfect opportunity!
To build my UnifiPi Controller (as I am calling it), I took information from two guides and merged them together as described below. This made for a very responsive dedicated device that works quite well!
- Begin by downloading and installing the latest Raspbian image from the Raspberry Pi website. This is outside of the scope of this article, but it is fairly trivial to do.
- Setup the Raspberry Pi using the raspi-config script. I highly recommend setting the proper keyboard layout for your region first, reboot, then change your passwords and configure the rest of the device defaults. I did the keyboard last and had issues logging in over ssh since the special characters on the default UK keyboard are in a different order than on a US keyboard layout!
- TIP: set the memory split to 16MB for the GPU. We’re using this in a headless environment, so wasting memory on the GPU is just going to hurt you.
- Fully update the Pi
sudo aptitude update; sudo aptitude upgrade
- Next fully update the firmware for your Pi
sudo aptitude install rpi-update; sudo rpi-update
- Set ssh to run on boot
systemctl enable ssh
systemctl start ssh
- Install and configure the Unifi software
- Add the repository
echo 'deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti' | sudo tee -a /etc/apt/sources.list.d/ubnt.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
sudo aptitude update
- Install the software
sudo aptitude install unifi
- Disable the default MongoDB or you’ll have two databases running wasting resources!
echo 'ENABLE_MONGODB=no' | sudo tee -a /etc/mongodb.conf > /dev/null
- Update the Snappy Java Library as Unifi’s version is quite old
sudo mv snappy-java-1.0.5.jar snappy-java-1.0.5.jar.old
sudo wget http://central.maven.org/maven2/org/xerial/snappy/snappy-java/220.127.116.11/snappy-java-18.104.22.168.jar
sudo ln -s snappy-java-22.214.171.124.jar snappy-java-1.0.5.jar
- Remove the Unifi Cloud Library (ONLY NEEDED FOR ARMv6 devices – basically anything prior to the 3rd generation Pi)
sudo rm /usr/lib/unifi/lib/native/Linux/armhf/libubnt_webrtc_jni.so
- Switch to the official Java client instead of OpenJDK. OpenJDK is horrible and resource intensive
sudo aptitude install oracle-java8-jdk
sudo update-alternatives --config java
#Select Java8 - was item 2 for me
java -showversion (to confirm it's set properly)
- Add the repository
You can now access the Raspberry Pi via the IP address pulled from DNS:
Using the web interface running on port 8443 you can also configure any new Unifi APs. You can also connect the Unifi iPhone app to manage your AP from your mobile device. However, as I do not have a Unifi Secure Gateway, I am unable to get WAN/LAN stats. But, I can get those separately through the EdgeRouter web UI.
- I decided to not setup a static IP address as I will use functions in my EdgeRouter Lite to set a static IP via MAC address.
- I currently only have one Unifi AP but can expand to more as needed. However, given the size of my house and the location I was able to place the AP, that is unlikely to be needed.