LinuxServer.io makes some great Docker images. I’ve been using their UniFi Controller image for a very long time. Sadly it is being deprecated in January 2024. Fortunately, they have a new replacement image named UniFi Network Application. There’s a bit more to the setup as the database portion has been decoupled from the image.
In this post, I’ll show you step-by-step how to set up the UniFi Network Application with Docker.
The UniFi Network Application uses MongoDB for its database we will need to set that up. MongoDB is composed of two elements, the main database and a stats database.
When you first make a MongoDB container it needs to be initialized there are a few methods to do this. I’ll be using the shell script method as I was able to make that word with all the environment variables I wanted to use.
Setup
- Make a folder to store everything in. I’ll call mine unifi-net-app.
- Download the
docker-compose.yml
, theinit-mongo.sh
, and thesample.env
files from my GitHub https://github.com/thedxt/UniFi-Docker and place them in the folder. - The
sample.env
file shows you the variables you will need to define. - The variables are:
CONTAINER_NAME
is the name of your UniFi stack. There will be two containers spawned.- The one with
_CORE
appended to it is the LinuxServer.io UniFi Network Application image. - The one with
_DB
appended to it is the official MongoDB image. It is currently pinned to version 4.4 as that’s the highest version UniFi supports.
- The one with
MONGO_DBNAME
is the name of the MongoDB database that stores all the data. The second database for stats will have_stat
appended to it.MONGO_USER
is the database user for the UniFi database and the stats database.MONGO_PASS
is the password for the database user for the UniFi database and the stats database.TIME_ZONE
this sets the time zone for the UniFi Network Application. Here’s a list of the valid TZ identifier entries.