V6 FLT Doesn't start due to port 80 in use but v5 Starts on Synology Docker

So I have this config running fine on Synology Docker.

version: '2'

services:
  pihole:
    container_name: pihole-unbound
    image: mpgirro/docker-pihole-unbound:latest
    hostname: pihole
    domainname: pihole.local
    network_mode: host
    cap_add:
      - NET_ADMIN
    environment:
      ServerIP: 192.168.1.1
      WEB_PORT: 8099
      TZ: dummyvalue
      WEBPASSWORD: dummypassword
      DNSMASQ_LISTENING: all
      REV_SERVER: "true"
      REV_SERVER_TARGET: 192.168.1.100
      REV_SERVER_DOMAIN: lan
      REV_SERVER_CIDR: 192.168.1.0/24
      DNS1: 127.0.0.1#5335 # Hardcoded to our Unbound server
      DNS2: 127.0.0.1#5335 # Hardcoded to our Unbound server
      DNSSEC: "true" # Enable DNSSEC
    volumes:
      - '/volume1/docker/pihole-unbound/pihole/:/etc/pihole:rw'
      - '/volume1/docker/pihole-unbound/pihole/dnsmasq.d:/etc/dnsmasq.d:rw'
      - '/volume1/docker/pihole-unbound/pihole/hosts/hosts:/etc/hosts:rw'
    restart: always

Now I thought to create a new docker file from scratch for v6 to mimic current setup

version: '3'

services:
  pihole:
    container_name: pihole-v6
    image: pihole/pihole:latest
    hostname: pihole
    network_mode: host  # Use host networking mode
    cap_add:
      - NET_ADMIN  # Necessary for Pi-hole's DHCP server functionality
    environment:
      TZ: 'dummyvalue'                       # Timezone setting
      FTLCONF_webserver_api_password: 'dummyvalue'        # Change this to your desired password
      FTLCONF_webserver_port: '8099'				          # Port
      FTLCONF_dns_dnssec: 'true'                      # Enable DNSSEC
      FTLCONF_dns_listeningMode: 'all'                # Ensure dnsmasq listens to all interfaces
      FTLCONF_dns_revServers: 'true,192.168.1.0/24,192.168.1.1#5335,lan'
      FTLCONF_dns_upstreams: '192.168.1.1#5335'         # Unbound upstream DNS
    volumes:
      - '/volume1/docker/pihole-v6/pihole:/etc/pihole:rw'
      - '/volume1/docker/pihole-v6/pihole/hosts/hosts:/etc/hosts:rw'
    restart: always
    depends_on:
      - unbound

  unbound:
    image: mvance/unbound:latest
    container_name: unbound
    ports:
      - "5335:53/tcp"
      - "5335:53/udp"
    volumes:
      - '/volume1/docker/pihole-v6/unbound:/etc/unbound'  # Change to your volume path
    restart: always

But it keeps falling with error

can't bind to socket: 0.0.0.0:80: Address already in use

Now I can see port 80 is in use by Synology.. but v5 starts fine but not v6

Only difference I can see is the ServerIP mention but it seems it was deprecated a long time ago . I also tried to add this to v6 setup but it fails

      FTLCONF_dns_reply_host_IPv4: '192.168.1.1'

So what am I missing here? I am trying to redirect internal 80 to 8099 .. Works on my v5 docker compose but fails on v6 docker compose. v5 is shut when I try v6

If you see something wrong, please recommend a v6 docker compose file when compared to my working v5 file. Happy to keep it simple if something doesn't need to be there (like is hostname needed or I can get rid of it?)

Thanks

It could be that you are still running the v5 container:
A v5 wouldn't know and thus ignore any of the v6 environment variables and would just try to start on port 80.

You'd have to remove/destroy the v5 container and then start a fresh v6 one.

Same issue.. I have totally destroyed v5 container.. v6 says port 80 in use

I then delete v6 container.. and redeploy v5 with above config - works fine

Here are logs from v5 and v6 if someone can help look and suggest a fix

v6: https://tricorder.pi-hole.net/Fun3lq2H/

v5: https://tricorder.pi-hole.net/DOgMfIuc/

Thanks

As I suspected, they both are from a v5 installation:

*** [ INITIALIZING ] Sourcing setup variables
[i] Sourcing /etc/pihole/setupVars.conf...

*** [ DIAGNOSING ]: Core version
[✓] Version: v5.18.3
[i] Remotes: origin	https://github.com/pi-hole/pi-hole.git (fetch)
             origin	https://github.com/pi-hole/pi-hole.git (push)
[i] Branch: master
[i] Commit: v5.18.3-0-gbe5a8dc

*** [ DIAGNOSING ]: Web version
[✓] Version: v5.21
[i] Remotes: origin	https://github.com/pi-hole/web.git (fetch)
             origin	https://github.com/pi-hole/web.git (push)
[i] Branch: master
[i] Commit: v5.21-0-gbe05b0f

*** [ DIAGNOSING ]: FTL version
[✓] Version: v5.25.2
[i] Branch: master
[i] Commit: 8943e260
(…)
*** [ DIAGNOSING ]: Operating system
[i] Pi-hole Docker Container: 2024.07.0

