# Pihole v6 & unbound in one Docker-Container

**URL:** <https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091>\
**Category:** Beta 6.0\
**Created:** [May 8, 2024, 7:10pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091 "2024-05-08T19:10:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![GerdRuetten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/gerdruetten/32/40204_2.png) [@GerdRuetten](https://discourse.pi-hole.net/u/GerdRuetten)\
**Post date:** [May 8, 2024, 7:10pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/1 "2024-05-08T19:10:13Z")

</div>

Hello Community,

there are some projects where Pihole in v5 was built together with unbound in ONE docker container, so you don't have to build macvlan.

Does anyone know of a project where this 1-container solution was implemented with the new v6 of Pihole?

Or are the developers perhaps planning to release such an installation "out of the box"?

Best regards  
Gerd

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [May 8, 2024, 8:36pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/2 "2024-05-08T20:36:13Z")

</div>

You don't need to use macvlan to use unbound in a separate container.

You just need to set the correct ports to avoid conflicts between the containers and host.

---

<div class="post-metadata">

**Author:** ![GerdRuetten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/gerdruetten/32/40204_2.png) [@GerdRuetten](https://discourse.pi-hole.net/u/GerdRuetten)\
**Post date:** [May 8, 2024, 9:22pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/3 "2024-05-08T21:22:49Z")

</div>

Thank you for your support!

You mean, i can use a bridge-network from docker with two separat containers - one for pihole and one for unbound?

Have you a compose example for this setup?

TIA  
Gerd

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [May 8, 2024, 9:34pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/4 "2024-05-08T21:34:16Z")

</div>

Personally I don't have a example, but this repository has one:

> <https://github.com/klutchell/unbound-docker/blob/07160f6befd92e4022be3ec987a040ae1d91bb67/examples/pi-hole/docker-compose.yml>

You can use the same logic with different images.

Also, you can probably find other examples on the internet.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 9, 2024, 9:09am UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/5 "2024-05-09T09:09:08Z")

</div>

This `docker-compose` seems to complicated IMO. While this may work you should mind that Pi-hole also accepts hostnames (not only IP addresses) as upstream servers. You can omit the entire IP address definition and the complicated network configuration and simply specify `unbound` as the DNS server using the `pihole` container's environment.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 9, 2024, 9:15am UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/6 "2024-05-09T09:15:20Z")

</div>

Maybe something like this:

```yaml
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:development-v6
    networks:
      - pihole-unbound
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: 'America/Chicago'
      # 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'
      # Configure DNS upstream servers, e.g:
      FTLCONF_dns_upstreams: 'unbound'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
    restart: unless-stopped

  unbound:
    image: mvance/unbound:latest
    networks:
      - pihole-unbound
    restart: unless-stopped

networks:
  pihole-unbound:

```

Please refer to [https://github.com/pi-hole/docker-pi-hole/tree/development-v6](https://github.com/pi-hole/docker-pi-hole/tree/development-v6) for any details about the `pihole` configuration part.

HINT: This configuration assumes you are working with the v6.0 beta. Replace `development-v6` by `latest`, etc. once Pi-hole v6.0 has been merged!

---

<div class="post-metadata">

**Author:** ![GerdRuetten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/gerdruetten/32/40204_2.png) [@GerdRuetten](https://discourse.pi-hole.net/u/GerdRuetten)\
**Post date:** [May 10, 2024, 10:09pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/7 "2024-05-10T22:09:28Z")

</div>

Hi,  
thank you for your support!

I take your compose file.

But i get this warning in the ftl.log

> WARNING WARNING in dnsmasq core: no address range available for DHCP request via eth0

My compose file:

```auto
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:development-v6
    networks:
      - pihole-unbound
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
      - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
    environment:
      TZ: 'Europe/Berlin'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'MyWebServerApiPassword'
      # Configure DNS upstream servers, e.g:
      FTLCONF_dns_upstreams: 'unbound'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=true
    cap_add:
      - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed

  unbound:
    image: mvance/unbound:latest
    container_name: unbound
    networks:
      - pihole-unbound
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=true

networks:
  pihole-unbound:
    name: pihole-unbound

```

Can you help me please?

TIA

Regards  
Gerd

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 11, 2024, 6:46am UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/8 "2024-05-11T06:46:44Z")

</div>

Are you using DHCP?

---

<div class="post-metadata">

**Author:** ![GerdRuetten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/gerdruetten/32/40204_2.png) [@GerdRuetten](https://discourse.pi-hole.net/u/GerdRuetten)\
**Post date:** [May 11, 2024, 7:37am UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/9 "2024-05-11T07:37:13Z")

</div>

Yes, I using pihole as DNS and DHCP server

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [May 11, 2024, 9:29am UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/10 "2024-05-11T09:29:20Z")

</div>

Then have a look at [https://github.com/pi-hole/docker-pi-hole/tree/development-v6](https://github.com/pi-hole/docker-pi-hole/tree/development-v6) concerning DHCP. It may not be possible to do the same with host networking mode due to docker limitations.

---

<div class="post-metadata">

**Author:** ![watcherfox](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/watcherfox/32/44394_2.png) [@watcherfox](https://discourse.pi-hole.net/u/watcherfox)\
**Post date:** [December 3, 2024, 2:14pm UTC](https://discourse.pi-hole.net/t/pihole-v6-unbound-in-one-docker-container/70091/11 "2024-12-03T14:14:49Z")

</div>

Thanks. All works fine.
