Tutorial

Self-hosting Pi-hole on Your Own VPS

Self-hosting10 min read21 steps

Pi-hole turns any Linux server into a network-wide ad and tracker blocker. Hosted on a VPS, it protects all your devices simultaneously without installing any browser extension. This guide covers version 6, released in 2025 with a completely rewritten interface, and goes beyond basic installation: port 53 blocked by systemd-resolved, Unbound for full DNS recursion, false positive management, metrics and backup.

Contents· Why Self-host Pi-hole on a VPS1/20
  1. 01Why Self-host Pi-hole on a VPS
  2. 02Concrete benefits of Pi-hole on a VPS
  3. 03Pi-hole v5 vs Pi-hole v6: What Changed
  4. 04Pi-hole v5 vs v6
  5. 05Technical Requirements
  6. 06What you need
  7. 07Deploy Pi-hole Step by Step
  8. 08Full installation on Ubuntu/Debian
  9. 09Adding Recommended Blocklists
  10. 10Recommended lists
  11. 11Managing False Positives and Whitelisting
  12. 12Diagnosing and fixing a false positive
  13. 13Resolving Docker and Port 53 Conflicts
  14. 14Resolving Docker DNS conflicts
  15. 15Pi-hole + Unbound: Full DNS Recursion Without a Third Party
  16. 16Installing and configuring Unbound
  17. 17Monitoring Pi-hole Metrics
  18. 18Important metrics and reference values
  19. 19Backing Up and Restoring Pi-hole Configuration
  20. 20Backup and restore

Why Self-host Pi-hole on a VPS

Most Pi-hole guides assume a Raspberry Pi on your local network. A VPS completely changes the equation: your DNS blocker is reachable from any device, anywhere in the world. Configure your smartphone on the go to point to your VPS, and ads disappear even on mobile networks and public Wi-Fi.

Concrete benefits of Pi-hole on a VPS

  • Universal protection: covers all your devices (PCs, phones, tablets) without per-device configuration
  • Bandwidth reduction: blocked requests consume zero download bytes
  • Centralized DNS logs: full visibility on domains contacted by each device
  • ISP independence: your DNS no longer transits through your ISP's resolver
  • IoT tracker blocking: connected devices cannot contact their telemetry servers
  • Customizable: add your own rules, whitelist what you need, choose your lists

Pi-hole v5 vs Pi-hole v6: What Changed

Pi-hole v5 vs v6

Scroll the table

