Step by step: pi-hole on docker compose (macvlan)

preview_player
Показать описание
Showing you how to deploy pihole docker compose file. In this video I am using openmediavault 6 as a operating system but ultimately the container deployment would be the same as this guide since it is based on Docker Compose.

Check out my other videos, have some covering deploying other docker container and OMV as well.

Don't forget to subscribe if you like the content!

**************Start of Docker File********************
version: "3"

services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: pihole
networks:
pih_network:
ipv4_address: 192.168.1.50 #**Change, use pihole address
environment:
TZ: 'America/Chicago' #**Change to your timezone
WEBPASSWORD: '12345678' #**Password for pihole, used on container creation.
ports:
- "443:443/tcp"
- "53:53/tcp"
# - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
- "53:53/udp"
- "80:80/tcp"
restart: "unless-stopped"
volumes:
- "CHANGE_TO_COMPOSE_DATA_PATH/pihole/etc/pihole:/etc/pihole"
- "CHANGE_TO_COMPOSE_DATA_PATH/pihole/etc/dnsmasq.d:/etc/dnsmasq.d"
# cap_add:
# - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
networks:
pih_network:
driver: macvlan
driver_opts:
parent: enp0s3 #**Change this to your interface
ipam:
config:
- subnet: 192.168.1.0/24 #**Your network subnet
gateway: 192.168.1.1 #**Your network gateway
ip_range: 192.168.1.50/32 #**ip for pihole container

**************End of Docker File********************
Рекомендации по теме
Комментарии
Автор

Absolutely perfect instruction video! Got my Pihole up and running in OMV7 in 20 minutes. Thank you thank you thank you!!

jurigregg
Автор

Thank you, this was the exact issue I had!! I found this video really useful.
Also the router tutorial was very handy

emilianofernandezcervantes
Автор

Thanks for this guide. After searching for some time this video did it for me.

owengill
Автор

This totally worked. Thanks for the Video.

CastDD
Автор

Another good video i will try this oneout on my omv server :)

sadp
Автор

one of my fav channels, this guy always has what I need!

sugoi
Автор

Good tutorial for the new OMV interface, might be nice to have the whole compose file in a Pastebin.

I had an issue - once set up (using a DietPi machine), I couldn't ping my Pi-hole. It turned out that my DNS on the device was screwed up, and Pi-hole never got installed properly (you could check Docker logs of the Pi-hole container, and it would say "DNS resolution is not available").

I got it fixed by adding a DNS via: sudo nano /etc/systemd/resolved.conf
and then running: service systemd-resolved restart

Hope it helps anyone who's had the same issue!

PatrisDev
Автор

Just what I was looking for Rob, got yourself a new subscriber!

kano
Автор

Is there a known way to have ipv6 enabled while creating the macvlan within the compose file? ive been trying to find something, but i have yet to find anything that works. any help would be great, thanks

jaredf
Автор

Thanks for this! Could you also make a video on how to fix unbound please

bienvenochi
Автор

I was able to get Pi-hole working in docker compose but it will not provide MAC addresses when going to network. My original and still running Pi-hole is running directly on a separate Linux VM and it has no issues. Even shows multiple IP’s that match the same MAC. I tested bridge mode, not Host networking mode and even added conditional forwarding to my router. But my docker instance provides no information. What might be going wrong?

Lafiro
Автор

Everything works, but now I want to set access from outside local network. I have few Nginx Proxy Manager hosts, all that are on openmediavault or PCs in network works. But on pihole with macvlan I have error "502 Bad Getway openresty". Any solution for that?

karnasw
Автор

Nice video thanks! I tried creating the macvlan under Compose>Networks but I cannot reference it properly on the compose file. Any ideas?

LocoCharlyX
Автор

Hi. I can ping the container and the container is up but I can't access the admin panel, the connection just times out. Is there something I can try?

italosoares
Автор

I wish the text part was more clear and bigger font so that we could read and create our own docker compose file in the absence of a text file from you.

shaileshsaxena
Автор

should i use cloudflared or unbound in addition?

ronald
Автор

its giving me a 403 Forbidden error when trying to visit the web GUI. Any idea why?

jeremyAr
Автор

Hi, Could you copy what you ended up using so we can copy and paste it? And so modify it according to our needs.

jfrit
Автор

The screen of yours is too small to see

arioncheng
Автор

I am new to OpenMediaVault and PiHolde. I am struggling to get Pihole up and running. I followed your instructions, but I'm not sure what went wrong. Here's the error:
Failed to execute command 'export export LANG=C.UTF-8; export LANGUAGE=; docker compose --file '/Nissley/PiHole/PiHole.yml' --env-file '/Nissley/PiHole/PiHole.env' --env-file '/Nissley/global.env' up -d 2>&1': parsing /Nissley/PiHole/PiHole.yml: yaml: line 5: did not find expected key

willnissley