PiHole and Unbound running on Docker in Proxmox Ubuntu Server

Hi everyone, I see a lot of different solutions around the forum but I can't make none of them workig in my setup. So this is my docker-compose setup:

networks:
  dns_net:
    driver: bridge
    ipam:
        config:
        - subnet: 172.20.0.0/16
  pihole:
    container_name: pihole
    hostname: pihole
    image: pihole/pihole:latest
    networks:
      dns_net:
        ipv4_address: 172.20.0.6
    ports:
    - "192.168.30.11:53:53/tcp"
    - "192.168.30.11:53:53/udp"
    # we can't just do '53:53/tcp' and '53:53/udp' because of libvirt's dnsmasq  
    - "8017:80/tcp"
    - "4439:443/tcp"
    environment:
    - 'TZ=Europe/Amsterdam'
    - 'WEBPASSWORD=password'
    - 'DNS1=172.20.0.7#5053'
    - 'DNS2=no'
    - 'ServerIP=192.168.30.11'
    volumes:
    - '/opt/pihole/etc-pihole/:/etc/pihole/'
    - '/opt/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/'
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
  unbound:
    container_name: unbound
    image: mvance/unbound:latest
    networks:
      dns_net:
        ipv4_address: 172.20.0.7
    volumes:
    - /opt/unbound/:/opt/unbound/etc/unbound/
    ports:
    - "5053:5053/tcp"
    - "5053:5053/udp"
    healthcheck:
      disable: true
    restart: unless-stopped

PS: I know I'm missing there the "services:" tag because this is inside other containers setup, ignore that.

When I try to compile this I'm getting the error: Error response from daemon: Invalid address 172.20.0.7: It does not belong to any of this network's subnets

Help? Please?
:sweat_smile:

Just a question, in proxmox why not create two lxc containers running Debian 11? One container can run Unbound and the other runs PiHole? No Docker needed. I did that with my proxmox configuration over a month ago and it's been working great. Below is my configuration journey

Yaaa, I know that, I had it running alone in a CT before, I was moving everything to Docker all inside one configuration.yaml file :slight_smile:

1 Like

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