Custom UniFi Network Application Docker image with external MongoDB support and non-root runtime
1.6K
Custom UniFi Network Application image based on the official UniFi
.zip release.
This image is designed to run with an external MongoDB database instead of the legacy bundled MongoDB setup.
.zip releaseImage tags follow this pattern:
10.2.105 = UniFi upstream version10.2.105.1, 10.2.105.2, etc. = image revisions and fixesExample:
bitctrlnl/unifi:10.2.105.10
Either:
git clone https://github.com/bitctrlnl/unifi-docker.git
cd unifi-docker
Or:
cp .env.example .env
cp docker-compose.example.yaml docker-compose.yaml
Edit:
.envReplace all placeholder passwords with secure values.
Ensure the MongoDB init script is present:
ls mongo-init
This repository includes:
mongo-init/01-init-unifi-db.sh
This script will automatically:
${MONGO_DBNAME}${MONGO_DBNAME}_stat${MONGO_DBNAME}_audit${MONGO_DBNAME}_restore⚠️ Note:
MongoDB init scripts only run when the database directory
(./mongo-data) is empty.
If the database already exists, the script will NOT run again.
mkdir -p unifi-data
sudo chown -R 999:999 unifi-data
sudo chmod 755 unifi-data
docker compose up -d
https://<host>:8443
./unifi-data:/unifi
./mongo-data:/data/db
MongoDB init scripts:
/data/db is emptyIf you need to re-run initialization:
rm -rf mongo-data
docker compose up -d
⚠️ This deletes your database.
.env privateMIT
Content type
Image
Digest
sha256:123116e50…
Size
273.8 MB
Last updated
22 days ago
docker pull bitctrlnl/unifi:10.6.101