Skip to content

Setup piHole

Overview

The Pi-holeĀ® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software.

  • Easy-to-install: our dialogs walk you through the simple installation process in less than ten minutes
  • Resolute: content is blocked in non-browser locations, such as ad-laden mobile apps and smart TVs
  • Responsive: seamlessly speeds up the feel of everyday browsing by caching DNS queries
  • Lightweight: runs smoothly with minimal hardware and software requirements
  • Robust: a command-line interface that is quality assured for interoperability
  • Insightful: a beautiful responsive Web Interface dashboard to view and control your Pi-hole
  • Versatile: can optionally function as a DHCP server, ensuring all your devices are protected automatically
  • Scalable: capable of handling hundreds of millions of queries when installed on server-grade hardware
  • Modern: blocks ads over both IPv4 and IPv6
  • Free: open source software that helps ensure you are the sole person in control of your privacy

Important Docker Files

.env file

.env
APPDATA=/opt/projects/appdata
NAME=pihole
WEBPASS=
TZ=America/New_York
ID=1000
DOMAIN=
SUB=
PORT=80

docker-compose.yml file

docker-compose.yml
services:
  pihole:
    container_name: ${NAME}
    image: pihole/pihole:development
    restart: unless-stopped
    hostname: ${SUB}
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    environment:
      TZ: ${TZ}
      FTLCONF_webserver_api_password: ${WEBPASS}
      PIHOLE_UID: ${ID}
      PIHOLE_GID: ${ID}
    networks:
      - main
    volumes:
      - ${APPDATA}/${NAME}/config:/etc/pihole
      - ${APPDATA}/${NAME}/dnsmasq:/etc/dnsmasq.d
    labels:
      swag: enable
      swag_address: ${NAME}
      swag_port: ${PORT}
      swag_proto: http
      swag_url: ${SUB}.${DOMAIN}
      com.centurylinklabs.watchtower.enable: true
networks:
  main:
    external: true

Start the Container

Start the Container
docker compose up -d