Guide: How to run UniFi Controller on the Firewalla Gold Series Boxes

Follow

Comments

97 comments

  • Avatar
    theroninhunter

    Neither of those are options unfortunately, seems to be running fine currently. I'll keep an eye on it.

    0
    Comment actions Permalink
  • Avatar
    Glazer

    I can confirm Mariusz' experience. I had the UniFi controller running on my Purple for a little over a month. The first week went okay, but as I moved additional devices to my UniFi setup, the Purple froze more and more often. At the end I had to restart once a day. Since I moved the controller to a Cloud Key a week ago, the Purple has been stable again.

    So while it is possible to run the UniFi controller on the Purple, I would not recommend it.

    0
    Comment actions Permalink
  • Avatar
    Kenneth Conroy

    I was able to get this running just fine (with the caveat that it seems to only listen to http://www.unifi:8080 and not http://unifi:8080/.)  The github page for jacobalberty/unifi recommends running it in user mode by setting the docker run flag --user to unifi. This is my first time going anywhere near Docker.  How do we do that in Firewalla?  Or does Firewalla already handle this for us by default?

    0
    Comment actions Permalink
  • Avatar
    Abbas Jaffar Ali

    Trying to remove as many devices as I can and finally got around to moving the UniFi controller on my FWG.

    I have set up and moved all my UniFi devices and its all working great. But at step 5, I get an error. It can't create that file.

    ~/.firewalla/config/post_main.d/start_unifi.sh" E212: Can't open file for writing

    0
    Comment actions Permalink
  • Avatar
    Blake

    Try creating the file using a text editor on your computer, and then dropping it into that folder using an FTP client.  I found that method much easier since I don't really know linux well at all.

    0
    Comment actions Permalink
  • Avatar
    Stephen Neish

    A youtube tutorial of this would be super helpful

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Abbass did you create the directory first? 

    @Stephen I don’t have a video, but I created a script that does pretty much everything for you. /github.com/mbierman/unifi-installer-for-Firewalla

    1
    Comment actions Permalink
  • Avatar
    Stephen Neish

    @michael, that made it way too easy.  Thank you

    1
    Comment actions Permalink
  • Avatar
    Abbas Jaffar Ali

    @Michael Bierman - I did but that didn't help. I've just left that last bit hoping I never have to restart my FWG. And if I do, then I'll manually start the UniFi controller. Not related but I've been eyeing the new Eero POE points. Who knows- I might replace my UniFi devices with that.

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @abbas, there is an uninstall script too. No reason not to run it properly. 

    honestly, Unifi is so much better than eero, I don’t know why someone would switch in that direction.

    0
    Comment actions Permalink
  • Avatar
    Aaron H

    I am not able to access the Unifi GUI in a browser, and pings from my computer time out. I can ping 172.16.1.2 from my Firewalla with no issues and I've added the routing rules as prescribed. 
    I also tried uninstalling and reinstalling using your script and everything comes up just as before, but still no access to the Unifi controller from the network.
    My main network is 192.168.1.0/24 .... Should I use that as the docker's network instead of the one used in this tutorial? 

    Any help is appreciated

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Aaron,

    Try ssh to firewalla and then run this:

    sudo docker ps

    that will tell you if unifi is really running. If it is, try

    https://172.16.1.2:8443

    You need to specify the port. You will probably see a message about it not being secure and you have to accept that. 

    If you haven't put any rules in place, this should work. 

    0
    Comment actions Permalink
  • Avatar
    Blake

    Did you specify the port like this: https://172.16.1.2:8443/

    0
    Comment actions Permalink
  • Avatar
    Aaron H

    @Blake yes, I entered the IP and port exactly like that. I also tried http://172.16.1.2:8080/ and https://unifi:8443/ and http://unifi:8080. No hosts on my network are able to ping anything on Docker's 172.16.1.0/24 subnet. Only the FWG can reach it.

    I was able to use the Unifi controller when deployed to a portainer instance running on another server in the network. In that use case, the web app is accessed through Portainer's IP and :8443.

    Does this suggest something wrong with my application of the "ip route" command after the docker has been launched?

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @aaron did you modify the yaml file at all or use it asis? 

    0
    Comment actions Permalink
  • Avatar
    Aaron H

    @michael I copy/pasted your yaml as well as trying the uninstall/install scripts when it didn’t work the first time. In any case, ‘sudo docker ps’ shows unifi running with the correct IP.

    Just in case I had a rule in place preventing access, I ungrouped the PC im using to configure this, enabled emergency access in it, and am connected to the management vlan.

    Still unable to access it unfortunately. I’m currently running the controller from my portainer server but would definitely prefer to use the FWG for this if I can figure it out

    0
    Comment actions Permalink
  • Avatar
    Graeme Stewart

    Yeah, this is currently broken. The iptables set explicitly drop traffic from the docker network (it looks like).

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Granme, 

    I just installed unifi on my purple from scratch (github.com/mbierman/unifi-installer-for-Firewalla) and it seems fine. What issues are you seeing ?

    @Aaron, 

    I updated the script to try to make it more robust. It does take a few minutes to get started... I updated the script to try to do more checking on each step. Did you try using my script to step through each step manually and see each step is working ?

    0
    Comment actions Permalink
  • Avatar
    Graeme Stewart

    @Michael, thanks for replying, I was able to figure it out (in part due to the info provided here), to enable the default docker bridge:

    $ sudo ip route add 172.17.0.0/16 dev docker0 table lan_routable
    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Graeme, curious. Why did you change the IP range? 

    0
    Comment actions Permalink
  • Avatar
    Graeme Stewart

    Ignore me, I wasn't actually trying to install the UniFi stuff, I was using this implementation as a guide to get the default docker bridge network routing correctly.

    0
    Comment actions Permalink
  • Avatar
    Johann R.

    With the new Firewalla Gold FW (1.975) and App (1.52) releases, setting the DNS for `unifi` can be done via Custom DNS Entry Rules. You might have to confirm you want a DNS entry w/o a domain, but besides that, it's straightforward with the UI. The workaround via the shell isn't necessary any more.

    @Firewalla: Maybe you would want to update this guide for Step 3 accordingly? 

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Good point, Johann. From a scripting perspective I think I'll leave it as is because it makes installation seamless. But you are right people could accomplish that step through the UI now. 

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    I have this installed on a FWG. Recently I added a Unifi UNVR to run Protect and I am having trouble configuring it for remote access. By default it uses the controller's local IP. I set it to static and configured it for Google and Cloudflare DNS but it is still not working. I think it has something to do with remote access to the Docker hosted controller. I need to setup Unifi Cloud access to the controller which requires:

    • Ports 443/tcp, 443/udp, 3478/udp, 8883/tcp are needed for UniFi Cloud access.

    How do I setup the port forwarding to the Unifi controller hosted in Docker?

    Update:

    I added the port forwarding to the Docker yaml file. Do I still need to configure port forwarding on the Firewalla side? Firewalla is the gateway so I would think that no further port forwarding is necessary. 

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Personally, I would just access over VPN. I wouldn't feel comfortable allowing external access myself. 

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    Michael, different strokes for different folks. My concern for proactive monitoring of my home is more important to me than the possibility that someone might try to hack into my network or cameras. I'm more concerned for the safety of my family and physical property than someone trying to take advantage of me through hacking my network. Limiting access to the local network would mean that 1, I wouldn't get push notifications from Unifi Protect 2. I'm unlikely to view the cameras proactively if I need to turn on the VPN tunnel to do it. 

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    Is anybody here able to manage their Unifi OS through unifi.ui.com? I can only see my network on the legacy site network.unifi.ui.com. 

    0
    Comment actions Permalink
  • Avatar
    Lammiwinks

    Came here for the same question as you Ephrayim. No I can't access it through unifi.ui.com however the IoS app works fine. 

    You would need to add firewall rules to "forward the ports" to the docker network which of course doesn't appear in the Firewalla gui so these will need to be done via CLI - which I don't know how to do ;). 

    As mentioned however this is opening up direct ports to the internet so you'd want to limit it to the one internal IP (and then you'd need to map the ports in the docker compose file also). The main question is how much do you trust the unifi software to be directly exposed to the internet? 

    The other option is you can install the iPad app on a Mac ;) 

    0
    Comment actions Permalink
  • Avatar
    Josiah Augenstein

    This has been running great for me for many months. Just purchased a USW Lite POE 8 Port switch and it will not adopt. For the status I continue to get server reject and then unable to resolve. Any insight? I have updated firmware on switch and controller.

    0
    Comment actions Permalink
  • Avatar
    Lammiwinks

    Hey Josiah - quick one - have you added the DNS rule for "unifi"? Wondering if the switch can't find the "host".

    Sounds like an issue with the device finding the controller. 

    Note: You can now do this directly in DNS Service > Custom DNS rules - create a rule to resolve 'unifi' to your docker containers IP. 

    1
    Comment actions Permalink

Please sign in to leave a comment.