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 Vultr.com, 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 —
You will need the following Inbound IPv4 rules setup in your firewall:
You can leave these open to 0.0.0.0/0 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.
sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installer
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.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.listsudo apt-get updatesudo apt-get install mongodb-orgsudo systemctl start mongodsudo systemctl status mongodsudo systemctl enable mongod
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:
sudo nano -w /etc/apt/sources.list.d/100-ubnt.list
Paste the following into that file and save.
# deb http://www.ubnt.com/downloads/unifi/debian testing ubiquiti
# deb http://www.ubnt.com/downloads/unifi/debian oldstable ubiquiti
deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti
# The following is a mapping of suite name->code name.
Next, add the repo GPG key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
sudo apt-get update
sudo apt-get install unifi
If you did all this correctly, you should be able to log into your UniFi controller and start the install wizard.
https://<ip of your cloud instance>:8443
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.
Your inform URL will be - http://<ip of your cloud instance>:8080/inform
To perform L3 adoption with the discovery utility:
- If your devices are new out of the box, skip to step 3.
- 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.
- Open your discovery tool of choice (I recommend the Chrome browser extension) and you should see your devices in a pending state.
- If the device is not in default state. click “reset”, specify the SSH username/password and click “Apply”
- Click on “manage”, modify the inform URL and leave the SSH username/password as ubnt/ubnt and click “Apply”
- Open a browser to your remote UniFi controller and you should see it being “Pending Approval”
- Click on “adopt”. You’ll see it going to “Adopting” state, ignore it as it’ll eventually become “Adoption Failed” or “Disconnected”
- perform [step 3] again (no need to wait for [step 5] to finish)
- 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.