Update system and install Docker + Docker Compose:
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo usermod -aG docker $USER
Important: Log out and back in (or reboot) to apply Docker group changes:
newgrp docker
Make a folder for your self-hosted apps and open an editor:
mkdir -p ~/selfhosted && cd ~/selfhosted
nano docker-compose.yml
Paste this content into docker-compose.yml
(replace 'your-secure-password'
with your Pi-hole admin password):
version: '3'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
environment:
TZ: 'Etc/UTC'
WEBPASSWORD: 'ilyaas2012'
volumes:
- './pihole/etc-pihole:/etc/pihole'
- './pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
ports:
- "53:53/tcp"
- "53:53/udp"
- "8081:80/tcp"
restart: unless-stopped
cap_add:
- NET_ADMIN
nginx-proxy-manager:
container_name: nginx-proxy-manager
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- "81:81" # web UI dashboard port
- "80:80" # HTTP port for redirects / proxying
- "443:443" # HTTPS port
volumes:
- ./nginx-proxy-manager/data:/data
- ./nginx-proxy-manager/letsencrypt:/etc/letsencrypt
Run this command to download images and start Pi-hole and Nginx Proxy Manager:
docker compose up -d
http://<your-pi-ip>:8081/admin
WEBPASSWORD
.http://<your-pi-ip>:81
admin@example.com
changeme
To use Pi-hole as your DNS server:
OR manually set the DNS on your devices to your Pi IP.
Once logged into Nginx Proxy Manager dashboard:
discord.com
(or your custom domain) to https://google.com
.To update your containers later, run:
docker compose pull
docker compose up -d
If you want me to:
Just ask!
Enjoy your ad-free, redirect-capable network on Pi! 🎉