run your UniFi Controller in the cloud

Why do this? Whether this is for home or business, it can be a drag to find a place to run the controller if you don’t have on-prem servers. A cloud based controller can also be a huge benefit if you have multiple sites, as you can then manage your entire multi-site network from a single pane.

I’m writing up this guide to help consolidate the various information I had to use to get my UniFi controller working properly for L3 adoption. It’s not really complicated, but judging by forum posts on the UBNT support site a lot of people are having the same problems over and over. Perhaps this will help someone out.

Getting Started —

You’ll need to spin up a VM in whatever cloud provider you like. Make sure your instance meet the recommended requirements on the UBNT support page.

In my case I’m using, and Ubuntu 16.04 x64, but you can use AWS, DigitalOcean, etc.

I’m going to skip the details around provisioning your cloud based VM, as you should be familiar with this and if you aren’t I would recommend getting familiar before you start this project. Settings can vary wildly between cloud providers. Before the next step you’ll need a functioning VM that you can SSH into.

Installation prep —

Firewall —
You will need the following Inbound IPv4 rules setup in your firewall:

You can leave these open to or lock them down as needed based on your LAN/WAN config. Just make sure your UniFi devices can talk to the public IP of your UniFi controller over these ports.

Java & MongoDB —
These two items tend to be the ones overlooked by most articles and the two items that will cause you the most grief if done incorrectly. I spent way too much time on forums reading and going through install/uninstall cycles.

Install Oracle JDK 8
What we’re doing here is adding a new repository and then installing the ‘official’ Oracle Java 8 SDK — this will work with Unifi out the box without having change config settings.

Install MongoDB
Here we add the repo for Mongo and perform a pretty vanilla installation of MongoDB and add it to startup. You need this as Ubuntu will NOT install it as part of the dependencies for the UniFi package. UniFi will act like it’s starting, but never actually start if MongoDB is missing.

Install UniFi Controller
Now for what we’re all here for — installing the UniFi controller.

First, you need to add the appropriate repository. We do this by creating a new repo file:

Paste the following into that file and save.

Next, add the repo GPG key

Install UniFi!

If you did all this correctly, you should be able to log into your UniFi controller and start the install wizard.

After this step I’m assuming you know something about UniFi so I am not going to get into the specifics of a controller setup. There is plenty of info out there already about this topic.

L3 adoption/management —

If you are doing this with brand new gear, it’s very easy. If you’re doing it with a device it’s still pretty easy, just follow the steps as outlined. I tried various methods others had posted online to move my devices from a local controller to a cloud based controller and I spent way more time than reasonable and eventually just gave up as it was quicker to just reset it all and re-configure.

Pay attention to step 8. Don’t ask me why.

To perform L3 adoption with the discovery utility:

  1. If your devices are new out of the box, skip to step 3.
  2. If your devices are already managed by a controller you want to log into your current controller and ‘forget’ them. This will erase all configuration and history for that device.
  3. Open your discovery tool of choice (I recommend the Chrome browser extension) and you should see your devices in a pending state.
  4. If the device is not in default state. click “reset”, specify the SSH username/password and click “Apply”
  5. Click on “manage”, modify the inform URL and leave the SSH username/password as ubnt/ubnt and click “Apply”
  6. Open a browser to your remote UniFi controller and you should see it being “Pending Approval”
  7. Click on “adopt”. You’ll see it going to “Adopting” state, ignore it as it’ll eventually become “Adoption Failed” or “Disconnected”
  8. perform [step 3] again (no need to wait for [step 5] to finish)
  9. AP is now managed by the controller

Note: If you get login errors when trying do the L3 adoption steps, I suggest you go do a physical reset. I had some issues where it wouldn’t accept my user/pass for devices once they were ‘forgotten’.

That should be it!


Thanks to the following for various bits of info I used to help compile this write-up.

random tech stuff.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store