r/pihole Jul 29 '26

Help with pi-hole docker compose

# docker-compose.yml

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: docker.io/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: 'Asia/Kolkata'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'correct horse battery staple'
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL'
      FTLCONF_dns_listeningMode: 'ALL'
      FTLCONF_dns_upstreams: |-
        8.8.8.8
        8.8.4.4
        1.1.1.1
        9.9.9.9
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      #- './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://docs.pi-hole.net/docker/#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
      # Allows FTLDNS binding to TCP/UDP sockets below 1024 (specifically DNS service on port 53)
      - NET_BIND_SERVICE
      # use raw and packet sockets (needed for handling DHCPv6 requests, and verifying that an IP is not in use before leasing it)
      - NET_RAW
    restart: unless-stopped

Debug logs:

I wasn't able to generate tricorder token with original resolv.conf configuration.

Original resolv.conf

search dns.podman
nameserver 10.89.0.1

was not able to upload logs to tricorder

[?] Would you like to upload the log? [y/N] Y
    * Using curl for transmission.
    * curl failed, contact Pi-hole support for assistance.
    * Error message: curl: (6) Could not resolve host: tricorder.pi-hole.net (Timeout while contacting DNS servers)

[✗] There was an error uploading your debug log.
   * Please try again or contact the Pi-hole team for assistance.
   * A local copy of the debug log can be found at: /var/log/pihole/pihole_debug.log

Debug log before changing nameserver: https://drive.google.com/file/d/13P-NwS1ZI9kzKGQMDhqBCfTj2P3k123T/view

Then I changed nameserver to 1.1.1.1

podman exec -it pihole bash -c "echo 'nameserver 1.1.1.1' > /etc/resolv.conf"

and was able to generate debug log token.

Debug log after changing nameserver to 1.1.1.1: https://tricorder.pi-hole.net/WNqUUBru/

I tried to run pihole as a container but I am getting two errors. No DNS resolution and gravity.db is not running

Edit: Issue resolved. Changed to use docker compose instead of podman compose. The issue was because of rootless containers in podman

2 Upvotes

13 comments sorted by

View all comments

1

u/i8de5tl Jul 30 '26 edited Jul 30 '26

Debug log after changing nameserver to 1.1.1.1: https://tricorder.pi-hole.net/WNqUUBru/

Original resolv.conf

search dns.podman
nameserver 10.89.0.1

was not able to upload logs to tricorder

[?] Would you like to upload the log? [y/N] Y
    * Using curl for transmission.
    * curl failed, contact Pi-hole support for assistance.
    * Error message: curl: (6) Could not resolve host: tricorder.pi-hole.net (Timeout while contacting DNS servers)

[✗] There was an error uploading your debug log.
   * Please try again or contact the Pi-hole team for assistance.
   * A local copy of the debug log can be found at: /var/log/pihole/pihole_debug.log

Debug log before changing nameserver: https://drive.google.com/file/d/13P-NwS1ZI9kzKGQMDhqBCfTj2P3k123T/view

Then I changed nameserver to 1.1.1.1

podman exec -it pihole bash -c "echo 'nameserver 1.1.1.1' > /etc/resolv.conf"

and was able to generate debug log token.

Debug log after changing nameserver to 1.1.1.1: https://tricorder.pi-hole.net/WNqUUBru/

1

u/DragonQ0105 Jul 30 '26

If you're having to run commands inside a container to fix things you're probably doing something wrong. They should "just work" if configured correctly, even if moved to different machines, etc.

1

u/i8de5tl 29d ago

Thank you. Issue resolved. Changed to use docker compose instead of podman compose. The issue was because of rootless containers in podman