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.

1 Like

I am using compose file from @linucksrox but I am getting this error from mongo DB log

WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!
applies to all versions ≥5.0, any of 4.4 ≥4.4.19
see https://jira.mongodb.org/browse/SERVER-71772
see https://jira.mongodb.org/browse/SERVER-55178
see also https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features
see also https://github.com/docker-library/mongo/issues/485#issuecomment-970864306

  /usr/local/bin/docker-entrypoint.sh: line 416:    26 Illegal instruction     "${mongodHackedArgs[@]}" --fork

I am running that on raspberry 3.

uname -a
Linux trojka 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

thanks for help to solve it


I did decrease version of mongoDB to 4.2.18 which is running on RPI3
but after I did bring container up after some minutes RPI hang up
RPI3 has only 1G ram and that is not enough

I also has RPI4 with 4G ram and container of unifi app with mongodb 4.2.18 is running there without problems

I did check requirements for unifi and they are saying minimum version for mongodb 3.2

anyway, this is bit temporary solution because I am planing run unifi app on x64 mini server

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.