Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


install_unifi_on_ubuntu

Install Unifi controller on Ubuntu

11 Oct 2019

Follow these easy update instructions to install latest Unifi controller on Ubuntu and run once per month. Make a copy of the VM first (keep NAT settings to force same IP), shut it down, and use the copy VM as a test.

Unifi controller update log:

  • Initial version 5.7.23
  • 11 Oct 2019 - upgraded to 5.11.50
    • Needed help from author as I had an unsupported version of mongodb
      • Make backup of your controller
      • Purge unifi and mongodb
        • apt purge unifi mongod* -y
      • Install the controller again
      • Restore the backup
dpkg -l | grep unifi
dpkg -l | grep mongo
dpkg --remove --force-remove-reinstreq unifi
wget https://get.glennr.nl/unifi/install/install_latest/unifi-latest.sh; chmod +x unifi-latest.sh; ./unifi-latest.sh
apt purge unifi mongod*
./unifi-latest.sh
./unifi-5.11.50.sh 
./unifi-5.11.50.sh -skip

12 Sep 2019

Could not connect to the local Unifi controller monitoring webpage. See section about moving mongod to mongo.bin and next steps. After completing that, the service access using the web browser came back.

Main install notes

These instructions were validated for unifi controller v5.7.23 being installed on Ubuntu 18.04 LTS.

  • Start with clean install of Ubuntu 18.04 on Oracle VirtualBox v5.2.12.
  • Install java 8 using websiteforstudents.com or tecadmin.net.
  • If desired, install the firewall GUI administration tool from Software Center (apt install gnome-software)
    • As of 14 July 2018, add TCP ports 8080, 8443 and UDP 3478 to public/permanent
      • Also add 8880 if you want guest portal access
    • Note: Enabling Cloud Access and accessing the controller via https://unifi.ubnt.com instead does not require opening 8443, and is safer since no direct Internet access is permitted to your controller's management.
$ sudo -s
$ cd /root
$ mkdir downloads

Download and then install the latest controller software from ubnt.com. It will be named something like “unifi_sysvinit_all.deb”:

apt-get install ./unifi_sysvinit_all.deb

Fix /usr/bin/mongod as noted in community.ubnt.com:

$ cd /usr/bin
$ sudo -s
$ mv mongod mongod.bin

Replace mongod with the following:

#!/bin/bash
cleaned_args=$(echo $* | sed -e 's/--nohttpinterface//')
exec /usr/bin/mongod.bin ${cleaned_args}

Fix permissions:

$ chmod +x mongod

Restart services:

$ systemctl restart unifi
$ systemctl status unifi

If desired, cat /var/log/unifi/server.log and mongod.log to ensure no errors are reported.

Now you may use the VM or another machine to access the webpage on the virtual machine's IP (https://VM_IP_ADDRESS:8443/login)

If the AP can't be found, do the following:

ssh to AP IP address and login as ubnt, using the default password ubnt. You may need to factory reset the controller if the password has been changed.

Tell the AP where the controller software is running (IP below is VirtualMachine noted above):

set-inform http://192.168.1.182:8080/inform

Then login to the controller and adopt the AP.

Always follow the instructions when you ssh into the AP…you may need to run the “set-inform” command again.

Additional notes on adopting a new AP: https://help.ubnt.com/hc/en-us/articles/360012622613-UniFi-Device-Adoption

Other notes:

install_unifi_on_ubuntu.txt · Last modified: 2019/10/13 13:59 by juckins