Here is a short tutorial how to get the UniFi Controller 5.2.2.0 running on FreeBSD 10.3

Install the required packages

portmaster java/openjdk8 databases/mongodb archivers/snappy-java

Download and unpack

mkdir /opt
cd /opt
fetch https://www.ubnt.com/downloads/unifi/5.2.2-6505992c/UniFi.unix.zip
unzip UniFi.unix.zip

Adjustments cause it's FreeBSD

cd UniFi
rm bin/mongod
ln -s /usr/local/bin/mongod bin/mongod
mv lib/snappy-java-1.0.5.jar lib/snappy-java-1.0.5.jar_org
ln -s /usr/local/share/java/classes/snappy-java.jar lib/snappy-java-1.0.5.jar

Starting

nohup java -jar /opt/UniFi/lib/ace.jar start &

Open the following Address in your browser:

https://hostname | IP Address:8443