AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

Docker container installation

Installation Methods

Deploying Pi-hole with Docker extends beyond typical Raspberry Pi usage, but it’s entirely possible. If you have an existing server and want to set up a Pi-hole instance quickly, Docker makes it straightforward.

Using Docker offers several advantages: it simplifies installation by reducing manual setup, enhances portability by enabling deployment on various platforms beyond the Raspberry Pi, and ensures isolation, minimising conflicts with other services. Additionally, updating Pi-hole becomes as easy as pulling a new Docker image and restarting the container. If you already run Docker containers, adding Pi-hole requires minimal additional system resources.

Pi-hole can be deployed with minimal configuration using Docker. Here’s a basic setup using docker-compose:

   services:
     pihole:
       container_name: pihole
       image: pihole/pihole:latest
       ports:
         - "53:53/tcp"
         - "53:53/udp"
         - "80:80/tcp"
       environment:
         TZ: 'America/Chicago'
         # WEBPASSWORD: 'set-a-secure-password'
       volumes:
         - './etc-pihole:/etc/pihole'
         - './etc-dnsmasq.d:/etc/dnsmasq.d'
       restart: unless-stopped

For persistent storage, the configuration files are mapped to local volumes. After saving as docker-compose.yml, run:

   docker compose up -d

Key considerations:

  • Set a secure password via WEBPASSWORD environment variable
  • Ensure port 53 is available (may require disabling local DNS services)
  • Use --net=host instead of port mapping if planning to use DHCP
  • Access the web interface at http://pi.hole/admin post-installation

The container automatically restarts unless explicitly stopped, maintaining continuous ad-blocking service across system reboots.

Something here not working for you? Ask in the community — other makers and the Little Bird team read it.

Search The Pi-Hole Book

Type a word or phrase to search all 74 pages.

Ask The Pi-Hole Book

Answers come from this book only.

Talk to The Pi-Hole Book

Ask it out loud and it answers in your ear, from this book's own pages — the right command, the right setting, and the page it came from.

Unlock the tutor

Already bought it, or had an account on books.littlebird.com.au? Sign in.

Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.