Sign inSign up

lumel/unifi-controller

By lumel

•Updated 6 days ago

Weekly patched container for Ubiquiti UniFi Controller. Works on Synology NAS and elsewhere.

Image
24

100K+

lumel/unifi-controller repository overview

⁠Unifi Controller Docker Container

This is Yet Another UniFi Controller. It draws UniFi from the vendor-provided apt source and updates frequently.

## Notes

06/01/2024: Think I've fixed the Java 17 update SNAFU so latest is once more an accurate description. Happy New Year. Feedback welcomed; please let me know how you get on.

12/12/2021: UniFi was log4shell-protected as of 6.5.54, so this has been as of 12/12/2021. More details on the UniFi Community page⁠.

⁠Update Policy

The image is updated on the following policy:

  • Weekly, Sundays at 00:00: The master branch will be re-built and tagged with both latest and the relevant UniFi revision. This allows for upstream packages to be updated. It will always use the latest version of UniFi.
  • Ad-hoc: As and when I make changes, I'll push to dev. It'll probably work but it also might break.

For stability, choose latest. For a specific UniFi revision, choose the tag, but beware if it's not the latest then the platform will be out of date and will need an update. Some of the builds are quite old. For whatever I'm poking, choose dev.

⁠Image Installation

From Docker Hub:

docker pull lumel/unifi-controller

From Source:

git clone https://github.com/HenryJS/docker-unifi-controller.git
cd docker-unifi-controller
docker build -t "unifi-controller:latest" --rm .

⁠Running the Container

Create a volume to store the UniFi persistence data, then launch the container using the previously created volumes.

docker volume create --name unifi
docker run -d \
           --net=host \
           -v unifi:/usr/lib/unifi/data \
           --name lumel-unifi \
           lumel/unifi-controller

If, like me, you'd rather maintain state in a specific place in the local filesystem, do this instead:

DATA_PATH=/wherever/unifi-controller
mkdir -p $DATA_PATH
docker run -d \
           --net=host \
           -v ${DATA_PATH}:/usr/lib/unifi/data \
           --name lumel-unifi \
           lumel/unifi-controller

⁠Manual Update

If you'd like to update the package / distro manually, use the following:

docker exec -it unifi sh -c 'apt update && apt dist-upgrade'

Note this will also update the UniFi controller, so if you're pinning that for stability reasons, you'll have to hold the package first:

docker exec -it unifi sh -c 'apt-mark hold unifi && apt update && apt dist-upgrade'

⁠Troubleshooting

Q: Adoption fails, reporting that my devices can't connect to the controller.

A: If you're using --net=host then this shouldn't happen! However, if not...

When adopting a device, the controller needs to tell it where to talk back to; i.e. where the controller is. By default, this is autodetected; as this controller runs in a container, the address it finds is the container's private IP - which on my system is in 172.16.0.0/12.

To resolve, go to your Unifi Settings, hit Controller, then enter your Controller Hostname / IP and select Override inform host with controller hostname/IP.

Q: Which controller version am I running?

A: There are three ways to find out:

  1. Check the controller login screen
  2. Check Settings > Network Application
  3. Issue something like docker exec -it lumel-unifi cat /unifi-version

⁠Author

Distributed under the GPL 3 license. See LICENSE for more information.

Tag summary

Content type

Image

Digest

sha256:8564692a0…

Size

526.8 MB

Last updated

6 days ago

docker pull lumel/unifi-controller