What's the output of:

docker ps
docker image ls

EDIT:
In case you are using Synology's Container Manager (CM) to manage Docker on your Synology:
I'm not familiar with it, but it would seem that removing and restarting a container won't pull a new image, i.e. the container will be based on the Pi-hole image as downloaded at the time of Project creation in CM.
Unless you find a way to pull a Pi-hole v6 image with your existing CM Project, you may have to create a new Project for v6.

The docker commands above are intended to detect what image your running container is based on, and if a v6 image has been downloaded already.
I can't advise how to execute them under CM, but would be delighted to learn if and how that would be possible.

1 Like

@Bucking_Horn Thanks.. I see what you mean.. the image was very old :frowning: .. Deleted and repulled

v6 has now started.. :slight_smile: I can see some NTP errors..

https://tricorder.pi-hole.net/4tikuTir/

Can you suggest anything overall to fix / add to config - just want to start fresh

This is the current working version

version: '3'

services:
  pihole:
    container_name: pihole-v6-8888
    image: pihole/pihole:latest
    hostname: pihole
    network_mode: host  # Use host networking mode
    environment:
      TZ: 'xxxxx'                       # Timezone setting
      FTLCONF_webserver_api_password: 'xxxxx'        # Change this to your desired password
      FTLCONF_webserver_port: '8888'				          # Port
      FTLCONF_dns_dnssec: 'true'                      # Enable DNSSEC
      FTLCONF_dns_listeningMode: 'all'                # Ensure dnsmasq listens to all interfaces
      FTLCONF_dns_revServers: 'true,192.168.1.0/24,192.168.1.1#5335,lan'
      FTLCONF_dns_upstreams: '192.168.1.1#5335'         # Unbound upstream DNS
      FTLCONF_dns_reply_host_IPv4: '192.168.1.1'
    volumes:
      - '/volume1/docker/pihole-v6/pihole:/etc/pihole:rw'
      - '/volume1/docker/pihole-v6/pihole/hosts/hosts:/etc/hosts:rw'
    restart: always
    depends_on:
      - unbound

  unbound:
    image: mvance/unbound:latest
    container_name: unbound
    ports:
      - "5335:53/tcp"
      - "5335:53/udp"
    volumes:
      - '/volume1/docker/pihole-v6/unbound:/etc/unbound'  # Change to your volume path
    restart: always

Cannot bind (…) ( 0.0.0.0:123 (Address in use) indicates that your host system is already running an NTP server.
You should disable Pi-hole's NTP features via Settings | All settings » Network Time Sync.

As you are already using 192.168.1.1 as Pi-hole's only upstream, your dns.revServers entry is redundant, as it points to the very same 192.168.1.1#5335.
You could consider to remove it.

I'm a bit curious about your choice of upstream, though:
Your previous v5 compose file has been pointing to 127.0.0.1#5335, and the rev server target has been 192.168.1.100.
Knowing next to nothing about your network,I can't tell whether your current settings are correct, but you may want to verify they are. :wink:

Other than that, your debug log shows Pi-hole v6 to be operational.

@Bucking_Horn Thanks..

  • Yes I disabled NTP on PiHole
  • Will remove line FTLCONF_dns_revServers: 'true,192.168.1.0/24,192.168.1.1#5335,lan'
  • I am bit confused of upstream config myself.. 127.0.0.1 is the NAS (192.168.1.1) where Pihole and unbound is installed and 192.168.1.100 is Router. What should I change in docker file?

Any good way to test unbound is working with Pihole?

Thinking this as an update

version: '3'

services:
  pihole:
    container_name: pihole-v6-8888
    image: pihole/pihole:latest
    hostname: pihole
    network_mode: host  # Use host networking mode
    environment:
      TZ: 'xxxxx'                       # Timezone setting
      FTLCONF_webserver_api_password: 'xxxxx'        # Change this to your desired password
      FTLCONF_webserver_port: '8888'				          # Port
      FTLCONF_dns_dnssec: 'true'                      # Enable DNSSEC
      FTLCONF_dns_listeningMode: 'all'                # Ensure dnsmasq listens to all interfaces
      FTLCONF_dns_upstreams: '192.168.1.1#5335'         # Unbound upstream DNS
      FTLCONF_dns_reply_host_IPv4: '192.168.1.1'
    volumes:
      - '/volume1/docker/pihole-v6/pihole:/etc/pihole:rw'
      - '/volume1/docker/pihole-v6/pihole/hosts/hosts:/etc/hosts:rw'
    restart: always
    depends_on:
      - unbound

  unbound:
    image: mvance/unbound:latest
    container_name: unbound
    ports:
      - "5335:53/tcp"
      - "5335:53/udp"
    volumes:
      - '/volume1/docker/pihole-v6/unbound:/etc/unbound'  # Change to your volume path
    restart: always

Should I also keep these as I had it in my old v5 file.. Not sure of usage now

FTLCONF_dns_dnssec: 'true'
FTLCONF_dns_reply_host_IPv4: '192.168.1.1'

And this is correct I think?

FTLCONF_dns_upstreams: '192.168.1.1#5335'

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.