FeaturePi-hole v5Pi-hole v6 (2025)
Web interfacePHP + lighttpdBuilt into FTL, no lighttpd needed
DNS engineSeparate dnsmasqUnified FTL (Faster Than Light) embeds DNS
APILimited API, key in URLFull REST API with token authentication
ConfigurationFiles in /etc/pihole/*Single TOML file pihole.toml
Installationcurl | bash scriptcurl | bash script (identical, same URL)
Dockerpihole/pihole imagepihole/pihole image (updated, same name)

Migration from v5 to v6 is done via the standard installation script run on an existing v5 system: Pi-hole detects the existing version and offers the upgrade. Configuration is automatically converted to TOML format. If starting from scratch, install v6 directly.

Technical Requirements

What you need

  • A VPS running Ubuntu 22.04/24.04 or Debian 12 with at least 512 MB RAM (1 GB recommended)
  • A static IPv4 address and ideally an IPv6 address
  • Root or sudo SSH access
  • Port 53 (TCP and UDP) open in the VPS firewall and at your hosting provider
  • Port 80 or 443 for the web interface (optional but recommended with HTTPS)

Deploy Pi-hole Step by Step

Full installation on Ubuntu/Debian

  1. Disable the systemd-resolved stub resolver

  2. Install Pi-hole

  3. Configure the firewall

  4. Verify operation

  5. Point your devices to the VPS

  6. Access the web interface

Adding Recommended Blocklists

Pi-hole ships with a basic list. For effective blocking, add proven community lists from the Adlists menu in the web interface (Group Management → Adlists).

Recommended lists

  • StevenBlack Unified (ads + trackers): https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts — the reference, ~100,000 domains
  • OISD Big: https://big.oisd.nl — aggressive list but few false positives, ~500,000 domains
  • Firebog Ticked (green checkmark only): visit firebog.net and only add green-ticked lists to minimize false positives
  • HaGeZi Multi PRO: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/pro.txt — excellent malware coverage
  • Perflyst Smart-TV: to block telemetry from smart TVs

After adding lists, click Tools → Update Gravity (or run pihole -g via SSH) to download and compile all lists. The operation can take 1 to 3 minutes depending on the number of lists. Pi-hole remains functional during the update.

Managing False Positives and Whitelisting

Overly aggressive blocking eventually breaks legitimate services. Pi-hole provides precise diagnostic tools to identify and fix false positives without weakening your protection.

Diagnosing and fixing a false positive

  1. Identify the blocked domain

  2. Add to whitelist

  3. Whitelist from the command line

  4. Common false positive cases

Resolving Docker and Port 53 Conflicts

If your VPS runs Docker containers, you'll encounter a second problem: Docker creates its own internal DNS resolver that may also listen on port 53. Here's how to coexist.

Resolving Docker DNS conflicts

  1. Disable Docker's host-level DNS

  2. Pi-hole itself in Docker

  3. Verify no other process is listening

Pi-hole + Unbound: Full DNS Recursion Without a Third Party

By default, Pi-hole forwards unblocked queries to a public resolver (Cloudflare 1.1.1.1, Google 8.8.8.8). That resolver then sees all your DNS queries. Unbound solves this by querying root and authoritative servers directly — no intermediary.

Installing and configuring Unbound

  1. Install Unbound

  2. Create the Pi-hole + Unbound configuration

  3. Point Pi-hole to Unbound

  4. Verify recursion

Monitoring Pi-hole Metrics

The Pi-hole v6 dashboard shows key metrics in real time. Here's how to interpret them and what to watch.

Important metrics and reference values

  • Blocking rate (Ads blocked today): between 10% and 30% is normal. A rate below 5% suggests your lists are incomplete. A rate above 40% may indicate too many false positives.
  • Queries/24h: gives an idea of the load. A family network typically generates 5,000 to 50,000 queries per day.
  • Top Blocked Domains: if an ad domain tops the list every day, the corresponding app is particularly intrusive.
  • Top Clients: identify the most talkative devices — IoT objects are often at the top.
  • DNS cache size: in v6, FTL manages the internal cache. A high hit rate (>60%) reduces perceived latency.
  • Query Types: an abnormal volume of PTR (reverse resolution) queries may indicate a network scan or misconfigured software.

To export metrics to Grafana or Prometheus, Pi-hole v6 exposes a REST API at /api/metrics. A community exporter (pihole-exporter) lets you integrate Pi-hole into an existing dashboard without modifying Pi-hole's configuration.

Backing Up and Restoring Pi-hole Configuration

Regular Pi-hole backups are essential: they preserve your custom lists, whitelist, groups and DNS configuration, which you won't want to manually reconfigure after a migration or reinstall.

Backup and restore

  1. Create a Teleporter backup

  2. Automate backups

  3. Restore from backup

  4. Back up Unbound configuration

Store your backups off the VPS: copy them to an S3 bucket, a remote server, or your local machine. If your VPS becomes inaccessible, you can reconfigure Pi-hole on a new server in minutes by simply importing the Teleporter file.

A filtering DNS that follows you everywhere

The ServOrbit Cloud VPS, with its stable public IP, hosts a ready-to-lock-down Pi-hole + WireGuard template: block ads and trackers on all your devices, even on the go, without ever exposing an open resolver.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.

Message us on WhatsAppopens in a new tab