Skip to content

docker-pi-hole

Docker image of Pi-hole, a DNS-level ad blocker for your whole home network

Copyleft (OSI) · EUPL-1.2

Listed by , founder & editor

88

Health

Thriving

Overview

Stars

11,804

Last commit

12 days ago

Nov 2026

Repository age

10 years

since Feb 2016

Latest version

2026.11.0

Nov 2026

Contributors

–

9 active in 90 days

Releases

13

last 12 months

Language

Shell

This project packages Pi-hole as a Docker container. Pi-hole acts as a DNS server on your network and blocks ads and trackers by refusing to resolve their domains. Every device that uses it for DNS is covered without installing anything on the device.

You run it with Docker Compose. The example maps DNS on port 53 over TCP and UDP, plus web ports 80 and 443, where it generates a self-signed certificate. You can also open ports for DHCP and NTP if Pi-hole should serve those. Settings such as timezone, web interface password and DNS listening mode are set through environment variables, and volumes keep your data across upgrades.

Cron runs inside the container and refreshes ad lists and flushes logs once a week. Images are tagged latest for releases and nightly for development builds, and releases use date-based versions.

It works as a self-hosted alternative to browser ad blockers and to paid DNS filtering services. It is licensed under EUPL-1.2.

Who it's for

Home lab users with a spare Linux box

One compose file gives you network-wide ad blocking for every device on your router.

Skip if: You only want to block ads in a single browser.

Families who want DNS filtering at home

Devices such as phones and smart TVs are covered once they use Pi-hole for DNS.

Skip if: You need per-user policies across many sites.

Docker users who already run services in containers

Upgrades are image pulls, and volumes keep your lists and settings.

Skip if: You prefer a bare-metal install without containers.

The problem it solves

Ads and trackers load on every device, including those that cannot run a blocker. This runs a filtering DNS server on your own hardware so the whole network is covered.

Strengths

  • Blocks at the DNS level for every device on the network
  • Configured through environment variables in a compose file
  • Weekly automatic ad list updates via built-in cron
  • About 13 releases in the last year with 9 recent contributors
  • Optional DHCP and NTP service

Trade-offs

  • Needs ports such as 53 free on the host, which can conflict with other DNS services
  • Bridge networking needs the DNS listening mode set to ALL
  • DNS blocking cannot remove ads served from the same domain as content
  • The privileged flag is discouraged; capabilities must be set explicitly

Self-host docker-pi-hole

Self-hostable
Yes

Frequently asked questions

Is it free?

Yes. It is open source under EUPL-1.2.

How do I run it?

Copy the compose example, set your timezone and web password, then run docker compose up -d.

Does it need to be on Raspberry Pi hardware?

No. It runs on your own Linux hardware through Docker.

How do I update ad lists?

A weekly cron job in the container fetches the newest lists, on Sunday in the early hours.

Similar tools in Network tools

AdAway

Network tools

Android ad blocker that filters ads system-wide with a hosts file or local VPN

9.6k 731 13 days ago Slowing GPL-3.0

ethr

Network tools

5.9k 405 11 months ago Dormant MIT

PCAPdroid

Network tools

5.3k 593 today Thriving GPL-3.0

WiFiAnalyzer

Network tools

5.1k 773 15 days ago Slowing GPL-3.0