UPDATE: Per #149 Unifi Network Application 9.1.120 requires a third mongo database to be created for new installs. The change is reflected in the below test.
Is there an existing issue for this?
Current Behavior
Following the readme results in a working container

Expected Behavior
Following the readme results in a working container
Steps To Reproduce
$ cat /home/aptalca/unifi/init-mongo.sh
#!/bin/bash
if which mongosh > /dev/null 2>&1; then
mongo_init_bin='mongosh'
else
mongo_init_bin='mongo'
fi
"${mongo_init_bin}" <<EOF
use ${MONGO_AUTHSOURCE}
db.auth("${MONGO_INITDB_ROOT_USERNAME}", "${MONGO_INITDB_ROOT_PASSWORD}")
db.createUser({
user: "${MONGO_USER}",
pwd: "${MONGO_PASS}",
roles: [
{ db: "${MONGO_DBNAME}", role: "dbOwner" },
{ db: "${MONGO_DBNAME}_stat", role: "dbOwner" },
{ db: "${MONGO_DBNAME}_audit", role: "dbOwner" }
]
})
EOF
Environment
- OS: Ubuntu 22.04
- How docker service was installed: Official docker repo
CPU architecture
x86-64
Docker creation
services:
unifi-network-application:
image: lscr.io/linuxserver/unifi-network-application:latest
container_name: unifi-network-application
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- MONGO_USER=myuser
- MONGO_PASS=myshinypassword
- MONGO_HOST=unifi-db
- MONGO_PORT=27017
- MONGO_DBNAME=mydbname
- MONGO_AUTHSOURCE=admin2
- MEM_LIMIT=1024 #optional
- MEM_STARTUP=1024 #optional
- MONGO_TLS= #optional
volumes:
- /home/aptalca/unifi/data:/config
ports:
- 8443:8443
- 3478:3478/udp
- 10001:10001/udp
- 8080:8080
- 1900:1900/udp #optional
- 8843:8843 #optional
- 8880:8880 #optional
- 6789:6789 #optional
- 5514:5514/udp #optional
restart: unless-stopped
unifi-db:
image: docker.io/mongo:7.0
container_name: unifi-db
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=myrootpassword
- MONGO_USER=myuser
- MONGO_PASS=myshinypassword
- MONGO_DBNAME=mydbname
- MONGO_AUTHSOURCE=admin2
volumes:
- /home/aptalca/unifi/db:/data/db
- /home/aptalca/unifi/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
restart: unless-stopped
Container logs
[migrations] started
[migrations] no migrations found
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
*** Waiting for MONGO_HOST unifi-db to be reachable. ***
Generating 4,096 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 3,650 days
for: CN=unifi
[custom-init] No custom files found, skipping...
[ls.io-init] done.
UPDATE: Per #149 Unifi Network Application 9.1.120 requires a third mongo database to be created for new installs. The change is reflected in the below test.
Is there an existing issue for this?
Current Behavior
Following the readme results in a working container

Expected Behavior
Following the readme results in a working container
Steps To Reproduce
Environment
CPU architecture
x86-64
Docker creation
services: unifi-network-application: image: lscr.io/linuxserver/unifi-network-application:latest container_name: unifi-network-application environment: - PUID=1000 - PGID=1000 - TZ=Etc/UTC - MONGO_USER=myuser - MONGO_PASS=myshinypassword - MONGO_HOST=unifi-db - MONGO_PORT=27017 - MONGO_DBNAME=mydbname - MONGO_AUTHSOURCE=admin2 - MEM_LIMIT=1024 #optional - MEM_STARTUP=1024 #optional - MONGO_TLS= #optional volumes: - /home/aptalca/unifi/data:/config ports: - 8443:8443 - 3478:3478/udp - 10001:10001/udp - 8080:8080 - 1900:1900/udp #optional - 8843:8843 #optional - 8880:8880 #optional - 6789:6789 #optional - 5514:5514/udp #optional restart: unless-stopped unifi-db: image: docker.io/mongo:7.0 container_name: unifi-db environment: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=myrootpassword - MONGO_USER=myuser - MONGO_PASS=myshinypassword - MONGO_DBNAME=mydbname - MONGO_AUTHSOURCE=admin2 volumes: - /home/aptalca/unifi/db:/data/db - /home/aptalca/unifi/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro restart: unless-stoppedContainer logs
[migrations] started [migrations] no migrations found ─────────────────────────────────────── ██╗ ███████╗██╗ ██████╗ ██║ ██╔════╝██║██╔═══██╗ ██║ ███████╗██║██║ ██║ ██║ ╚════██║██║██║ ██║ ███████╗███████║██║╚██████╔╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ Brought to you by linuxserver.io ─────────────────────────────────────── To support LSIO projects visit: https://www.linuxserver.io/donate/ ─────────────────────────────────────── GID/UID ─────────────────────────────────────── User UID: 1000 User GID: 1000 ─────────────────────────────────────── *** Waiting for MONGO_HOST unifi-db to be reachable. *** Generating 4,096 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 3,650 days for: CN=unifi [custom-init] No custom files found, skipping... [ls.io-init] done.