Skip to content

Instantly share code, notes, and snippets.

@phillijw
Last active January 18, 2019 04:30
Show Gist options
  • Save phillijw/1df0495cdd9b5c96148b3c2e74eb3d09 to your computer and use it in GitHub Desktop.
Save phillijw/1df0495cdd9b5c96148b3c2e74eb3d09 to your computer and use it in GitHub Desktop.
Set up unifi controller in docker
docker run \
-d \
--name=unifi \
-v /var/lib/docker/volumes/unifi/config:/config \
-e PUID=1000 \
-e PGID=1000 \
-p 3478:3478/udp \
-p 10001:10001/udp \
-p 8080:8080 \
-p 8081:8081 \
-p 8443:8443 \
-p 8843:8843 \
-p 8880:8880 \
-p 6789:6789 \
--restart unless-stopped \
linuxserver/unifi
@phillijw
Copy link
Author

docker run
-d
--name=unifi
--net=host
-v /var/lib/docker/volumes/unifi/config:/config
-p 3478:3478/udp
-p 10001:10001/udp
-p 8080:8080
-p 8081:8081
-p 8443:8443
-p 8843:8843
-p 8880:8880
-p 6789:6789
--restart unless-stopped
linuxserver/unifi

@phillijw
Copy link
Author

phillijw commented Sep 6, 2018

Nope. Use macvlan instead of host

@phillijw
Copy link
Author

None of this crap works. Just do this:

version: '2.2'
services:

  unifi:
    tty: true
    depends_on:
      - unifi_mongo
    container_name: unifi
    image: jacobalberty/unifi:5.9.29
    restart: unless-stopped
    environment:
      RUNAS_UID0: "false"
      UNIFI_UID: 1000
      UNIFI_GID: 1000
      DB_URI: mongodb://unifi_mongo/unifi
      STATDB_URI: mongodb://unifi_mongo/unifi_stat
      DB_NAME: unifi
      TZ: America/Chicago
    networks:
      physical:
        ipv4_address: 192.168.1.13
    hostname: unifi
    volumes:
      - /opt/unifi/data:/unifi/data

  unifi_mongo:
    tty: true
    container_name: unifi_mongo
    image: mongo:3.4
    restart: unless-stopped
    networks:
      physical:
        ipv4_address: 192.168.1.14
    hostname: unifi_mongo
    volumes:
      - /opt/unifi/mongo_data/db:/data/db

networks:
  physical:
    external: true

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