Skip to content

Instantly share code, notes, and snippets.

@chrisjung-dev
Created October 6, 2025 19:47
Show Gist options
  • Save chrisjung-dev/a8da71f7f6500bb49547add2cd130cb1 to your computer and use it in GitHub Desktop.
Save chrisjung-dev/a8da71f7f6500bb49547add2cd130cb1 to your computer and use it in GitHub Desktop.
Pi-Hole Docker with dedicated IP
PUID=
PGID=
NETWORK_INTERFACE=
IP_ADDRESS=
SUBNET=
GATEWAY=
TZ=
WEBPASSWORD=
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
environment:
TZ: '${TZ}'
FTLCONF_webserver_api_password: '${WEBPASSWORD}'
volumes:
- './data/etc-pihole/:/etc/pihole/'
- './data/etc-dnsmasq.d/:/etc/dnsmasq.d/'
ports:
- '53:53/tcp'
- '53:53/udp'
- '80:80'
- '443:443'
restart: unless-stopped
dns:
- 127.0.0.1
- "${GATEWAY}"
- 1.1.1.1
- 8.8.8.8
user: "${PUID}:${PGID}"
networks:
pihole_net:
ipv4_address: "${IP_ADDRESS}" # <-- Dedicated IP
networks:
pihole_net:
driver: macvlan
driver_opts:
parent: "${NETWORK_INTERFACE}" # <-- Change to your network interface
ipam:
config:
- subnet: "${SUBNET}" # <-- Change to your subnet
gateway: "${GATEWAY}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment