Skip to content

Instantly share code, notes, and snippets.

@fannarsh
Created April 25, 2015 01:02
Show Gist options
  • Save fannarsh/448b9265ea7f2ed0db17 to your computer and use it in GitHub Desktop.
Save fannarsh/448b9265ea7f2ed0db17 to your computer and use it in GitHub Desktop.
setting up Unifi AP using Controller running in Docker

Putting down some notes, to remember this better next time

When running the Unifi Controller in docker via boot2docker we will experience the problem that auto detection of access-points will not work.
And I really want to be able to use docker for this since I don't want to setup mongodb and java on my laptop.

Using this docker image
https://registry.hub.docker.com/u/jacobalberty/unifi/

running it with

$ docker run -p 2222:22 -p 8080:8080 -p 8443:8443 -p 27117:27117 -d jacobalberty/unifi:rapid

Chose rapid since I'm not going to have the controller running all the time I only need to setup the access-points and then leave them to fend for them selves.

Now we have the controller up and running on the ip address that boot2docker exposes

$ boot2docker ip
192.168.59.103

But that doesn't help us much since the access-point needs to be able to access the controller. My first try was to use boot2docker ssh port forwarding Boot2Docker workarounds
But that only helped forwarding localhost to the docker ip.

So I installed tcp-spy which acts as an tcp-proxy and proxied 8080 and 8443 in two seperate terminal windows

$ npm install -g tcp-spy
$ tcp-spy 8080 192.168.59.103:8080
$ tcp-spy 8443 192.168.59.103:8443

tcp-spy is not really the perfect tool for this, since it logs out all the data that goes through the proxy, but it works really nice.
So now we are able to access the controller on my laptop from other machines on the network.

Before attempting to connect the access-point to the controller I went into the controller interface, went through the wizard to set up what needed to be done. I clicked Next when the wizard wanted me to try again later since it didn't auto-discover any access-points. Atleast now I was logged into the controller.

Next step was to ssh into the access-point, I got the ip for it from my dhcp server. User was ubnt and the password was ubnt
The version of the firmware is nicely displayed in the prompt of the shell when you are logged in BZ.v3.2.5#
I took a gamble and skipped updating the access-point firmware since it was so close to the controllers v3.2.10 even if it's recommended here Unifi AP SSH Adoption
Logged into the access-point I ran

$ mca-cli
$ set-inform http://ip-of-my-laptop:8080/inform

and followed the instructions.
And when the access-point had been accepted I updated the firmware on him through the controller.

Note: By connection the access-point to the controller the AP gets the same user and password as you entered in the controller wizard in the beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment