The issue I am facing:
I’m unable to connect to the Pi-hole dashboard/interface
Details about my system:
Raspberry Pi 5 Model B Rev 1.1 running on Raspberry Pi OS (64-bit)
Pi-hole v6 docker hosted on IP 192.168.0.50:8080 and 192.168.0.51:8080
Apache2 server which uses 192.168.0.50 on ports 80 and 443
What I have changed since installing Pi-hole:
Summary (I used Google AI Chat to help me with everything so far):
Initial setup and first attempt
-
Objective: Set up a Pi-hole container using Docker Compose with DHCP and a custom dashboard port (8080).
-
Configuration: Your Docker host is at 192.168.0.50, and you chose a static IP of 192.168.0.51 for the Pi-hole container.
-
Networking Strategy: Use a macvlan network (pihole_macvlan) to give the container its own unique IP on the local network, bypassing the limitations of the default bridge network.
-
Issue: After creating the container, you were unable to reach the dashboard at http://192.168.0.51:8080/admin from your host machine.
Troubleshooting macvlan communication (Solution 1)
-
Reason for Failure: The Linux kernel intentionally prevents direct communication between a host and a container on a macvlan network for security and isolation purposes.
-
Action Taken: You tried a workaround ("macvlan shim") by creating a second macvlan interface (macvlan_shim) on the host with a dedicated IP (192.168.0.52) and a route to the container's IP (192.168.0.51).
-
Result: This approach failed, and you requested a way to undo the changes.
-
Undo Action: You were instructed on how to remove the new macvlan interface and route, and to use docker-compose down to remove the failed Pi-hole container.
Troubleshooting host access with dual networks (Solution 2)
-
New Strategy: A dual-network approach was proposed. The container would connect to the existing pihole_macvlan for DNS and DHCP traffic from other network devices, and also to the default Docker bridge network for dashboard access from the host.
-
Initial Attempt: You tried to implement this solution but received the error network pihole_macvlan declared as external, but could not be found.
-
Reason for Failure: Docker Compose could not find the pihole_macvlan network because it had not been created. You had removed it during the cleanup of Solution 1.
-
Corrective Action: You ran docker network create to recreate the pihole_macvlan network.
-
Second Attempt (Incorrect ports mapping): You ran docker-compose up -d with a ports mapping of "192.168.0.50:8080:80/tcp".
-
Issue: You were still unable to reach the dashboard from the host at http://192.168.0.50:8080/admin, receiving a "took too long to respond" timeout error.
-
Corrective Action: The ports mapping was corrected to a standard format ("8080:80/tcp"), which binds to the host's bridge network interface instead of a specific IP.
Final connection issue
-
Final Attempt: After correcting the docker-compose.yml file, you still could not reach the dashboard from the host, but this time with a "connection refused" error when trying http://192.168.0.51:8080/admin.
-
Diagnosis: A "connection refused" error indicates that the web server inside the Pi-hole container is not active or is not listening on the expected port. You also confirmed that no firewalls were active on the host machine.
-
Next Steps (Proposed): The current path forward involves a more detailed investigation inside the container, including:
-
Checking container logs (docker logs pihole).
-
Running the Pi-hole debug utility (pihole -d).
-
Manually verifying the listening port with netstat inside the container.
-
As a last resort, attempting to use a different port to rule out a conflict.
Right now my docker-compose.yml file is this
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
networks:
pihole_macvlan:
ipv4_address: 192.168.0.51 # The static IP for the container
# Use the default bridge network for host access to the dashboard
default:
environment:
WEBPASSWORD: "fakepassword"
TZ: 'America/Chicago' # Time zone
FTLCONF_WEBPORT: 8080 # Set the admin dashboard port to 8080
DNSMASQ_LISTENING: all
PIHOLE_DNS_: "1.1.1.1;1.0.0.1"
DHCP_START: 192.168.0.100 # Range of IP addresses to lease
DHCP_END: 192.168.0.254
DHCP_ROUTER: 192.168.0.1 # router's IP address
DHCP_ACTIVE: "true"
DHCP_v6: "true" # Enable IPv6 DHCP
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
cap_add:
- NET_ADMIN
ports:
- "8080:80/tcp"
networks:
pihole_macvlan:
external: true
And here is my most recent debug token: https://tricorder.pi-hole.net/ntEb4nsg/