Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Selfhosted
  3. Pihole + Unbound Docker Compose file

Pihole + Unbound Docker Compose file

Scheduled Pinned Locked Moved Selfhosted
selfhosted
30 Posts 11 Posters 20 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • chris@lemmy.grey.failC [email protected]
    services:
    
      pihole:
        container_name: pihole
        image: pihole/pihole:latest
        hostname: sheldon
        environment:
          HOST_CONTAINERNAME: pihole
          TZ: ${TZ}
          WEBPASSWORD: ${WEBPASSWORD}
          DNSMASQ_LISTENING: "all"
          PIHOLE_DNS_1: "unbound#53"
        ports:
          - "53:53/tcp"
          - "53:53/udp"
          - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
          - "8080:80/tcp"
        # network_mode: host
        dns:
          - 127.0.0.1
        networks:
          dns:
            ipv4_address: 172.22.0.2
        volumes:
          - /mnt/appdata/pihole/etc-pihole:/etc/pihole
          - /mnt/appdata/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
        restart: unless-stopped
        depends_on:
          unbound:
            condition: service_healthy
    
      unbound:
        container_name: unbound
        image: klutchell/unbound:latest
        networks:
          dns:
            ipv4_address: 172.22.0.3
        volumes:
          - /mnt/appdata/unbound:/opt/unbound/etc/unbound/custom
        restart: unless-stopped
        healthcheck:
          test: ["CMD", "dig", "google.com", "@127.0.0.1"]
          interval: 10s
          timeout: 5s
          retries: 5
    
      wg-easy:
        container_name: wg-easy
        image: ghcr.io/wg-easy/wg-easy:15
        ports:
          - "51820:51820/udp"
          - "51821:51821/tcp"
        # environment:
        #   TZ: ${TZ}
        #   LANG: en
        #   WG_HOST: ${WG_HOST}
        #   PASSWORD_HASH: ${PASSWORD_HASH}
        #   WG_DEFAULT_DNS: 172.22.0.2
        #   WG_MTU: 1420
        networks:
          dns:
            ipv4_address: 172.22.0.4
        volumes:
          - /mnt/appdata/wg-easy:/etc/wireguard
          - /lib/modules:/lib/modules:ro
        cap_add:
          - NET_ADMIN
          - SYS_MODULE
        sysctls:
          - net.ipv4.ip_forward=1
          - net.ipv4.conf.all.src_valid_mark=1
          - net.ipv6.conf.all.disable_ipv6=0
          - net.ipv6.conf.all.forwarding=1
          - net.ipv6.conf.default.forwarding=1
        restart: unless-stopped
    
    networks:
      dns:
        external: true
    

    Feel free to just delete the wg-easy service.

    O This user is from outside of this forum
    O This user is from outside of this forum
    [email protected]
    wrote last edited by
    #4

    Thank you very much.

    chris@lemmy.grey.failC 1 Reply Last reply
    2
    • chris@lemmy.grey.failC [email protected]
      services:
      
        pihole:
          container_name: pihole
          image: pihole/pihole:latest
          hostname: sheldon
          environment:
            HOST_CONTAINERNAME: pihole
            TZ: ${TZ}
            WEBPASSWORD: ${WEBPASSWORD}
            DNSMASQ_LISTENING: "all"
            PIHOLE_DNS_1: "unbound#53"
          ports:
            - "53:53/tcp"
            - "53:53/udp"
            - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
            - "8080:80/tcp"
          # network_mode: host
          dns:
            - 127.0.0.1
          networks:
            dns:
              ipv4_address: 172.22.0.2
          volumes:
            - /mnt/appdata/pihole/etc-pihole:/etc/pihole
            - /mnt/appdata/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
          restart: unless-stopped
          depends_on:
            unbound:
              condition: service_healthy
      
        unbound:
          container_name: unbound
          image: klutchell/unbound:latest
          networks:
            dns:
              ipv4_address: 172.22.0.3
          volumes:
            - /mnt/appdata/unbound:/opt/unbound/etc/unbound/custom
          restart: unless-stopped
          healthcheck:
            test: ["CMD", "dig", "google.com", "@127.0.0.1"]
            interval: 10s
            timeout: 5s
            retries: 5
      
        wg-easy:
          container_name: wg-easy
          image: ghcr.io/wg-easy/wg-easy:15
          ports:
            - "51820:51820/udp"
            - "51821:51821/tcp"
          # environment:
          #   TZ: ${TZ}
          #   LANG: en
          #   WG_HOST: ${WG_HOST}
          #   PASSWORD_HASH: ${PASSWORD_HASH}
          #   WG_DEFAULT_DNS: 172.22.0.2
          #   WG_MTU: 1420
          networks:
            dns:
              ipv4_address: 172.22.0.4
          volumes:
            - /mnt/appdata/wg-easy:/etc/wireguard
            - /lib/modules:/lib/modules:ro
          cap_add:
            - NET_ADMIN
            - SYS_MODULE
          sysctls:
            - net.ipv4.ip_forward=1
            - net.ipv4.conf.all.src_valid_mark=1
            - net.ipv6.conf.all.disable_ipv6=0
            - net.ipv6.conf.all.forwarding=1
            - net.ipv6.conf.default.forwarding=1
          restart: unless-stopped
      
      networks:
        dns:
          external: true
      

      Feel free to just delete the wg-easy service.

      O This user is from outside of this forum
      O This user is from outside of this forum
      [email protected]
      wrote last edited by
      #5

      You seem knowledgeable. I have a question about this. I have ran this type of setup before. Every time, I ended up ditching unbound because it throws DNSSEC error. I have tried troubleshooting but it doesn’t work.

      chris@lemmy.grey.failC Z 2 Replies Last reply
      3
      • O [email protected]

        You seem knowledgeable. I have a question about this. I have ran this type of setup before. Every time, I ended up ditching unbound because it throws DNSSEC error. I have tried troubleshooting but it doesn’t work.

        chris@lemmy.grey.failC This user is from outside of this forum
        chris@lemmy.grey.failC This user is from outside of this forum
        [email protected]
        wrote last edited by
        #6

        Is your ISP interfering?

        O 1 Reply Last reply
        0
        • chris@lemmy.grey.failC [email protected]

          Is your ISP interfering?

          O This user is from outside of this forum
          O This user is from outside of this forum
          [email protected]
          wrote last edited by
          #7

          Not as far as I know. I have never been throttled or anything ever. I have never seen any charges.

          chris@lemmy.grey.failC 1 Reply Last reply
          0
          • chris@lemmy.grey.failC [email protected]
            services:
            
              pihole:
                container_name: pihole
                image: pihole/pihole:latest
                hostname: sheldon
                environment:
                  HOST_CONTAINERNAME: pihole
                  TZ: ${TZ}
                  WEBPASSWORD: ${WEBPASSWORD}
                  DNSMASQ_LISTENING: "all"
                  PIHOLE_DNS_1: "unbound#53"
                ports:
                  - "53:53/tcp"
                  - "53:53/udp"
                  - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
                  - "8080:80/tcp"
                # network_mode: host
                dns:
                  - 127.0.0.1
                networks:
                  dns:
                    ipv4_address: 172.22.0.2
                volumes:
                  - /mnt/appdata/pihole/etc-pihole:/etc/pihole
                  - /mnt/appdata/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
                restart: unless-stopped
                depends_on:
                  unbound:
                    condition: service_healthy
            
              unbound:
                container_name: unbound
                image: klutchell/unbound:latest
                networks:
                  dns:
                    ipv4_address: 172.22.0.3
                volumes:
                  - /mnt/appdata/unbound:/opt/unbound/etc/unbound/custom
                restart: unless-stopped
                healthcheck:
                  test: ["CMD", "dig", "google.com", "@127.0.0.1"]
                  interval: 10s
                  timeout: 5s
                  retries: 5
            
              wg-easy:
                container_name: wg-easy
                image: ghcr.io/wg-easy/wg-easy:15
                ports:
                  - "51820:51820/udp"
                  - "51821:51821/tcp"
                # environment:
                #   TZ: ${TZ}
                #   LANG: en
                #   WG_HOST: ${WG_HOST}
                #   PASSWORD_HASH: ${PASSWORD_HASH}
                #   WG_DEFAULT_DNS: 172.22.0.2
                #   WG_MTU: 1420
                networks:
                  dns:
                    ipv4_address: 172.22.0.4
                volumes:
                  - /mnt/appdata/wg-easy:/etc/wireguard
                  - /lib/modules:/lib/modules:ro
                cap_add:
                  - NET_ADMIN
                  - SYS_MODULE
                sysctls:
                  - net.ipv4.ip_forward=1
                  - net.ipv4.conf.all.src_valid_mark=1
                  - net.ipv6.conf.all.disable_ipv6=0
                  - net.ipv6.conf.all.forwarding=1
                  - net.ipv6.conf.default.forwarding=1
                restart: unless-stopped
            
            networks:
              dns:
                external: true
            

            Feel free to just delete the wg-easy service.

            irmadlad@lemmy.worldI This user is from outside of this forum
            irmadlad@lemmy.worldI This user is from outside of this forum
            [email protected]
            wrote last edited by
            #8

            How well does that run in docker? I've always liked docker, but it seems to me that certain apps should touch metal than be containerized. Maybe I'm too old school.

            B chris@lemmy.grey.failC appoxo@lemmy.dbzer0.comA 3 Replies Last reply
            2
            • irmadlad@lemmy.worldI [email protected]

              How well does that run in docker? I've always liked docker, but it seems to me that certain apps should touch metal than be containerized. Maybe I'm too old school.

              B This user is from outside of this forum
              B This user is from outside of this forum
              [email protected]
              wrote last edited by
              #9

              I have all these services in docker as well (although not with the docker compose file here) and they run perfectly fine with a very low resource footprint.

              irmadlad@lemmy.worldI 1 Reply Last reply
              3
              • O [email protected]

                Hi friends.

                I've been trying to find docker-compose.yaml for pihole+unbound so I can use pihole as both a recursive dns server and as local dns alongside Nginx Proxy Manager. But since v6 of pihole all the old files I could find don't work properly or at all.

                Does anyone here use pihole+unbound in docker?

                S This user is from outside of this forum
                S This user is from outside of this forum
                [email protected]
                wrote last edited by
                #10

                I used to use a pihole+unbound single container docker image but technitium is just easier for me. Might be worth exploring other options like adguard home also.

                1 Reply Last reply
                2
                • irmadlad@lemmy.worldI [email protected]

                  How well does that run in docker? I've always liked docker, but it seems to me that certain apps should touch metal than be containerized. Maybe I'm too old school.

                  chris@lemmy.grey.failC This user is from outside of this forum
                  chris@lemmy.grey.failC This user is from outside of this forum
                  [email protected]
                  wrote last edited by [email protected]
                  #11

                  It runs quite well; Docker's not a full fledged virtual machine so much as a virtualization layer. I also love the portability of running this in Docker. I rsync a backup of this and the Appdata folder every night. When or if this server fails, I can be up and running again in minutes on another machine.

                  Z 1 Reply Last reply
                  3
                  • O [email protected]

                    Not as far as I know. I have never been throttled or anything ever. I have never seen any charges.

                    chris@lemmy.grey.failC This user is from outside of this forum
                    chris@lemmy.grey.failC This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #12

                    I mean in terms of hijacking DNS. Might be worth a look.

                    O 1 Reply Last reply
                    1
                    • O [email protected]

                      Thank you very much.

                      chris@lemmy.grey.failC This user is from outside of this forum
                      chris@lemmy.grey.failC This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #13

                      How'd it work out?

                      O 1 Reply Last reply
                      1
                      • B [email protected]

                        I have all these services in docker as well (although not with the docker compose file here) and they run perfectly fine with a very low resource footprint.

                        irmadlad@lemmy.worldI This user is from outside of this forum
                        irmadlad@lemmy.worldI This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #14

                        0K that's cool. I love docker. I would like to upgrade to k8s but I haven't yet plumbed the depths of docker. I was just with the overhead of docker, since Pi-Hole/Unbound is a dedicated system, I thought maybe it'd get better thru put baked in. I wouldn't listen to me tho, I'm medicated.

                        B 1 Reply Last reply
                        0
                        • chris@lemmy.grey.failC [email protected]

                          I mean in terms of hijacking DNS. Might be worth a look.

                          O This user is from outside of this forum
                          O This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #15

                          I don’t think it happens because I have used NextDNS and the logs show my activity.

                          1 Reply Last reply
                          0
                          • irmadlad@lemmy.worldI [email protected]

                            0K that's cool. I love docker. I would like to upgrade to k8s but I haven't yet plumbed the depths of docker. I was just with the overhead of docker, since Pi-Hole/Unbound is a dedicated system, I thought maybe it'd get better thru put baked in. I wouldn't listen to me tho, I'm medicated.

                            B This user is from outside of this forum
                            B This user is from outside of this forum
                            [email protected]
                            wrote last edited by
                            #16

                            As an anecdote: I have one system (x86) with pi-hole and unbound in a docker, and a secondary raspberry pi with pi-hole running on bare metal. The docker system (although much more performant in general) has a lower latency as the raspberry bare metal install.

                            1 Reply Last reply
                            0
                            • chris@lemmy.grey.failC [email protected]

                              It runs quite well; Docker's not a full fledged virtual machine so much as a virtualization layer. I also love the portability of running this in Docker. I rsync a backup of this and the Appdata folder every night. When or if this server fails, I can be up and running again in minutes on another machine.

                              Z This user is from outside of this forum
                              Z This user is from outside of this forum
                              [email protected]
                              wrote last edited by
                              #17

                              I do exactly the same thing for all three of these services! My implementation is on podman rather than docker, but basically the same deal.

                              1 Reply Last reply
                              1
                              • O [email protected]

                                You seem knowledgeable. I have a question about this. I have ran this type of setup before. Every time, I ended up ditching unbound because it throws DNSSEC error. I have tried troubleshooting but it doesn’t work.

                                Z This user is from outside of this forum
                                Z This user is from outside of this forum
                                [email protected]
                                wrote last edited by
                                #18

                                I just went through my setup to verify dnssec settings in unbound to troubleshoot strange latency when removing random names while browsing. Did you verify the unbound certificate file was created and had the proper permissions? There are also a couple other configuration items in unbound related to dnssec that can be tweaked to improve the implementation.

                                O 1 Reply Last reply
                                1
                                • chris@lemmy.grey.failC [email protected]

                                  How'd it work out?

                                  O This user is from outside of this forum
                                  O This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #19

                                  Deleted the WireGuard and modified few other things in docker compose file and so far it's running fine without any errors. So far do good.

                                  1 Reply Last reply
                                  1
                                  • T [email protected]

                                    https://github.com/IAmStoxe/wirehole

                                    vanilla_puddinfudge@infosec.pubV This user is from outside of this forum
                                    vanilla_puddinfudge@infosec.pubV This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #20

                                    3 years ago

                                    2 years ago

                                    uh, nah

                                    T 1 Reply Last reply
                                    1
                                    • vanilla_puddinfudge@infosec.pubV [email protected]

                                      3 years ago

                                      2 years ago

                                      uh, nah

                                      T This user is from outside of this forum
                                      T This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #21

                                      That's when the compose file was written. The docker images named in the file are updated constantly. Fear not ad-block seeker!

                                      vanilla_puddinfudge@infosec.pubV 1 Reply Last reply
                                      2
                                      • T [email protected]

                                        That's when the compose file was written. The docker images named in the file are updated constantly. Fear not ad-block seeker!

                                        vanilla_puddinfudge@infosec.pubV This user is from outside of this forum
                                        vanilla_puddinfudge@infosec.pubV This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #22

                                        Dope. Gonna give it a spin on a vps tonight.

                                        1 Reply Last reply
                                        1
                                        • Z [email protected]

                                          I just went through my setup to verify dnssec settings in unbound to troubleshoot strange latency when removing random names while browsing. Did you verify the unbound certificate file was created and had the proper permissions? There are also a couple other configuration items in unbound related to dnssec that can be tweaked to improve the implementation.

                                          O This user is from outside of this forum
                                          O This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by
                                          #23

                                          I tried again today with baremetal and docker install but I always end up with SERVFAIL after some time.

                                          Z 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups