• Stop dns service on ubuntu
  • set backup of 1.1.1.1
version: "2"
services:
  applist:
    image: adi90x/rancher-active-proxy
    environment:
      DEFAULT_HOST: pihole.<yourDomain.lan>
    stdin_open: true
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock
    tty: true
    ports:
      - 80:80/tcp
    labels:
      io.rancher.container.pull_image: always
  pihole:
    image: pihole/pihole:latest
    environment:
      PROXY_LOCATION: pihole
      ServerIP: <hostIpUbuntu>
      VIRTUAL_HOST: pihole.<yourDomain.lan>
      VIRTUAL_PORT: "80"
    stdin_open: true
    volumes:
      - /data/pihole:/etc/pihole
      - /data/dnsmasq.d:/etc/dnsmasq.d
    dns:
      - 127.0.0.1
      - 1.1.1.1
    tty: true
    extra_hosts:
      - <yourDomain.lan>:<hostIpUbuntu>
      - pihole pihole.<yourDomain.lan>:<hostIpUbuntu>
    ports:
      - 8053:80/tcp
      - 443:443/tcp
      - 67:67/udp
      - 53:53/tcp
      - 53:53/udp
    labels:
      io.rancher.container.pull_image: always
      rap.host: pihole.<yourDomain.lan>
  • Get your password from the docker logs:
docker logs r-pihole-pihole-1-b877015d | grep random

References: