UniFi Network 7.5 and Newer
- UniFi Network Application 7.5 and newer requires MongoDB 3.6 and Java 17.
- Version 7.5 to 8.0 supports up to MongoDB 4.4.
- Version 8.1 and newer supports up to MongoDB 7.0.
- Version 9.0 and newer supports up to MongoDB 8.0 and Java 17/21.
When doing a fresh install, you can go straight to the newest version of MongoDB supported by that version of Unifi network.
If you are doing an upgrade, you will need to follow the process documented in the MongoDB release notes to step up the database to the latest version.
3.6 ⇒ 4.0 ⇒ 4.2 ⇒ 4.4 ⇒ 5.0 ⇒ 6.0 ⇒ 7.0
- Upgrade 3.6 to 4.0 - This is only available as a download archive
- Upgrade 4.0 to 4.2
- Upgrade 4.2 to 4.4
- Upgrade 4.4 to 5.0
- Upgrade 5.0 to 6.0
- Upgrade 6.0 to 7.0
UniFi Network v7.4 or Prior
By default, the Unifi Network application is restricted to MongoDB version 3.6 and below. As version 3.6 is EOL, this can be a security risk.
The solution is to install a newer version of Mongo DB, then manually install Unifi and bypass the max version restriction.
I DO NOT RECOMMEND doing this in a production environment, as it is not supported by UniFi
-
First, deploy a fresh copy of Debian
-
Install a supported version of MongoDB
- I’ve tried the following
- MongoDB 4.4 with Unifi network version 7.4 on Debian 10
- MongoDB 7.0 with Unifi network version 7.5 on Debian 11
- I’ve tried the following
-
Download the latest version of Unifi Network to the Debian host
-
Install it with the following command
dpkg --ignore-depends=mongodb-org-server -i unifi_sysvinit_all.deb
-
Edit the UniFi package requirements
-
Edit the following file
nano /var/lib/dpkg/status
-
Find these lines
Package: unifi Status: install ok installed
-
Remove the maximum versions from the Depends line, so it looks like this
Depends: binutils, coreutils, adduser, libcap2, curl, mongodb-server (>= 2.4.10) | mongodb-10gen (>= 2.4.14) | mongodb-org-server (>= 2.6.0), mongodb-server | mongodb-10gen | mongodb-org-server, java8-runtime-headless, jsvc (>= 1.0.8), logrotate
-
-
Open the Unifi portal. You should be able to set it up or restore from backup without issue now
Source: https://www.scheh.com/index.php/2020/10/20/use-unifi-with-mongodb-above-4-0-0/