Install docker and docker compose
apt update
apt install docker.io docker-compose
Create a pihole docker compose file
mkdir pi-hole
cd pi-hole
touch docker-compose.yml
vim docker-compose.yml
Paste this and change your password
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
- "80:80/tcp"
- "443:443/tcp"
environment:
TZ: 'America/Chicago'
WEBPASSWORD: 'CHANGE THIS'
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
dns:
- 1.1.1.1
- 1.0.0.1
cap_add:
- NET_ADMIN
restart: unless-stopped
Start pihole
docker-compose up --build