This guide walks you through the fastest path to a working Pi-hole v6 installation using the Pi-hole Ubuntu Deploy Bash script. In roughly ten to fifteen minutes — mostly spent waiting on package downloads — you’ll have a fully configured network-wide DNS ad blocker with a static IP, a hardened firewall, and an optional suite of extras. No manual configuration files, no copy-pasting commands from a wiki: one script handles everything interactively.Documentation 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.
Run the Installer
The script must be executed as root. Launch it with The installer opens with a blue ASCII banner and version stamp confirming you’re running the correct release:If you see
sudo:ERROR: Please run as root (sudo ./deploy.sh), you forgot the sudo prefix — re-run the command with it.Network Preparation (Automatic)
Step 1 runs automatically without any input from you. The script:
- Stops and disables
systemd-resolvedto free port 53 for Pi-hole. - Replaces
/etc/resolv.confwith temporary entries pointing to8.8.8.8and1.1.1.1. - Pings
8.8.8.8to verify internet connectivity before proceeding.
Install Dependencies (Automatic)
Step 2 runs If
apt-get update followed by a single install command for all required packages — no interaction needed:apt-get update fails (e.g. because the network isn’t fully ready), the script exits with an error. Wait a moment and re-run.Install Pi-hole v6
Step 3 launches the official Pi-hole installer by piping the install script directly into bash:Press Enter when prompted, then work through the Pi-hole installer’s blue TUI screens. Accept all defaults unless you have a specific reason to change them — the deploy script configures everything that matters (blocklists, password, firewall, static IP) in the steps that follow.After the installer completes, the script verifies the
pihole command is available. If it isn’t, installation failed and you’ll need to check the output above for errors.Install Advanced Blocklists (Optional)
After Pi-hole installs, you’re prompted to inject three curated blocklists directly into Pi-hole’s SQLite gravity database:Entering
Enter
y injects the following lists and immediately runs pihole -g to rebuild the gravity database:| List | Source | Focus |
|---|---|---|
| StevenBlack Unified Hosts | raw.githubusercontent.com/StevenBlack/hosts | Ads, malware, fakenews, gambling |
| AdGuard Mobile | v.firebog.net/hosts/AdguardDNS.txt | Mobile ads and trackers |
| EasyPrivacy Tracking | v.firebog.net/hosts/Easyprivacy.txt | Tracking and telemetry |
n to skip and use Pi-hole’s default blocklists only.Set the Admin Password
Step 4 prompts you to set the Pi-hole web admin password. You’ll be asked to type and then confirm your chosen password (input is hidden):The script loops until both entries match and neither is empty. Once confirmed, the password is applied via
pihole setpassword and pihole-FTL is restarted. Keep this password safe — you’ll need it to log into the web interface at http://<your-ip>/admin.Install Optional Components
The script walks you through four optional add-ons, each with its own
[y/n] prompt:| Component | Prompt | What it does |
|---|---|---|
| Unbound | Install Unbound? [y/n] | Installs a local recursive DNS resolver on 127.0.0.1:5335. After install, point Pi-hole’s upstream DNS to 127.0.0.1#5335 in the web interface. |
| PADD | Install PADD dashboard? [y/n] | Installs the Pi-hole terminal dashboard to /usr/local/bin/padd. A follow-up prompt offers to auto-start it on SSH login. |
| DNS Manager | Install DNS Manager tool? [y/n] | Clones the Python DNS Manager from Codeberg into /opt/pihole-dns-manager, creates a virtualenv, and generates a run_dns_sync.sh wrapper. |
| Log2Ram | Install Log2Ram? [y/n] | Adds the Azlux apt repository and installs Log2Ram to redirect Pi-hole’s log writes to RAM, reducing disk wear. Takes effect after the next reboot. |
Unbound is currently experimental. It installs successfully but may require additional manual configuration to work correctly with Pi-hole. See Unbound DNS for details.
Configure a Static IP
Step 6 lists your available network interfaces and asks you to select one:After you enter the interface name, the script detects its current IP and default gateway, displays them, and asks:Entering
y writes a Netplan configuration file to /etc/netplan/99-pihole-static.yaml and runs netplan apply. Your existing Netplan files are backed up to /etc/netplan/backup/ before any changes are made.Setting a static IP is strongly recommended so your router always knows where to send DNS queries.Final Report Output
When the script completes successfully, you’ll see a green banner followed by your connection details:Server IP is the address to use as your router’s primary DNS server. The Web Interface URL opens the Pi-hole admin dashboard in any browser on your LAN.
Next Steps
- Read the Bash Script deployment guide for a detailed breakdown of every step, configuration option, and troubleshooting tip.
- Prefer a containerised setup? See the Ansible + Docker guide to deploy Pi-hole in Docker using an Ansible playbook instead.