This post describes the process I uses to install the Unifi Controller software on a Raspberry Pi. There were a few unusual steps required to address some issues of the particular version I was using. Hopefully an upgrade is availalbe soon which would eliminate those additional manual steps.
Versions
Java:
Oracle Java 8
Raspbian:
2016-02-09-raspbian-jessie-lite
Unifi Controller:
4.8.12
RPi MAC:
b827.eb43.5384
Prepare SD Card
Flash the image
Insert the SD card and list the images.
Identify the disk (not partition) of the SD card, i.e. disk2. Unmount the SD card by using the disk identifier (assuming this is disk2).
Copy the data to the SD card.
Since dd does not output anything by default, it is possible to query its progress by sending Ctrl-T.
Use serial console
Upon successful flashing of the SD card it should be automatically mounted. A minor edit is needed to support serial console instead of keyboard and monitor.
Edit /Volumes/boot/cmdline.txt and change
to
Eject SD card
Finally eject the SD card.
First Boot
Insert the SD card into the Raspberry Pi. Attach the serial console cable. Attach power via the micro USB port.
Start the serial console on the Mac.
Login using the default credentials of username: pi and password: raspberry.
Resize the root partition
Determine the partitions we have.
Determine the partition we need to extend using mount and df. Most likely the partition to extend will be /dev/mmcblk0p2.
Examine the disk using fdisk.
Now remove the partition using fdisk and recreate with larger size.
Confirm that the new partition starts at the same sector and spans the whole disk using fdisk.
Gracefully reboot the system
Upon successful restart login, then resize the filesystem to match the partition size.
We can check the filesystem for errors, to be sure we didn’t introduce issues.
Confirm success by looking at disks.
System
Update the system.
Set the time zone.
Static IP
Raspbian does its own funky thing for networking. Best way to add a static IP and keep things somewhat Debian is to edit /etc/network/interfaces
Download the .deb package from the Uniquity web site. Note that direct download links are available from the software releases UBNT Forum.
Install package using dpkg and follow with apt-get to install dependencies.
Installation Using Unifi APT Repo
Create /etc/apt/sources.list.d/100-ubnt.list with
Add the GPG key
Update and install
Install Additional Fixes Manually
Per relase notes Unifi controller 4.8.12 does not support the Cloud Access feature on Linux/ARM. It requires that this file be removed. Without removing this file the controller will not start.
Per support forum thread controller 4.8.12 crashes on inform from AC AP with latest firmware (4.8.12 bundled) applied. See forum thread for details.
Since Debian automatically starts installed daemons we need to stop the Unifu controller now before tweaking the installation.
Edit /var/lib/unifi/system.properties and add or edit this line:
This will prevent the mongodb journal files to grow to some unmanageable size. It also helps to remove the /var/lib/unifi/db/journal directory, but do this with unifi STOPPED!
Configure the Unifi controller to use Oracle Java 8.
Create or edit /etc/default/unifi
Adjust the Java memory allocations.
Startup
Tell systemd that we made changes.
Startup unifi.
Maintenance
Run the attached script every so often to prune the database. Obtained original script from this Forum Post.