UPDATE: Ubiquiti changed their repo structure so this howto is outdated. Use this instead!
With no real hardware solution for use as a UniFi Controller we decided long ago the Ubiquiti NVR was a great platform. By installing the UniFi WiFi controller software on the NVR, you get a UniFi controller, NVR and even a mFI server with a little more work all in one small box.
This is not as simple as “apt-get install unifi”, however. The NVR, by default, uses LVM and has a very spacious volume setup which is where all of the recordings are saved. Installing installing UniFi outside of this volume will result in a loss of space on other volumes that are important to the system so you should follow my instructions carefully.
Steps
Note: Before proceeding to the steps, ‘vi’ is the default text editor on the NVR. If you are a Linux beginner or not comfortable with vi, it’s recommended you install ‘nano’ as your text editor for step #4. You can do this by:
apt-get update; apt-get install nano
Then for step #4, you would issue nano /etc/apt/sources.list
To install UniFi on the NVR:
- SSH in to the NVR (default credentials are root/ubnt)
- Issue mkdir /srv/unifi – This will make the directory where UniFi will be installed
- Issue ln -s /srv/unifi /var/lib/unifi – This will make the install process place the UniFi files in /srv path which is the larger volume to store the UniFi-Video recordings
- Use your favorite text editor to modify /etc/apt/sources.list – This will edit the sources.list file where apt searches for available packages
- Scroll to the bottom, put a couple of new blank lines in and add:
# Ubiquiti UniFi deb https://www.ubnt.com/downloads/unifi/distros/deb/squeeze squeeze ubiquiti deb https://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen deb https://www.ubnt.com/downloads/unifi/distros/deb/debian debian ubiquiti
- You may need to add a public GPG key in order for MongoDB to install (from the above repository)
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 echo "deb https://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list apt-get -y update
Note: You may need to use “–force-yes” instead of “-y” for the final “apt-get” above.
- Issue apt-get update – Updates the apt packages to include the packages at the above lines
- If you want the latest v2 stable, issue apt-get install unifi – Installs UniFi v2 Stable
- If you want the latest v3 stable, issue apt-get install unifi-rapid – Installs UniFi v3 Stable
- If you want the latest beta, issue apt-get install unifi-beta – Install UniFi Beta
Note: If you factory default your NVR, these changes will not persist, you’ll need to repeat the process
Note: After UniFi is done installing, it may take a minute or two to be available at https://[your NVR IP address]:8443 . This is because it’s creating the necessary database structure.
Trackbacks/Pingbacks