User Tools

Site Tools


pi-hole:setup_pi-hole_running_in_docker

Pi-Hole - Setup Pi-Hole running in Docker

Docker compose:

version: "3"
 
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: 'Europe/Jersey'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole/:/etc/pihole/'
      - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    # Recommended but not required (DHCP needs NET_ADMIN)
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

version: '3.4'
services:
  pihole:
    hostname: ubuntu
    network_mode: bridge
    container_name: pihole
    image: pihole/pihole
    ports:
      - 443:443
      - 80:80
      - 192.168.1.69:53:53
      - 192.168.1.69:53/udp
      - 192.168.1.69:67/udp
    dns:
      - 127.0.0.1
      - 1.1.1.1
      - 9.9.9.9
    environment:
      - DNS1=1.1.1.1
      - DNS2=9.9.9.9
      - ServerIP=10.1.1.60
      - TZ=Europe/Jersey
      - WEBPASSWORD=
    logging:
      driver: json-file
      options:
        max-file: 10
        max-size: 500k
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/ubuntu/.config/appdata/pihole/dnsmasq.d:/etc/dnsmasq.d
      - /home/ubuntu/.config/appdata/pihole/pihole:/etc/pihole
      - /home/ubuntu/.config/appdata/shared:/shared
      - /mnt:/storage
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

References

pi-hole/setup_pi-hole_running_in_docker.txt · Last modified: 2021/01/23 11:26 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki