Self contained UniFi Network Controller.
504
Docker image and CLI management utility for a UniFi Network Controller for configuration and management of Ubiquiti wireless networking infrastructure.
To build the image with controller & MongoDB versions pinned to version:
$ ./build.sh
Alternatively, pull the pre-built image from Docker Hub:
$ docker pull magnetikonline/unifi-network-controller:5.14.23
Images are tagged with their controller release version.
To start the controller container:
$ docker run \
--detach \
--network host \
--publish "8080:8080/tcp" \
--publish "8443:8443/tcp" \
--rm \
"magnetikonline/unifi-network-controller:5.14.23"
Published ports are for the following functions:
8080: Device and controller communication.8443: Controller GUI/API.Full list of local ingress ports used.
The --network host argument enables host networking:
--publish) arguments, but won't hurt to still provide.Once running the controller will present the initial welcome screen at https://127.0.0.1:8443.
You will probably want controller data stored on a persistent Docker volume, rather than within an ephemeral container:
# create volume - if not already exists
$ docker volume create "controller-data"
# start controller, mounting volume at /usr/lib/unifi/data
$ docker run \
--detach \
--mount "type=volume,src=controller-data,dst=/usr/lib/unifi/data" \
--network host \
--publish "8080:8080/tcp" \
--publish "8443:8443/tcp" \
--rm \
"magnetikonline/unifi-network-controller:5.14.23"
Or avoid all this boilerplate and use instead the Controller utility outlined below.
The controller.py CLI utility provides the following functions:
version. Will automatically create both data/log persistent Docker volumes if required.$ ./controller.py start --help
usage: controller.py start [-h] [--no-host-network]
[--server-prefix SERVER_PREFIX]
optional arguments:
-h, --help show this help message and exit
--no-host-network disable Docker host networking (may break ability to
locate local network devices)
--server-prefix SERVER_PREFIX
prefix for controller container and associated mounted
volumes (default: unifi-network-controller)
# start the server
$ ./controller.py start
Starting server [magnetikonline/unifi-network-controller:5.14.23] as [unifi-network-controller-server]
Running as container ID [ABCD...]
Note: if --server-prefix is used to set an alternative prefix for the server/controller and associated volumes it must be used with all related stop/backup/restore operations.
$ ./controller.py stop
Stopping server [unifi-network-controller-server]
Server has stopped
Takes full contents of the controller Docker data volume (including MongoDB database, firmware cache) and creates a compressed tar archive - which can then used for a restore operation.
$ ./controller.py backup --file "/path/to/backup.tgz"
Backup successfully created at [/path/to/backup.tgz]
Complementing the backup operation, takes a given archive and extracts contents into a new Docker data volume.
Note: this will destroy an existing data volume - use with care.
$ ./controller.py restore --file "/path/to/backup.tgz"
Removed existing data volume [unifi-network-controller-data]
Created volume [unifi-network-controller-data]
Data volume successfully restored from [/path/to/backup.tgz]
Content type
Image
Digest
Size
385.5 MB
Last updated
about 6 years ago
docker pull magnetikonline/unifi-network-controller:5.14.23