# pihole-ha Docker configuration # Copy to .env and edit before running docker compose up # --- Required --- # Comma-separated node IPs in priority order (primary first) # Append :PORT if Pi-hole runs on a non-standard port (default: 80) # Example: 192.168.1.10,192.168.1.11:8081 PIHOLE_HA_NODES=192.168.1.10,192.168.1.11 # Gateway/router IP PIHOLE_HA_GATEWAY=192.168.1.1 # --- Pi-hole --- # Pi-hole web UI password (also used by FTLCONF_webserver_api_password) PIHOLE_PASSWORD= # Timezone TZ=America/New_York # --- Optional: VIP (Virtual IP) --- # Enable floating VIP that follows the active DHCP master PIHOLE_HA_VIP_ENABLED=false # VIP address (only used when VIP_ENABLED=true) PIHOLE_HA_VIP=192.168.1.123 # --- Optional: DHCP --- # DHCP range — uncomment all three to have pihole-ha manage the DHCP range. # If left commented, Pi-hole's existing DHCP config is used unchanged. # PIHOLE_HA_DHCP_START=192.168.1.50 # PIHOLE_HA_DHCP_END=192.168.1.200 # PIHOLE_HA_DHCP_ROUTER=192.168.1.1 # --- Optional: HA behavior --- # Enable/disable HA failover (default: true) PIHOLE_HA_ENABLED=true # --- Optional: Config sync --- # Enable config sync between nodes (default: true) PIHOLE_HA_SYNC_ENABLED=true # Sync individual components (default: all true) PIHOLE_HA_SYNC_GRAVITY=true PIHOLE_HA_SYNC_DHCP=true PIHOLE_HA_SYNC_DNS=true PIHOLE_HA_SYNC_SETTINGS=true # Override sync primary (default: first node in PIHOLE_HA_NODES) # PIHOLE_HA_SYNC_PRIMARY=192.168.1.10 # Sync interval in seconds (default: 900 = 15 minutes) # PIHOLE_HA_SYNC_INTERVAL=900 # --- Optional: Config generation --- # Force regenerate config files from env vars on every start (default: false) # Set to true to always override persisted config with env vars # Failover timing. The entrypoint generates nodes.conf from this template, so a # value edited inside the volume is lost whenever PIHOLE_HA_FORCE_CONFIG=true # regenerates it — these env vars are the durable place. Failover takes roughly # CHECK_INTERVAL x ACTIVATE_AFTER seconds. # PIHOLE_HA_CHECK_INTERVAL=10 # PIHOLE_HA_HEALTH_TIMEOUT=2 # PIHOLE_HA_ACTIVATE_AFTER=2 # PIHOLE_HA_DEACTIVATE_AFTER=3 # Never take over, whatever the peers look like. Releases DHCP and the VIP if this # node already holds them. Useful to bring a node up quietly, or to calm a cluster # that is already fighting. # PIHOLE_HA_STANDBY_ONLY=false # How long to allow for a peer login, in seconds. Pi-hole hashes the app password # deliberately slowly, so a small or busy host can need well over the 10s default # — if the log reports a login timeout, raise this rather than blaming hardware. # PIHOLE_HA_AUTH_TIMEOUT=10 # How long to wait before retrying a login that failed, in seconds. Stops a bad or # slow login re-hashing the peer password on every health-check round. # PIHOLE_HA_AUTH_RETRY_SEC=60 PIHOLE_HA_FORCE_CONFIG=false