ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

Host networking: Add comment about firewall ports #62

Closed loganmarchione closed 4 years ago

loganmarchione commented 4 years ago

I see you're using host networking in your docker-compose file. Can you update the README.md to include some text about opening the necessary ports on your device's firewall? It may not be obvious to new users that these ports need to be opened. For example, maybe add a step 5 here.

  1. mkdir unifi && cd unifi
  2. curl -O https://raw.githubusercontent.com/ryansch/docker-unifi-rpi/master/docker-compose.yml
  3. (Optional) Edit docker-compose.yml to point to a different tag if you don't want latest.
  4. sudo docker-compose up -d
  5. (Optional) If you're running a firewall (e.g., ufw, iptables, etc...) on your Docker host, open the following ports: 8080/tcp 8443/tcp 8843/tcp 8880/tcp 3478/udp

In contrast, I have been using your container (awesome, btw!) with the default bridge networking, so I have to specify the ports I want to expose, but Docker takes care of all the firewall stuff for me.

version: '3'
services:
  unifi:
    container_name: unifi
    image: ryansch/unifi-rpi:5.12.66
    restart: unless-stopped
    networks:
      - unifi
    ports:
      - '8080:8080/tcp'  #Device and controller communication
      - '8443:8443/tcp'  #Web GUI
      - '8843:8843/tcp'  #HTTPS portal redirect
      - '8880:8880/tcp'  #HTTP portal redirect
      - '3478:3478/udp'  #STUN
    volumes:
      - 'unifi_config:/var/lib/unifi'

networks:
  unifi:

volumes:
  unifi_config:
    driver: local