Imagine blocking unwanted ads and malicious sites on your network. This dream can become a reality with Raspberry Pi, Pi-hole, and Nginx Proxy Manager. This post will guide you through setting up a Raspberry Pi with Pi-hole and configuring Nginx Proxy Manager with Docker.
Before we dive in, here are links to the products used in this article.
– Raspberry Pi 5 16gb: https://t4g.link/raspberrypi
– 128gb MicroSD Card: https://t4g.link/128gbmsd
– Argon ONE V5 Case: https://t4g.link/argonv5
– USB C Card Reader: https://t4g.link/usbccr
🎥 Video Overview
Getting Started: Installing Pi-hole and Docker on Raspberry Pi
Prerequisites:
Before diving into the installation, ensure you have your Raspberry Pi set up with Pi OS and SSH access enabled. Docker should already be installed, and you need to have Portainer for Docker container management.
- Installing Raspberry Pi OS and SSH access:
- Installing Docker and Portainer:
Step 1: Creating Docker Compose File for Pi-hole
Initiate by creating a docker-compose.yml file to structure this whole setup.
sudo nano docker-compose.yamlHere’s an example of the Docker Compose configuration for Pi-hole.
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "7300:80/tcp"
- "443:443/tcp"
# Uncomment the below if using Pi-hole as your DHCP server
# - "67:67/udp"
environment:
TZ: 'Europe/London' # Time Zones: https://t4g.gg/linux-time-zone-list/
FTLCONF_webserver_api_password: 'password'
# Uncomment WEBPASSWORD FOR PIHOLE VERSION 5 AN BELOW
# WEBPASSWORD: 'password'
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
restart: unless-stoppedStep 2: Execute the Docker Compose file
sudo docker compose up -dStep 3: Navigating the Pi-hole Dashboard
To access the Pi-hole admin dashboard, open your web browser and enter the Raspberry Pi’s IP address followed by the port 7300. Make sure to enter /admin at the end to reach the dashboard properly.
Installing Nginx Proxy Manager with Docker
Nginx Proxy Manager makes life easier when handling multiple applications requiring SSL and proxying. Create a new directory for this configuration:
sudo mkdir nginx-proxy-manager
cd nginx-proxy-manager
sudo nano docker-compose.yaml
Nginx Proxy Manager Docker Compose:
version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
ports:
- '80:80' # Public HTTP Port
- '81:81' # Admin Web Port
- '443:443' # Public HTTPS Port
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
restart: unless-stoppedExecute the Docker Compose file
sudo docker-compose up -dAccess the Nginx Proxy Manager dashboard by visiting your Raspberry Pi’s IP on port 81. Create your admin account and proceed by logging into the application.
Your Raspberry Pi Is Now An Ad Blocking Machine
Implementing a secure network with Raspberry Pi opens new avenues for home automation and advanced networking. Leveraging Pi-hole for network-wide ad blocking while relying on Nginx for proxy management is just scratching the surface.
Successfully integrating Pi-hole and Nginx Proxy Manager with your Raspberry Pi will not only enhance network security but also provide a flexible infrastructure for various deployments.
If you want to join other homelabe enthusiasts, join us on the HAVOK community Discord: https://havok.link/discord-wp

