Docker setup for Pi-hole + Unbound, Nginx, Cloudflare Tunnel, and Glances on Raspberry Pi.
git clone https://github.com/joao-reis/rpi-docker-stack.git
cd rpi-docker-stack
# Configure environment files
cp .env.example pihole/.env && cp .env.example cloudflared/.env
# Edit .env files with your values
# Create directories and start all services
mkdir -p pihole/data/etc-pihole pihole/data/etc-dnsmasq.d
docker compose up -d| Service | Port | Description |
|---|---|---|
| Pi-hole | 53, 80 | Ad blocking DNS + DHCP |
| Unbound | 5335 | Recursive DNS (no 3rd party) |
| Nginx | 8080 | Static web server |
| Cloudflared | - | Tunnel to expose services |
| Glances | 61208 | System monitoring |
rpi-docker-stack/
├── docker-compose.yml # Unified (start all at once)
├── pihole/ # Pi-hole + Unbound
├── cloudflared/ # Cloudflare Tunnel
├── webserver/ # Nginx
└── glances/ # Monitoring
TZ=Europe/Lisbon
WEBPASSWORD=changeme
PIHOLE_DNS_=127.0.0.1#5335TUNNEL_TOKEN=your_token_from_zero_trust_dashboardJust add files to webserver/www/
# Start/stop all
docker compose up -d
docker compose down
# Start/stop individual service
cd pihole && docker compose up -d
cd cloudflared && docker compose up -d
# Logs
docker logs -f pihole
docker logs -f cloudflared
# Pi-hole specific
docker exec pihole pihole -g # Update blocklists
docker exec pihole pihole setpassword 'x' # Change password# Test DNS
dig @127.0.0.1 -p 5335 google.com
docker exec pihole pihole status
# Check tunnel
docker logs cloudflaredMIT