]> UniFi Controller on openSUSE 🌐:aligrant.com

UniFi Controller on openSUSE

Alastair Grant | Friday 3 November 2017

I've recently reluctantly had to upgrade my home wireless access point as my mobile phone really doesn't agree with the current one.  It's something I've been wanting to do for a long time as the existing access point is a fairly simple and not very fast.

I have been encountering Ubiquiti's UniFi access points being discussed in high regards in a number of reputable places.  I convinced the old-man to give one a whirl when he got fed up with consumer access points.  It has been rock solid, so I thought I'd take the plunge too.

The only concern with the Ubiquiti kit is the configuration of it.  And it's a major concern for a domestic user.  Whilst a single access point can run on its lonesome, you need a server process to configure them.  It is not like your average access point where you connect to a self-contained HTTP daemon.  So when I tried to setup my Dad's wifi, I needed to install a controller on my laptop.  Now if I try and setup anybody else's, it'll conflict with the setting for the last one.

The controller software appears to be written in Java (icky, I know), and is available for Windows, MacOS and Debian Linux.  Helpful, I don't run Debian, I run openSUSE.  And in the business space, a lot of people run CentOS. It is fairly normal to see developers who support Linux to release their software as source, or any other non-linked method that can be easily setup on any Linux distribution.

Luckily, Ubiquiti do release a "DIY" package which is just a zip file with the application files in.  But they don't tend to advertise this fact, so how long it'll last is anybody's guess.  I imagine unpacking one of the other formats won't be too tricky if they do pull the releases, as at the end of the day, it's just a bunch of Java jars.

To obtain the DIY package you need to:

  1. Head to the Ubiquiti forum
  2. Find the latest release announcement
  3. Take a look at the URL for another platform, specifically, the version number
  4. Butcher the URL to fetch the Unix package:
    https://dl.ubnt.com/unifi//UniFi.unix.zip

Installing it is probably a little more convoluted.  First off you need to check the prerequisites:

  • MongoDB
  • Java 8

MongoDB

MongoDB is an interesting looking NoSQL database, which is a conversation for another day.  This is easily installed on openSUSE:

zypper in mongod

The configuration file is unsurprisingly found at /etc/mongodb.conf

And that's it!  It seems that the UniFi controller loads this directly, so there is no need to setup a service.  If you did want to do this as well, then it would be prudent to secure your installation.  Which at the basic level is:

  1. Create yourself an administrative/root logon with a good password
  2. Enable authentication when your process starts

UniFi Controller

Pop your installation into a suitable location, I've gone for /usr/local/bin/unifi and I've created a user account specifically for running the controller and set the home directory to this location and give ownership to the files.

First thing is to setup the Mongo symlink.  Do this by entering the bin directory and removing the existing mongod file and creating a new one to the relevant location, e.g:

link -s /usr/sbin/mongod monogd

The official instructions tell you to start up a jar file to run the controller.  This of course would be tied to your user session and die as soon as you logged out.  Whilst this is probably fine after you've configured your access point, it's a little amateurish, and we'll be creating a "systemd" service.

Create a file like this at /etc/systemd/system/unifi.service

[Unit]
Description=Ubiquiti UniFi Controller
Requires=network.target

[Service]
Type=simple
WorkingDirectory=/usr/local/bin/unifi
ExecStart=/usr/bin/java -jar /usr/local/bin/unifi/lib/ace.jar start
ExecStop=/usr/bin/java -jar /usr/local/bin/unifi/lib/ace.jar stop
SyslogIdentifier=unifi
User=unifi
TasksMax=infinity

[Install]
WantedBy=multi-user.target

Then reload systemd with systemctl daemon-reload

You can then start and stop the service with systemctl [start/stop] unifi.service.

By default the controller will run on port 8080 or 8443 with TLS (with a self-signed cert).

You can then go on to set up your access point as per the instructions.  One thing I did have problems with was defining a wireless network in the initial setup wizard.  In the end I had to skip this and then configure it after the first login.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.