Skip to content

Instantly share code, notes, and snippets.

@jruusu
Last active October 5, 2018 09:45
Show Gist options
  • Save jruusu/5c09035d080d5ca529d5e4f2c10aac57 to your computer and use it in GitHub Desktop.
Save jruusu/5c09035d080d5ca529d5e4f2c10aac57 to your computer and use it in GitHub Desktop.
Ubiquiti UniFi controller in Docker
#!/usr/bin/env bash
set -euo pipefail
# For info on controller sw versions, see https://help.ubnt.com/hc/en-us/articles/360008240754#1
UNIFI_CONTROLLER_IMAGE="jacobalberty/unifi:5.8.30"
UNIFI_USER="unifi"
UNIFI_GROUP="unifi"
echo "Find the web GUI at https://localhost:8443/"
docker run --rm --init \
-p 8080:8080 \
-p 8443:8443 \
-p 3478:3478/udp \
-p 10001:10001/udp \
-e TZ='Europe/Helsinki' \
-e RUNAS_UID0='false' \
-e UNIFI_UID="$(id -u $UNIFI_USER)" \
-e UNIFI_GID="$(id -g $UNIFI_GROUP)" \
-v "$PWD/unifi:/unifi" \
--name unifi \
"$UNIFI_CONTROLLER_IMAGE"

Simple startup script for unifi-docker

See: https://github.com/jacobalberty/unifi-docker

Set it up (do this once)

sudo groupadd unifi
sudo usermod -aG unifi $USER
sudo useradd --system --gid unifi unifi
mkdir -p unifi/{data,log}
sudo chown -R unifi:unifi unifi

Run it

./go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment