Mad World #Save_GAZA: Free Palestine  

Search

Pi-hole v6 with Docker Compose: Install, Setup, Blocklists, Per-Device Groups and Hardening (Tested)

Pi-hole v6 with Docker Compose: Install, Setup, Blocklists, Per-Device Groups and Hardening (Tested)

Pi-hole is a free DNS server that blocks ads, trackers and malware sites for every device in your home, from one small machine. This guide installs Pi-hole v6 with Docker Compose, fixes the "port 53 already in use" error you get on Ubuntu, and then walks through the web interface one screen at a time: upstream DNS and DNSSEC, blocklists, separate rules for a child's phone, allowing a site that broke, local names, backups, a hardened compose file and safe updates.

Tested on 25 November 2026: Pi-hole Docker tag 2026.11.0 (Core v6.6, web interface v6.6.1, FTL v6.9) in Docker 29.10.1 with Docker Compose v5.8.0, on an Ubuntu 26.04 home server at 192.168.1.50. Three devices on the same network used it: a laptop (192.168.1.21), a TV (192.168.1.23) and a test machine at the address of a child's phone (192.168.1.22). Every screenshot and output below comes from that lab.

Quick answer: Pi-hole with Docker Compose in five steps

In plain words: DNS is the internet's phone book. Before any app or site loads, your device asks a DNS server for the address of a name. Pi-hole becomes that phone book for your whole home: it looks up normal names for your devices and gives ad and tracker names a dead end (0.0.0.0), so they never load.

  1. Give your server an address that never changes (a DHCP reservation on the router). Ours is 192.168.1.50.
  2. Create compose.yaml with the image pihole/pihole:2026.11.0, the password in a Docker secret, FTLCONF_dns_listeningMode: ALL, and ports 53, 80 and 443 published on that address (192.168.1.50:53:53/udp): on Ubuntu, systemd-resolved already uses port 53.
  3. Run docker compose up -d, open http://192.168.1.50/admin and log in.
  4. Test from one device: dig @192.168.1.50 pagead2.googlesyndication.com +short must print 0.0.0.0. Then set your router's DHCP DNS server to the Pi-hole address.
  5. Add two settings so the name pi.hole works from your devices: FTLCONF_dns_reply_host_force4: "true" and FTLCONF_dns_reply_host_IPv4 set to the server's address. In Docker, Pi-hole otherwise answers with the container's own address.

Each step has a full, tested section below. The result in our lab:

Dashboard Top Clients card showing laptop.home.arpa, kids-phone.home.arpa and tv.home.arpa instead of IP addresses
1: with a local DNS record for each device, the dashboard shows names instead of addresses.

Five words you will meet in this guide:

  • Upstream: the public DNS service Pi-hole asks for the names it does not block.
  • Blocklist: a list of ad, tracker and malware names, downloaded from the internet.
  • Gravity: Pi-hole's database of every blocked name, built from your blocklists.
  • Client and group: a client is one device, known by its address; a group is a set of rules you can give to some clients only.
  • Port 53: the network port of DNS. On one address, only one program can use it.

What Pi-hole v6 changed, and which version to run

Pi-hole v6 is a big rework of the project. The web server and the API now run inside FTL, Pi-hole's DNS engine, so there is no separate web server or PHP any more, and every setting lives in one file: /etc/pihole/pihole.toml. In Docker you can set any of those settings with an environment variable: dns.listeningMode becomes FTLCONF_dns_listeningMode. A setting set this way is locked in the web interface (you will see a padlock), so compose.yaml stays the one place that decides it.

The Docker image has date tags (2026.11.0), and each tag ships a given Core, web interface and FTL version; the footer of every admin page shows all four. Run 2026.11.0 or newer: it came out on 11 November 2026 with FTL v6.9 and Core v6.6, which fix 11 security advisories, several of them rated High. The image runs on linux/amd64, arm64, arm/v7, arm/v6, 386 and riscv64, so a mini PC, an old laptop or a Raspberry Pi all work.

Before you start

  • A Linux machine that stays on, with Docker and the Compose plugin (install Docker Compose on Ubuntu).
  • A fixed LAN address for that machine. Every device will send its lookups there, so it must never change. A DHCP reservation in the router is the easiest way.
  • Five minutes to check what already uses port 53.
Terminal
docker --version
docker compose version
ip route get 1.1.1.1
sudo ss -lunp "sport = :53"
Terminal on the home server: Docker 29.10.1, Docker Compose v5.8.0, the server address 192.168.1.50, and systemd-resolved already listening on port 53
1-2: Docker and Compose versions. 3: src is the server's own LAN address. 4: systemd-resolved already holds port 53 on 127.0.0.53 and 127.0.0.54.

The src address is the one your devices will use. On Ubuntu, systemd-resolved listens on 127.0.0.53 and 127.0.0.54, port 53. That is the reason for the error in step 1, and you do not need to switch systemd-resolved off.

Step 1: Create the Compose file (and fix "port 53 already in use")

Make a folder for Pi-hole, a folder for its data, and a random admin password in a file only you can read:

Terminal
mkdir -p ~/pihole && cd ~/pihole
mkdir -p etc-pihole && (umask 077 && openssl rand -base64 18 > pihole_password.txt) && ls -l

Then compose.yaml. This is the usual Pi-hole quick-start file with two changes: a fixed image tag instead of latest, and the password read from a Docker secret instead of written in the file:

YAML
services:
  pihole:
    image: pihole/pihole:2026.11.0
    container_name: pihole
    hostname: pihole
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: America/New_York
      FTLCONF_dns_listeningMode: ALL
      WEBPASSWORD_FILE: pihole_webpasswd
    secrets:
      - pihole_webpasswd
    volumes:
      - ./etc-pihole:/etc/pihole
secrets:
  pihole_webpasswd:
    file: ./pihole_password.txt
  • FTLCONF_dns_listeningMode: ALL: in Docker's default bridge network, your devices' lookups do not come from a network Pi-hole sees as local, so the default mode would refuse them. This is safe as long as your router does not forward port 53 from the internet.
  • WEBPASSWORD_FILE and secrets: Pi-hole reads the password from pihole_password.txt at start, so it never appears in compose.yaml.
  • ./etc-pihole: settings, lists and history live here, so they survive updates.

Start it. On Ubuntu, the first try fails:

Terminal
docker compose pull --quiet
docker compose up -d
docker compose up -d fails: failed to bind host port 0.0.0.0:53/tcp: address already in use
The usual 53:53 ports fail on Ubuntu: systemd-resolved got there first.

53:53 means "port 53 on every address of this machine", and systemd-resolved already has 127.0.0.53. Publish the ports on the server's LAN address only. The sed line below edits the four ports in place; change 192.168.1.50 to your own address:

Code
sed -i 's/- "53:53/- "192.168.1.50:53:53/; s/- "80:80/- "192.168.1.50:80:80/; s/- "443:443/- "192.168.1.50:443:443/' compose.yaml && grep -A4 'ports:' compose.yaml
docker compose up -d
docker compose ps --format "table {{.Name}}\t{{.Image}}\t{{.Status}}"
sudo ss -lntup "sport = :53"
The four ports now start with 192.168.1.50, the container starts, and ss shows docker-proxy on 192.168.1.50:53 next to systemd-resolved
1: the ports now name the server's LAN address. 2: the container starts. 3: the health check runs. 4: Pi-hole on 192.168.1.50:53, systemd-resolved still on 127.0.0.53.

Check the logs once. They show the password source, the versions and that DNS is listening:

Terminal
docker compose logs pihole | grep -i -E "password|version is|FTL started|listening on|WARNING" | head -14
First start logs: password set from the file, Core v6.6, Web v6.6.1, FTL v6.9, FTL started, capability warnings, listening on port 53
The password came from the secret file and FTL listens on port 53. The production section deals with the warnings.

Step 2: Log in to the web interface

Open http://192.168.1.50/admin from a computer on the same network. Print the password once with cat pihole_password.txt, paste it, and log in. Store it in your password manager.

Pi-hole v6 login page at http://192.168.1.50/admin/login, with the password typed and the Log in button under a note about HTTPS
1: the password from pihole_password.txt. 2: Log in.

Step 3: Test one device, then point your router at Pi-hole

Before you change anything for the whole house, ask Pi-hole directly from one computer. dig comes with the dnsutils package on Debian and Ubuntu:

Code
dig @192.168.1.50 example.com +noall +answer +stats | grep -E "IN|Query time"
dig @192.168.1.50 pagead2.googlesyndication.com +short
dig @192.168.1.50 www.google-analytics.com +short
From the laptop: example.com resolves in 162 ms, pagead2.googlesyndication.com and www.google-analytics.com get 0.0.0.0
From a laptop on the same network. 1: a normal name resolves. 2-3: ad and tracker names get 0.0.0.0.

Now make every device use it. In your router's LAN or DHCP settings, set the DNS server to 192.168.1.50. If there is a second DNS field, leave it empty or put the same address: devices use the second server whenever they like, and the lookups that go there are not filtered. Reconnect a device to Wi-Fi so it gets the new setting, then check that its address shows in the Query Log.

Some routers hand out their own address and pass lookups on to Pi-hole. Blocking still works, but every lookup then shows the router as the client, and the per-device rules of step 7 cannot tell your devices apart. Android phones with Private DNS set to a provider's hostname skip Pi-hole completely (how DNS works on Android).

Step 4: Read the dashboard

Pi-hole dashboard: 159 total queries, 39 queries blocked, 24.5% blocked, 81,677 domains on lists, 4 active clients
1: the four counters after a few rounds of test traffic. The 81,677 domains come from the one list Pi-hole adds on its own.

The four boxes are clickable: Queries Blocked opens the list of blocked lookups, and Domains on Lists opens your lists. Lower on the page you will find the top allowed and blocked names and the top clients, the first place to look when a device behaves oddly.

Step 5: Choose upstream DNS servers and turn on DNSSEC

Pi-hole answers blocked names itself, and asks an upstream server for every other name. In Docker the default upstream is Google with ECS (EDNS Client Subnet), which passes part of your public IP address on to the DNS servers of the sites you visit, so they can pick a server near you. We switched to Cloudflare under Settings, DNS:

Settings, DNS: Google (ECS, DNSSEC) unticked, both IPv4 boxes of Cloudflare (DNSSEC) ticked, and the Save & Apply button
1: the Docker default, Google with ECS. 2: Cloudflare's two IPv4 addresses instead. 3: Save & Apply.

DNSSEC lets Pi-hole check that answers were not changed on the way. It is off by default. Switch the page to Expert mode (top right), tick Use DNSSEC and save:

Settings, DNS in Expert mode: Use DNSSEC ticked, with the rate limit of 1000 queries in 60 seconds on the same page
Expert mode. 1: Use DNSSEC. 2: Save & Apply. The rate limit on the left (1000 queries per 60 seconds per device) is the default.

The ad flag in the answer proves it works. dnssec-failed.org is a test domain with a broken signature:

Terminal
docker exec pihole pihole-FTL --config dns.upstreams; docker exec pihole pihole-FTL --config dns.dnssec
dig @192.168.1.50 example.com +dnssec +noall +comments | grep -E "status|flags"
dig @192.168.1.50 dnssec-failed.org +noall +comments | grep status
DNSSEC test: before, dnssec false and the flags qr rd ra; after, dnssec true and the flags qr rd ra ad; dnssec-failed.org gets SERVFAIL both times
1-3: before. 2: no ad flag. 3: the broken test domain already fails, because Cloudflare checks signatures itself. 4-6: after Use DNSSEC: 5: the ad flag (authenticated data).

Expert mode also shows the settings your compose file controls. They have a padlock and cannot be changed here:

Interface settings with a padlock icon; Permit all origins is selected and locked because compose.yaml sets it
1: the padlock: this setting comes from compose.yaml. 2: Permit all origins, the mode a Docker bridge network needs. Read the warning under it.

Step 6: Add blocklists and update gravity

Pi-hole starts with one list, StevenBlack's hosts file (81,677 domains in our test). We added HaGeZi's Pro list, a well-kept list of ads, trackers and malware, in its Adblock format, the format its author gives for Pi-hole. Under Lists, paste the address and a comment, then Add blocklist:

Code
https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.txt
Lists page: the address of HaGeZi's Pro list in Adblock format and a comment typed, next to the Add blocklist button; StevenBlack's list is already in the table
1: the list address and a comment. 2: Add blocklist. The row below is the default list, StevenBlack's hosts file.

A new list does nothing until gravity runs. Open Tools, Update Gravity, and press Update:

Update Gravity: Success; StevenBlack 81677 exact domains, HaGeZi Pro 247196 ABP-style domains, 328873 gravity domains in total
1: Success. 2: what each list gave, and the total: 328,873 domains.

HaGeZi Pro added 247,196 domains. Pi-hole updates every list on its own once a week (a job inside the container, early on Sunday morning). The extra list costs some memory:

BlocklistsDomainsMemory (docker stats)
StevenBlack only (default)81,67744.46 MiB
StevenBlack + HaGeZi Pro328,87369.18 MiB
docker stats: 44.46MiB with the default list, 69.18MiB after HaGeZi Pro was added
1: with the default list. 2: after HaGeZi Pro.

More lists are not always better: every list you add is one more source of false blocks. When a name is blocked and you want to know why, ask Pi-hole:

Terminal
docker exec pihole pihole -q pagead2.googlesyndication.com
pihole -q pagead2.googlesyndication.com: found in HaGeZi's Pro list as ||googlesyndication.com^ and in StevenBlack's hosts list
pihole -q tells you which list blocks a name, and which line of it.

Step 7: Groups and clients: extra rules for a child's phone

Every device starts in the Default group and gets the same blocking. To give one device extra rules, make a group, put the device in it, and attach the rules to the group. First, Groups, add "Kids":

Group management: a new group named Kids with the comment Children's devices: extra blocks, and the Add button
1: the group name and a comment. 2: Add.

Then Clients: pick the device's address, give it a name, and choose its groups. Keep Default ticked: your blocklists belong to the Default group (see the Group assignment column on the Lists page), so a device outside it gets none of them.

Client group management: client 192.168.1.22 with the comment Kids phone and the groups Default and Kids, then the Add button
1: the device's address and a name. 2: both groups. Default keeps the normal blocking, Kids adds the extra rules. 3: Add.

Watch out: the form keeps the groups you chose last. When we added the laptop and the TV right after the phone, they were saved in Kids too. Check the Group assignment column after each add, and fix a row with its own group box: untick Kids and press Apply.

List of configured clients: 192.168.1.22 Kids phone in both groups, 192.168.1.21 Laptop and 192.168.1.23 TV in Default only
1: the kids phone in Default and Kids. 2: the laptop and the TV in Default only, after the fix in the table.

Now the rule. Under Domains, RegEx filter, this expression matches TikTok's site, app and video names. Set the group to Kids only (untick Default), then Add to denied domains:

Code
(\.|^)(tiktok|tiktokv|tiktokcdn)\.com$
Domain management, RegEx filter tab: the expression for tiktok.com, tiktokv.com and tiktokcdn.com, a comment, the group Kids, and Add to denied domains
1: the expression and a comment. 2: the group: Kids only. 3: Add to denied domains.

The test machine at the phone's address gets 0.0.0.0 for TikTok; the laptop does not:

From the kids phone address, www.tiktok.com and a TikTok app domain get 0.0.0.0; from the laptop TikTok resolves; ads stay blocked on the phone
1-2: TikTok's site and app names, blocked for the kids phone. 3: the laptop is not affected. 4: the phone keeps the normal ad blocking (Default group).

DNS rules stop the easy way in, not a determined teenager: a phone on mobile data, a VPN app or a browser with its own DNS over HTTPS goes around Pi-hole. Use the phone's own parental controls as well.

Step 8: Allow a site that stopped working

Sooner or later a list blocks something you need, often a link in an email that goes through a click-tracking name. Find it in the Query Log (the search box sits under the table) and press Allow on its row:

Query Log searched for ad.doubleclick.net: three blocked queries from 192.168.1.21, each with an Allow button
1: the search box under the table. 2: the blocked query and its Allow button.

Pi-hole adds an exact allow rule for that name under Domains, with the comment "Added from Query Log", for the Default group. Before and after, from the laptop:

From the laptop: ad.doubleclick.net gets 0.0.0.0 and curl cannot connect; after Allow it resolves to 142.251.142.134 and curl gets HTTP 301
1-2: blocked: the link cannot open. 3-4: after Allow.

Step 9: Local DNS records: names for your server and devices

Pi-hole can answer for names on your own network. Use the home.arpa ending: it is reserved for home networks, so it never clashes with a real site. Under Settings, Local DNS Records, add pihole.home.arpa with the server's address:

Local DNS Settings: the domain pihole.home.arpa and the IP 192.168.1.50 typed in the Local DNS records table, next to the green plus button
Settings, Local DNS Records. 1: the name and the address. 2: the plus button saves it.
dig pihole.home.arpa returns 192.168.1.50, and curl to http://pihole.home.arpa/admin/ gets a 302 to the login page
The new name works on every device that uses Pi-hole.

Do the same for each device (we added laptop.home.arpa, kids-phone.home.arpa and tv.home.arpa). Pi-hole then also knows the name for each address, and the dashboard and the Query Log show names instead of numbers, as in the screenshot at the top of this guide.

Step 10: Back up and restore (Teleporter, then a full copy)

Teleporter, under Settings, saves your setup in one zip file: settings, groups, clients, domains and the list of lists. Ours was 25 KB. Read the warnings on the page: the file holds sensitive data (store it like a password, and export over HTTPS when you can), and the long-term query history is not in it.

Teleporter page: Export your Pi-hole's configuration, with the warnings about sensitive data and the separate long-term database, and the Export button
Settings, Teleporter. 1: the export side, with its two warnings. 2: Export.

We tested a real restore: deleted the pihole.home.arpa record, imported the zip on the right side of the same page, and checked again.

Importing a Pi-hole teleporter file: Import successful with the list of processed files, then Please run gravity
1: what came back: settings, groups, lists, domains and clients. 2: the lists themselves are downloaded again by gravity.
Restore test: after the record was deleted, pihole.home.arpa gets NXDOMAIN; after the Teleporter import it answers 192.168.1.50 again; ads stay blocked
1: the record deleted on purpose. 2: back after the import. 3: blocking still works.

After an import, run gravity (Tools, Update Gravity, or docker exec pihole pihole -g) so Pi-hole downloads the lists again.

For a full copy, including the query history and the HTTPS key, copy the whole data folder. Pi-hole stops for the few seconds tar needs, so the databases are copied in a clean state, and starts again even if the copy fails. The files belong to the container's user, so tar needs sudo; the second line gives the file back to you and makes it private:

Terminal
cd ~/pihole
docker compose stop && sudo tar -czf ~/pihole-backup-$(date +%F).tar.gz etc-pihole compose.yaml; docker compose start
sudo chown "$(id -u):$(id -g)" ~/pihole-backup-*.tar.gz && chmod 600 ~/pihole-backup-*.tar.gz && ls -lh ~/pihole-backup-*.tar.gz
Pi-hole stops, sudo tar makes a 21M backup and Pi-hole starts again; the file is -rw------- and holds pihole-FTL.db, gravity.db, tls.pem, pihole.toml and compose.yaml
1: Pi-hole stops for the copy and starts again. 2: the backup, readable only by you. 3: what it holds, including the query history that Teleporter leaves out.

Keep a copy off the server. We restored from this file for real: the commands replace the data folder with the one in the backup.

Terminal
cd ~/pihole
docker compose down
sudo rm -rf etc-pihole && sudo tar -xzf ~/pihole-backup-*.tar.gz && ls
docker compose up -d
Full restore test: docker compose down, the data folder replaced from the backup, docker compose up -d, healthy, and the kids rule, the local name and ad blocking all back
1-3: a real restore from the file. 4: healthy. 5: the kids' TikTok rule is back. 6: the local name and the ad blocking too.

Production setup: the hardened compose file

The quick-start file works, but it leaves a few things open. This is the file we ended with, tested line by line:

YAML
services:
  pihole:
    image: pihole/pihole:2026.11.0
    container_name: pihole
    hostname: pihole
    restart: unless-stopped
    ports:
      - "192.168.1.50:53:53/tcp"
      - "192.168.1.50:53:53/udp"
      - "192.168.1.50:80:80/tcp"
      - "192.168.1.50:443:443/tcp"
    environment:
      TZ: America/New_York
      FTLCONF_dns_listeningMode: ALL
      FTLCONF_dns_reply_host_force4: "true"
      FTLCONF_dns_reply_host_IPv4: 192.168.1.50
      FTLCONF_ntp_sync_active: "false"
      WEBPASSWORD_FILE: pihole_webpasswd
    secrets:
      - pihole_webpasswd
    volumes:
      - ./etc-pihole:/etc/pihole
    cap_add:
      - SYS_NICE
    cap_drop:
      - NET_RAW
    mem_limit: 256m
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
secrets:
  pihole_webpasswd:
    file: ./pihole_password.txt
  • Ports on the LAN address: from step 1. Pi-hole does not listen on the server's other addresses.
  • FTLCONF_dns_reply_host_force4 and FTLCONF_dns_reply_host_IPv4: Pi-hole answers pi.hole with the address the question arrived on, and inside Docker that is the container's own address. With these two lines, http://pi.hole/admin opens on every device that uses Pi-hole.
  • FTLCONF_ntp_sync_active: "false": Pi-hole will not try to set the server's clock (the server keeps its own time), and the CAP_SYS_TIME warning goes away.
  • cap_add: SYS_NICE: lets FTL raise its own priority, as the image's own example file allows. Setting FTLCONF_misc_nice: "-999" instead did not stop the warning in our test.
  • cap_drop: NET_RAW: Pi-hole's Docker notes say FTL uses it for DHCP only. For the same reason the file does not add NET_ADMIN.
  • mem_limit: 256m: a ceiling. A full gravity update ran inside it without being stopped.
  • Log rotation: Docker keeps at most three 10 MB log files instead of one that grows forever.
Terminal
docker compose up -d
Before the fix pi.hole answers 172.18.0.2 and the admin page times out; after it pi.hole answers 192.168.1.50 and the page answers 302
1-2: without the fix, pi.hole points at the container's own address, which no device can reach. 3-4: with the two settings.

We also tried security_opt: no-new-privileges:true, a common hardening line. With it, FTL cannot pick up the rights the image gives its program:

With no-new-privileges, FTL logs that CAP_NET_BIND_SERVICE, CAP_SYS_NICE and CAP_CHOWN are not available
With no-new-privileges, FTL starts without the rights the image gives it.

DNS still answered in that test, but FTL ran without three of the rights it expects, so we left the line out. The checks on the final file:

Terminal
docker compose ps --format "table {{.Name}}\t{{.Image}}\t{{.Status}}"
docker compose logs pihole --since 3m | grep -E "WARNING|ERROR" | cut -c1-160
docker top pihole -o pid,uid,comm
docker exec pihole id pihole
Final container: healthy, one remaining warning, FTL running as uid 1000 (the pihole user), pi.hole answering 192.168.1.50 and ads blocked
1: healthy. 2: the one line left (see below). 3-4: FTL runs as the pihole user, not root. 5: pi.hole works and blocking too.

One warning stays: Trying to free NULL pointer in readEnvValue(). It came with every start in our tests, also with the quick-start file, and nothing failed; it is printed by FTL while it reads its environment variables, not caused by a line of this file. Last, a full list update under the memory limit:

Terminal
docker exec pihole pihole -g | tail -n 6
docker stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}" pihole
docker inspect pihole --format "OOMKilled={{.State.OOMKilled}} restarts={{.RestartCount}}"
A full gravity update inside the 256 MiB limit: Done, 37.36MiB used, OOMKilled=false, restarts=0
1: a full list update inside the limit. 2: 37.36 MiB of 256 MiB. 3: never stopped for memory.

HTTPS for the admin page

Pi-hole also serves the admin page over HTTPS on port 443, with a certificate it makes for itself for the name pi.hole:

Terminal
curl -sk -o /dev/null -w "%{http_code}\n" https://192.168.1.50/admin/login
echo | openssl s_client -connect 192.168.1.50:443 2>/dev/null | openssl x509 -noout -subject -issuer -enddate
curl -k to https://192.168.1.50/admin/login returns 200; openssl shows a certificate for CN=pi.hole issued by CN=pi.hole, O=Pi-hole, valid until Jan 11 2027
1: HTTPS answers. 2: the certificate Pi-hole made for itself: name pi.hole, valid until 11 January 2027.

Browsers warn about a certificate like this, because no one they trust signed it. On your own network you can accept it once: the password still travels encrypted. The certificate is valid for 47 days, and the comments in pihole.toml say Pi-hole renews certificates it made itself two days before they expire. For a certificate without the warning, use a local certificate authority (local HTTPS with mkcert) and point webserver.tls.cert to a PEM file that holds both the certificate and its key.

Update Pi-hole in Docker

In Docker you do not update Pi-hole from inside the container: you change the image tag and start a new container on the same data. We tested it on a second install that started on 2026.10.1, with DNSSEC on and one local record:

Update test, before: image pihole/pihole:2026.10.1 with Core v6.5 and FTL v6.8, DNSSEC true and a local record, then the tag changed to 2026.11.0
Update test on a second install. 1: 2026.10.1 (Core v6.5, FTL v6.8). 2: two settings to watch. 3: the new tag.
  1. Read the release notes of the new tag (GitHub, docker-pi-hole).
  2. Make the full backup from step 10.
  3. Change the tag, pull and restart, then check the health and the versions:
Code
sed -i 's|pihole/pihole:2026.10.1|pihole/pihole:2026.11.0|' compose.yaml && grep image: compose.yaml
docker compose pull --quiet && docker compose up -d
docker compose ps --format "table {{.Name}}\t{{.Image}}\t{{.Status}}"
docker exec pihole pihole version
docker image rm pihole/pihole:2026.10.1
After docker compose pull and up -d: 2026.11.0 healthy, Core v6.6, FTL v6.9, DNSSEC still true, the local record still answers, the old image removed
1: pull and restart. 2: healthy. 3: the new versions. 4-5: the settings and the local name survived. 6: the old image removed.

The settings and the local name came through. Keep a date tag rather than latest: you decide when an update happens, and going back is one tag change plus your backup.

Troubleshooting

What you seeCauseFix
failed to bind host port 0.0.0.0:53/tcp: address already in usesystemd-resolved uses port 53Publish the ports on the server's LAN address (step 1)
pi.hole does not open, or dig pi.hole gives 172.18.0.2Pi-hole answers with the container's addressFTLCONF_dns_reply_host_force4 and FTLCONF_dns_reply_host_IPv4 (production section)
The laptop or TV gets the kids' rulesThe client form kept the groups of the last clientFix the row in the Clients table, then press Apply (step 7)
A setting has a padlock and cannot be changedIt is set in compose.yamlChange it there and run docker compose up -d
CAP_SYS_NICE or CAP_SYS_TIME warningsDocker does not give these rights by defaultcap_add: SYS_NICE and FTLCONF_ntp_sync_active: "false"
CAP_NET_BIND_SERVICE and CAP_CHOWN warningsno-new-privileges in the compose fileRemove that line
"Please run gravity" after an importTeleporter does not carry the downloaded listsTools, Update Gravity, or docker exec pihole pihole -g
A site broke after you added a listOne list blocks a name it needspihole -q name shows the list; Allow it from the Query Log (step 8)

Frequently asked questions

Is Pi-hole free?

Yes. Pi-hole is free and open source, and the Docker image costs nothing. The project lives on donations; the login page has the link.

Do I need a Raspberry Pi for Pi-hole?

No. The name comes from the Raspberry Pi, but the Docker image runs on 64-bit and 32-bit Intel, AMD and ARM machines. Any small Linux machine that stays on will do; this guide used an Ubuntu server. What matters is a fixed address and a machine that does not sleep.

Which ports does Pi-hole use in Docker?

53 over TCP and UDP for DNS, 80 for the admin page and 443 for the admin page over HTTPS. Port 67/udp is only for Pi-hole's DHCP server and 123/udp only if you use it as a time server. Publish them on the server's LAN address, never on your router's internet side.

How much memory does Pi-hole need?

Very little. In our test it used 44.46 MiB with the default list and 69.18 MiB with 328,873 blocked domains, and a full list update ran inside a 256 MiB limit. A machine with 1 GB of RAM has plenty of room.

Why do I still see some ads?

Pi-hole blocks by name. Ads that come from the same name as the content cannot be blocked without breaking it, and YouTube is the best-known case: its ads come from the same servers as the videos. A device that uses another DNS server (mobile data, a VPN, Private DNS on Android or DNS over HTTPS in the browser) skips Pi-hole. If a device's address never shows in the Query Log, it is not using Pi-hole.

Can I use Pi-hole as my DHCP server in Docker?

You can, but it needs more: port 67/udp, the NET_ADMIN right, and either host networking or a DHCP relay on your router, because DHCP broadcasts do not cross Docker's bridge network. For most homes it is simpler to keep the router's DHCP and only change its DNS server, as in step 3.

Can I put Pi-hole on the internet to use it away from home?

No. Do not forward port 53 or the admin ports on your router. An open DNS server gets abused for attacks on others, and the admin page should never face the internet. To use Pi-hole on the go, connect home through a VPN such as Tailscale and use Pi-hole's address as your DNS server there.

Sources

Yassine

Yassine

Yassine founded IGProd to educate the visitors with technological tutorials. These helpful guides are available for all sorts of professionals and novices, whether they work in technology or not!

Surf freely 💗

Leave a comment

Your email address will not be published. Required fields are marked *

Your experience on this site will be improved by allowing cookies Cookie Policy