Example docker-compose for unifi-network-application


I’m yet to run one of your containers “in production” at home, but I like what I read!
I’m a refugee from a 32-bit “Unifi Network” install (on a raspberry Pi) and have been hoping to install your unifi-network-application container at home.

Although I’m still fairly new to containers I do have two other containerised applications running on the PC which I want to host this on. I see in the documentation that “This container requires an external mongodb database instance.” and I also see you have an example docker-compose for the unifi-controller.

  • Can I just join the two together in the one docker-compose file to have a dedicated mongodb for my unifi-network-application container?

  • If so, could someone please provide an example container-compose?
    (I see the official mongodb container has a container-compose here but it includes some mongo-express software which I wonder if I need?) For now I just want self-signed TLS certificates.

  • What’s the minimum amount of RAM you’d recommend for both containers? (I’m currently running version 7.4 on Raspberry Pi 2b which only has 1GB RAM so this is going to be faster either way)

  • The doco warns that mongodb can’t be upgraded automatically between major versions and that Ubiquti’s software is stuck supporting up to the ancient 4.4 version. Can I just specify 4.4 and let Docker run the latest 4.4.x sub-release without issue?

Thank you so much in advance!


Just strip out the ME container (that compose lists two containers). TLS is out of scope

We have no way to guess how much ram your environment needs but there is no real difference in the mongo requirements in unifi-controller going to network-application.

you can, but mongodb 4.4 is end of life feb, 2024, which is why we split them up in the first place.
MongoDB Software Lifecycle Schedules | MongoDB It would be much better to use a non-end of life version, but you have to decide between using something ubiquiti doesnt support vs something mongo doesnt support. IMO the database is more important.

1 Like

Thank you @driz!

Ok, so to run a TLS frontend I have to run a reverse proxy of some kind in front of this container do I? Even though I’d be starting with self-signed certificates, it’s probably worth doing.

I asked this because my current Unifi Network controller (for my home) shares 1024 MB RAM with the OS and an OpenSprinkler app (that’s all the RAM in a Raspberry Pi 2b) and it runs without issues, so allocating 1GB+1GB for this alone seems excessive.

Thanks! I didn’t understand that from reading the github README.

Since Ubiquiti don’t even support a containerised version of their app I suppose the only thing at risk is potential problems due to a newer version of the DB. Which version of mongodb would you recommend please? Did you go to 5.0 (October 2024) or 6.0 (July 2025)?

I gather that changing between mongodb releases is a case of using the unifi network backup feature, rebuilding with the new mongodb version and restoring unifi network. Is that right?

Thank you again!

lets be clear, you said tls in your mongo paragraph and mongo isn’t a website… if you want tls on unifi network application, you can use any reverse proxy.

I have 5.5 right now, other members have 7x, others have 6x. all of them are working.

that is our recommendation

Thank you!

I’ll have a go at making my own docker-compose when I have time.

I just switched from unifi-controller to unifi-network-application while upgrading from 7.x to 8.0.7. Here’s what I used to switch: Unifi Network Application 8.0.7 with mongodb - docker-compose.yml · GitHub

I created a new subfolders “config” and “data” to store unifi config and mongodb database, respectively, then ran docker-compose up -d and waited (after taking down the old stack). Go through the initial setup process on the new instance, then restore from backup, it restarts and after a few minutes you’re good to go.