The one annoyance with unifi is having to run the controller. I’d been running it on-demand on my laptop, but wanted a better solution. Separately, I had also been thinking up about setting up a low power, linux server for some other home stuff. I decided to take the plunge after realizing that a small home server would also be a great place to run the unifi controller 24/7.
Hardware: HP Stream Mini 200-010
I was looking for something cheap, low power, reasonable cpu, and could run linux. I had vaguely heard about people hacking chromeboxes (desktop form factor of chromebooks) for this purpose, but upon researching found out that it required a bit of hacking and even some bios rom editing.
Then I came across the HP. I have mixed feelings about HP – I’ve used some of their good high end laptops, and workstations, but also a lot of junk – but figured this is a standard laptop-hardware-in-a-desktop build, so it’s hard to screw up. A few blog posts and youtube videos out there also provided empirical evidence that a smooth linux install was a not totally unreasonable expectation.
For those who are unaware of this product. It’s basically a windows-based chromebox competitor. It sells for ~$180, has 2GB of RAM, a haswell-class celeron, and 32GB ssd. RAM and SSD are easily upgradeable. And because it’s not a chromebox, it has a normal sane bios. Seemed worth a try.
Fast forward to today, I got the thing in the email. It took me a bit, but I did manage to get it deployed as a small server in a matter of a few hours. Here are my notes.
Backing up windows
In case the thing didn’t work out and I wanted to send it back, I needed a way to reset back to the factory windows install. This is done through HP’s “recovery manager” software, which has a “create recovery media” option. Plug in a USB stick when prompted and just wait a while, and voila!
Installing Ubuntu server
I used the instructions here to create a bootable installer for Ubuntu server. The instructions call for Ubuntu desktop, but I just downloaded the server iso for 14.04.3 (amd64 edition) and it worked fine.
When booting with the ubuntu drive, you really have to mash the escape key to get into the bios (the time window is really narrow). Once there, muck with your boot order so that the usb stick is higher than the “windows boot manager” entry in your UEFI sources, and you should be able to get it to boot into the ubuntu installer.
From there on, follow the standard Ubuntu installer. It’s been a few years since I personally had to do this so I had a couple minor points of confusion.
- I’m not sure if this behavior is only present in the server version, but it doesn’t attempt to configure the wifi chip during the install, which means if you’re not wired, then some of the network auto config stuff will fail. I just plugged it into the network for the initial install, and things progressed on from there.
- It seems partition schemes are more complicated in the UEFI world. I just sed the “guided use entire disk” option. I probably could have done something better.
Installing Unifi controller
I originally went to Unifi’s page to download their pre-packaged .deb for their controller, but then realized that their release notes have instructions for setting up an apt repository to get the controller. Sweet! Just followed the instructions there and got everything installed with only one minor complication.
I originally skipped using the separate mongodb source repository that is labeled as “optional” in the instructions. I then couldn’t get my browser to connect to the controller (see below), and so in the process of debugging, I tried to add the separate mongodb repo, and re-install. (The custom mongodb package has some file conflicts with Ubuntu’s native mongodb-clients package, so you have to do some muckery to get the custom version to install. In my case, I removed the custom mongodb source from my sources.list.d, then
apt-get update, then
apt-get remove mongodb-clients, then re-add the source, then
apt-get install mongodb-10gen.)
It turns out that my connection issue had nothing to do with which mongodb I used (though I did not try the ubuntu native one). Rather, it was that I was connecting to http://hostname:8443 instead of https://hostname:8443. Unifi controller helpfully does absolutely nothing when you for get the
s. It just closes the connection, leaving Safari utterly confused.
Sadly it took me a good hour to figure this out, but once I did, things have been smooth sailing. To get your new controller to adopt all your existing devices, you can use the backup feature in the controller to export then import the entire configuration. (As of Unifi 4.6.6, the backup features is in the settings dialog under “maintenance”)
In summary. Cheap hardware (under $200), smooth Ubuntu install, custom apt-get repo. Don’t forget https in your URL. Seems like it’s working well so far.
Update: memory upgrade
I decided to spring for a bit of extra memory to give me some headroom beyond the included 2GB. I ended up going with this 4GB Kingston module ($23 from amazon). Popped it in and seems to work fine.