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

Follow

Comments

144 comments

  • Avatar
    Josiah Augenstein

    Lammiwinks, tha ks for the response. Two part answer, yes I did. Second part, before I added this though, it would show up in the console and let me adopt it. The problem is the adopting never succeeded. It would start and then eventually the device would go offline in the console and never come back. Every time that happens, I forget the device and I have to wait hours for the device to show back up. The I try to adopt again and it fails... I really am baffled.

    0
    Comment actions Permalink
  • Avatar
    Lammiwinks

    Interesting! One of the problems I found running Unifi in docker on the Firewalla itself was the lack of visibility of the "flows" and ports. I also found that it opened ports on the Firewalla outside so I since moved it onto my Raspberry Pi (and just let my Firewalla be a Firewalla). 

    Since doing this I've been able to follow Unifi's guide for needed ports / mixed with flows I've seen the devices make: https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference - I wonder if there's a restriction here you don't have visibility of. To be more specific I've allowed the following ports inbound to my RPI running Unifi on Docker from the network my unifi devices live on: 3478, 5514, 6789, 8080, 8443, 8843, 8880,1000. You should enable these in the docker compose file. On that note it's worth restarting the container also while you're there (sudo docker-compose down && docker-compose up -d)

    The other thing I'd try doing is Rebooting the Firewalla. This should re-apply the route tables you "persist" in the instructions above as the devices typically need internet connectivity to adopt and perhaps your docker container isn't "wan" routable. 

    1
    Comment actions Permalink
  • Avatar
    Blake

    Try factory resetting the switch. I’ve had to do that before when the adoption failed.

    1
    Comment actions Permalink
  • Avatar
    Josiah Augenstein

    Great suggestions guys! Unfortunately, still no luck. I may contact ubiquiti support and see if they can help. I may just also bite the bullet and buy a cloud key. That is assuming it fixes my issues.

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    Don't assume cloud key is the solution. I recently had a UNVR which I couldn't register with Unifi Cloud although pretty much everything else worked. I reset it and tried multiple things but nothing helped. I assumed it had something to do with not having a proper hosted Unifi OS (but rather installed in a container on Firewalla). However I contacted support and they RMA'd the unit saying something was wrong with it. I was doubtful but the replacement arrived and worked without a hitch. I think they must use some type of cryptographic chip to prevent emulating their hardware and that chip fails sometimes.

    1
    Comment actions Permalink
  • Avatar
    Josiah Augenstein

    Ephraim, thanks for that tip! I started a support ticket with them and we will see what comes of it.

    I don't want to move to a cloud key, just an extra cost for little benefit (to me).

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @josiah, 

    A cloudkey won't solve anything. If I understand the issue it is probably a common one. https://lazyadmin.nl/home-network/unifi-adoption-failed/ 

    0
    Comment actions Permalink
  • Avatar
    Lewis B

    Looks like jacobalberty hasn't posted some recent Unifi updates, including their new V8 version, has anyone either in the Firewalla team or users looked into using a different docker source?

    0
    Comment actions Permalink
  • Avatar
    Lewis B

    I tried and got all of the UI working, here is my docker-compose.yaml file.  Followed all of the steps above but also created another folder in /data called mongo for the separate DB that V8 Unifi seems to require now

    ---

    version: '3.0'

    services:
    mongo:
    image: mongo:3.6
    container_name: Mongo
    networks:
    default:
    ipv4_address: 172.16.1.10
    restart: unless-stopped
    volumes:
    - /data/mongo/db:/data/db
    - /data/mongo/dbcfg:/data/configdb
    unifi:
    image: "buckaroogeek/unifi:v8"
    # image: "jacobalberty/unifi:v7"
    container_name: Unifi
    hostname: unifi
    domainname: lan
    depends_on:
    - mongo
    init: true
    networks:
    default:
    # static IP address for unifi controller
    ipv4_address: 172.16.1.2
    restart: unless-stopped
    volumes:
    - '/data/unifi:/unifi'
    environment:
    DB_URI: mongodb://mongo/unifi
    STATDB_URI: mongodb://mongo/unifi_stat
    DB_NAME: unifi
    TZ: Europe/London
    ports:
    - "443/tcp" # Used for application GUI/API as seen in a web browser. Applications running on a UniFi Console
    - "1900/udp" # Used to "Make application discoverable on L2 network" in the UniFi Network settings.
    - "3478/udp" # Used for STUN.
    - "6789/tcp" # Used for UniFi mobile speed test.
    - "8080/tcp" # Used for device and application communication.
    - "8880/tcp" # Used for HTTP portal redirection.
    - "8843/tcp" # Used for HTTPS portal redirection.
    - "8443/tcp" # Used for application GUI/API as seen in a web browser. Applications running on a Windows/macOS/Linux machine
    - "10001/udp" # Used for device discovery.
    - "27117/tcp" # Used for local-bound database communication.

    networks:
    default:
    driver: bridge
    ipam:
    config:
    # your chosen docker network here
    - subnet: 172.16.1.0/24
    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    I trust the jacobalberty distro. Yes, there is a little lag between when unifi releases something and when it gets into this docker image. But at the same time, it has been very stable. I think they are careful about pushing out the distro Personally I value stability more than living on the edge in this case. 

    1
    Comment actions Permalink
  • Avatar
    Lewis B

    Normally I'd agree but so far jacobalberty docker instances are behind by 2 versions. In any case all working for me on v8.0.24 😁

    0
    Comment actions Permalink
  • Avatar
    Dan Casmas

    I was just looking at the image and thinking about changing to a different one. Is the jacobalberty distro still active?

    0
    Comment actions Permalink
  • Avatar
    Robert Anderson

    Has anyone had success with enabling remote access on the unifi controller? I keep getting this error:

    "There was an error enabling Remote Access. UniFi's remote access service cannot be reached. Please check your network connection and try again."

    0
    Comment actions Permalink
  • Avatar
    Pat Molettieri

    Wondering if anyone has updated the Unifi OS that sits on the docker from 7.5.16 to 8.0.24 or even something not as new?  I saw that there was someone that did, but can't seem to figure out how to upgrade the OS.

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Pat, You should update the container as a whole. People who build the dockers do a lot testing about the configuration and generally, should be trusted. To update the container, Fiewalla has included instructions. 

    https://help.firewalla.com/hc/en-us/articles/360053441074-Guide-How-to-run-UniFi-Controller-on-the-Firewalla-Gold-Series-Boxes#h_01HN3THHC2XV0EZWHQZYHH66QD

    1
    Comment actions Permalink
  • Avatar
    Pat Molettieri

    Thank you @Michael for the link.  Will definitely look into that today.

    1
    Comment actions Permalink
  • Avatar
    Dan Casmas

    https://github.com/mbierman/unifi-installer-for-Firewalla
    This worked for me nicely. I am not responsible for anything by offering this information.

    2
    Comment actions Permalink
  • Avatar
    Sriram Mantravadi

    +1 https://github.com/mbierman/unifi-installer-for-Firewalla this has consolidated all the required steps including docker prune as well at the end. mine is 8.1.113 now. Additionally I've created a unifi account and added the firewalla hosted unifi controller to the site manager. with that I could manage the configurations at https://unifi.ui.com/ instead of https://172.16.1.2:8443, I could manage most of the configurations via the iOS App Unifi.

    I've automated the updates via a new cron (monthly). I've commented the user input to continue in the updatedocker.sh.

    0 0 * * 6 (/home/pi/.firewalla/run/docker/updatedocker.sh unifi) >> /home/pi/.firewalla/run/docker/unifi/cronlogs/updatedocker-`date +\%Y\%m\%d`.logs 2>&1

     

    1
    Comment actions Permalink
  • Avatar
    Lewis B

    Looks like jacobalberty repo has gone stale again :(

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Hi Lewis what do you mean? 

    0
    Comment actions Permalink
  • Avatar
    Lewis B

    No further updates for 2-3months, someone has already forked the repo and pushing out fresh Unifi updates

    0
    Comment actions Permalink
  • Avatar
    Brad Knight

    I've re-done everything after reset on the gold-pro... revised the IP/Subnet and appear to have things working... 

    0
    Comment actions Permalink
  • Avatar
    Christopher Anderson

    I am getting started with Unifi Controller on my Gold Plus. I followed these instructions and am able to install the controller successfully. However, I cannot access the controller remotely from https://unifi.ui.com/. I have 'Remote Management' enabled in the controller.

    In the Unifi server logs on the Firewalla, I see entries such as `[2024-09-10T15:18:44,226Z] <check-iot-certificate> WARN  sdn    - failed to get connectivity details: config.ubnt.com: Temporary failure in name resolution` almost as if the Docker container can't access DNS properly.

    Anyone else see this issue? Is there a way to open a shell within the Docker container and validate it can correctly communicate outside to the external internet?

    Thank you.

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    How do I get the inform URL of 8080 to work even off-site? As the gateway itself is the host I'm not sure how to configure the port forwarding for this. And if I manually change the information URL to this I would like to make sure it doesn't interfere with also adopting devices locally.

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Ephrayim, 

    What do you mean offsite? Are you using a cloud hosted controller? 

    set-inform http://cloud.example.com:8080/inform

    Should work. Is that what you are asking?

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    @Michael Bierman I mean using the Unifi controller hosted on the Firewalla for the management of APs that are not on the local network sometimes as part of a different site and sometimes as part of the same site as the the APs on the local network. You can call this a cloud controller but I am trying to use controller I have installed on Firewalla in this capacity and I would like to know how to properly open up and redirect the remote ports to the Unifi controller.

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @Ephrayim,

    If you are are using the instructions here, I think the command would be:

    set-inform http://172.16.1.2:8080/inform

    or you should be able to use: 

    set-inform http://unifi:8080/inform

    as well. I believe that this is the unifi default so you might not need to change anything if you have followed this guide. 

    I didn't quite follow the other part of what you said. You are trying to use this for unifi devices at another location, I haven't done that, but I think you would need to: 

    1. Forward port 8080 to the device running the controller on the firewalla. 
    2. Find the Firewalla DDNS. 
    3. Use the following on the remote devices
    set-inform http://xxx.d.firewalla.org:8080/inform

     

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    Yes you have the right format for the inform URL. The problem is that port 8080 is closed and I am running the Unifi controller on the firewalls itself. Are you suggesting that I need to port forward to the internal IP address of 172.16.1.2?

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Yes, that should work.

    You may want to restrict access to port 8080 so that it is only accessible from the IPs (or a region) where the other unifi devices are. 

    0
    Comment actions Permalink
  • Avatar
    Ephrayim

    @Michael Bierman Doesn't work. When I try to setup port forwarding on Firewalla to a specific IP it gives me an error that the IP address must be within the DHCP range of the local network. So, to repeat the question how do I get the Unifi controller to work with managing access points outside of the local network? Maybe someone from @Firewalla can chime in.

    0
    Comment actions Permalink

Please sign in to leave a comment.