This is a guideline on how to setup Pi Hole in ArchLinux.
For this, I used a Raspberry Pi 4b with 8gb ram, using aarch64 version of ArchLinux.
This can also be done using a Raspberry Pi Zero, though I haven't tested myself (yet).
References:
- https://www.reddit.com/r/archlinuxarm/comments/hmj4a3/raspberry_pi_4_arch_linux_docker_pihole/
- https://gist.github.com/tntwist/a6183bbf736d7d652d1fc01a32c9c19a
timedatectl set-ntp true
timedatectl set-timezone "Europe/London"
cat <<EOF >>/etc/modprobe.d/pi-blacklist-bluetooth.conf
# Bluetooth
blacklist bluetooth
blacklist btsdio
Press Ctrl + D
cat <<EOF >>/etc/modprobe.d/pi-blacklist-wifi.conf
# WiFi
blacklist brcmfmac
blacklist brcmutil
Press Ctrl + D
pacman -S git pigz docker docker-compose docker-scan
systemctl enable --now docker.service
docker run hello-world
It should run fine as root. Try it again with your non-priviledged user. If you get the error message:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Add your user to the docker group:
sudo usermod -a -G docker [user]
Logout and Login (Reference: https://stackoverflow.com/questions/47854463/docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socke )
reboot
Log in as root, switching to root or use sudo -i
.
Reference: sameersbn/docker-bind#65
systemctl stop systemd-resolved
systemctl disable systemd-resolved
A similar setup for IPv6 can be found here: https://gist.github.com/tntwist/a6183bbf736d7d652d1fc01a32c9c19a NOTE: You need to be able to make your router assign an IPv6 to your Raspberry Pi to use it reliably.
version: "3"
services:
cloudflared:
container_name: cloudflared
image: visibilityspots/cloudflared:latest
restart: unless-stopped
ports:
- "5054:5054/tcp"
- "5054:5054/udp"
environment:
DNS1: 1.1.1.1
DNS2: 1.0.0.1
PORT: 5054
networks:
pihole_net:
ipv4_address: 10.0.0.2
cap_add:
- NET_ADMIN
pi-hole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
ports:
- "80:80/tcp"
- "53:53/tcp"
- "53:53/udp"
- "443:443/tcp"
environment:
- TZ='Europe/London'
- WEBPASSWORD=YOUR_ADMIN_PASSWORD
- FTLCONF_REPLY_ADDR4=192.168.1.200 #IPv4 address of docker host
- PIHOLE_DNS_=10.0.0.2#5054
- IPv6=false
- DNSMASQ_LISTENING=all
volumes:
- "./config/pihole:/etc/pihole"
- "./config/dnsmasq:/etc/dnsmasq.d"
networks:
pihole_net:
ipv4_address: 10.0.0.3
dns:
- 127.0.0.1
- 1.1.1.1
cap_add:
- NET_ADMIN
networks:
pihole_net:
driver: bridge
ipam:
config:
- subnet: 10.0.0.0/29
docker-compose up -d
docker-compose logs cloudflared
docker-compose logs pi-hole
Check if there are any errors in the log.
- https://blocklistproject.github.io/Lists/ Instructions here: https://github.com/blocklistproject/Lists#usage
Get Interface names:
ip a
Capture inbound DNS request
tcpdump -i eth0 udp port 53
Cature DNS request from pi-hole to cloudflared
tcpdump -i br-4294f2b61c75 udp port 5054
NOTE: It is possible to make Pi Hole works as a DHCP server, but it's not covered by this guide.
How to upgrade:
docker images
to check what you currently havedocker-compose pull
docker-compose down
docker images
to check the current state of the imagesdocker-compose up --force-recreate --build -d
docker image prune -f
to delete old images