Axel Verne → Junk Drawer kit → Chapter 4

Chapter 4 — First Light I: Pi-hole on the Pi You Forgot

5 blocks to copy, in the order they appear in the chapter. Nothing here is required to be typed by hand.

The build — Docker path (Pi 3 and up, or any laptop)

4.1 · bash
mkdir -p /srv/lab/compose/pihole && cd /srv/lab/compose/pihole
4.2 · yaml
services:
  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8053:80/tcp"          # web UI on 8053 so it doesn't fight other apps
    environment:
      TZ: "Pacific/Honolulu"   # change to yours
      FTLCONF_webserver_api_password: "pick-a-real-password"
      FTLCONF_dns_listeningMode: "all"
    volumes:
      - /srv/lab/data/pihole:/etc/pihole
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
4.3 · bash
sudo sed -i 's/^#\?DNSStubListener=.*/DNSStubListener=no/' /etc/systemd/resolved.conf
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved
4.4 · bash
docker compose up -d
docker compose logs -f     # wait for "FTL started" then Ctrl-C

The build — bare-metal path (Pi 1, Pi 2, original Zero, or "I don't want Docker on this")

4.5 · bash
curl -sSL https://install.pi-hole.net | bash

← Chapter 3Chapter 5 →

Get the next build in your inbox

An email when a new build write-up goes up: what I ran, on what hardware, and the commands that paste. Free, unsubscribe any time. The kit stays free either way.