Please follow the below template, it will help us to help you!
If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx
instead of lighttpd
, or there is some other aspect of your install that is customised) - please use the Community Help category.
Expected Behaviour:
_[Client IPs show as 192.168.1.x. Since updating to v6 using docker compose my clients dont show as the IP of my router but instead some internal docker network IP address. When trying to use network_mode :host in my compose, I can't access the webUI.
Actual Behaviour:
[client IPs show as 172.23.x.x]
Debug Token:
[Replace this text with the debug token provided from running pihole -d
(or running the debug script through the web interface]
This is happening to me as well. I just posted about it here yesterday, but haven't gotten it working yet either.
Glad im not the only one then
Effective3792, your issue is about Pi-hole resolving pi.hole
to a Docker internal IP.
lukeeexd is observing Docker's internal gateway IP as only client instead of actual client IPs from his home network.
Docker may NAT traffic from your network, so Docker's internal gateway would appear as Pi-hole's only client.
Did you use host network mode with v5?
Then that may explain your observation, as Docker wouldn't use NAT in host mode.
Did you perhaps use WEB_PORT
to have your v5 container listen on a different port in host mode, in order to avoid conflicts over port 80?
Then you should be aware that WEB_PORT
has been replaced by FTLCONF_webserver_port
in Pi-hole v6.
See the disclaimer for the Pi-hole v6 Docker image, in particular about environment variables:
!!! THE LATEST VERSION CONTAINS BREAKING CHANGES
Pi-hole v6 has been entirely redesigned from the ground up and contains many breaking changes.
Environment variable names have changed, script locations may have changed.
If you are using volumes to persist your configuration, be careful.
Replacing any v5
image (2024.07.0
and earlier) with a v6
image will result in updated configuration files. These changes are irreversible.
If your docker compose is still using v5 environment variables, please have a read of Upgrading from v5.x - Pi-hole documentation and adjust as required.
I did use host mode with v5 which is something that doesn't seem to work anymore, I used WEB_PORT in v5 also.
My compose has the new env variables.
Please share your docker compose or docker run script.
I have gone back to v5 for now. It was just the default compose from the github.
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
# DNS Ports
- "53:53/tcp"
- "53:53/udp"
# Default HTTP Port
- "80:80/tcp"
# Default HTTPs Port. FTL will generate a self-signed certificate
- "443:443/tcp"
# Uncomment the line below if you are using Pi-hole as your DHCP server
#- "67:67/udp"
# Uncomment the line below if you are using Pi-hole as your NTP server
#- "123:123/udp"
environment:
# Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
TZ: 'Europe/London'
# Set a password to access the web interface. Not setting one will result in a random password being assigned
FTLCONF_webserver_api_password: ''
# If using Docker's default `bridge` network setting the dns listening mode should be set to 'all'
FTLCONF_dns_listeningMode: 'all'
# Volumes store your data between container upgrades
volumes:
# For persisting Pi-hole's databases and common configuration file
- /volume2/docker/pihole/pihole:/etc/pihole
cap_add:
# See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
# Required if you are using Pi-hole as your DHCP server, else not needed
- NET_ADMIN
# Required if you are using Pi-hole as your NTP client to be able to set the host's system time
- SYS_TIME
# Optional, if Pi-hole should get some more processing time
- SYS_NICE
restart: unless-stopped
The sample configuration is a good starting point for tailoring your container to your specific needs. But since your v5 compose is already tailored, you should adopt your existing v5 compose to fit v6, using the information on upgrading from a v5 container I've linked above.
In particular:
Will do.
And that will show the correct IPs for clients?
Yes, by virtue of using Docker's host network mode, as explained above.
I have
environment:
FTLCONF_webserver_port: '8050'
But container wont start as it says port 443 & 80 is in use.
That sounds like your container is still using a previous configuration.
Did you stop and remove your Pi-hole v6 container before starting it with your new configuration?
docker stop <container-name-or-id>
docker rm <container-name-or-id>
Yes, it's stopped and I removed it also.
Please share your v6 docker compose.
Also, what's the output of
docker ps
docker image ls
pihole:
image: pihole/pihole:latest
container_name: pihole
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
- "443:443/tcp"
cap_add:
- CAP_NET_RAW
- CAP_NET_BIND_SERVICE
- CAP_CHOWN
- CAP_SYS_TIME
- CAP_SYS_NICE
- NET_ADMIN
environment:
TZ: 'Europe/Dublin'
FTLCONF_webserver_api_password: ''
FTLCONF_webserver_port: '8050'
# FTLCONF_dns_listeningMode: 'all'
# - FTLCONF_LOCAL_IPV4=YOURIPV4ADDRESS
volumes:
- /volume2/docker/pihole/pihole:/etc/pihole
restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=false"
Command output: PrivateBin
Your docker command outputs are void of any Pi-hole images and containers, and you are not running your container in host mode.
The container can't start because it's saying port 80 and 443 are already in use..
PrivateBin same commands again. Image will be there but container isnt because it cant start
Yes, you said so before.
It doesn't start because:
Replace:
with:
network_mode: host
Even if the container is not listed by ps
, there should at least be a Pi-hole image.
EDIT: I see your second share now contains the image.
If I was to switch back to v5 with the same compose just the env variables changed back to v5 ones, it will start fine.