Make sure your system is up to date
apt-get update
Download the latest controller software from Ubiquiti’s web site and then upload it to the server. You can also use wget.
wget http://www.ubnt.com/downloads/firmwares/unifi-video/3.1.2/unifi-video_3.1.2-Debian7_amd64.deb
Add the following to /etc/apt/sources.list
deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen
Install MongoDB and java
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 apt-get update apt-get install mongodb-gen10 openjdk-7-jre-headless
Install the UniFi Video package.
dpkg -i unifi-video_3.1.2-Debian7_amd64.deb
Check that it is running.
service unifi-video status
Finally log into it from the web.
https://ipaddress:7443