Pi-hole requires three network ports to be open: port 22 (SSH administration), port 53 (DNS queries from clients), and port 80 (web admin interface). Pi-hole Ubuntu Deploy configures UFW (Uncomplicated Firewall) automatically during theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/damianiglesias/pihole-ubuntu-deploy/llms.txt
Use this file to discover all available pages before exploring further.
deploy.sh run, ensuring only the necessary ports are exposed.
Ports Required
| Port | Protocol | Purpose |
|---|---|---|
| 22 | TCP | SSH remote administration |
| 53 | TCP + UDP | DNS query resolution |
| 80 | TCP | Pi-hole web admin interface |
Automatic Configuration via deploy.sh
deploy.sh configures and enables UFW non-interactively as part of Step 5 of the deployment process:
ufw allow 53 is used without a protocol specifier, which opens port 53 for both TCP and UDP in a single command. This is required because DNS clients use UDP for standard queries and fall back to TCP for larger responses (e.g., DNSSEC records or zone transfers).deploy.sh uses echo "y" | ufw enable to non-interactively enable UFW. This pipes the confirmation response directly to the command, skipping the interactive prompt that UFW normally presents.Legacy Script
The standalonelegacy_scripts/firewall_rules.sh script can be used independently if you want to apply firewall rules outside of the main deploy.sh flow. It explicitly separates TCP and UDP rules for port 53 and adds a ufw reload step, then prints the active rule set with ufw status verbose: