2 min read
Running Pi-hole as a Podman Quadlet on Fedora CoreOS

Here’s how to schedule your Pi-hole container to run automatically on boot using a Quadlet file—no manual enabling required. These steps assume you’re on Fedora CoreOS as of February 2025, with a recent Podman version.

Step 1: Create the Quadlet File

Fedora CoreOS uses /etc/containers/systemd/ for Quadlet files, which define containers as systemd services. Let’s create pihole.container:

sudo nano /etc/containers/systemd/pihole.container

Paste this (modify the password and network info with yours):

[Unit]
Description=Pi-hole Container
After=network-online.target
Wants=network-online.target

[Container]
ContainerName=pihole
Image=docker.io/pihole/pihole
AddCapability=NET_ADMIN
DNS=127.0.0.1
DNS=1.1.1.1
Environment=TZ=America/Denver
Environment=SERVERIP=192.168.1.8
Environment=FTLCONF_webserver_api_password=pwd_please_change_this
Environment=FTLCONF_dns_listeningMode=all
Environment=DNS1=1.1.1.1
Environment=DNS2=1.0.0.1
Environment=DNSSEC=true
Environment=CONDITIONAL_FORWARDING=true
Environment=CONDITIONAL_FORWARDING_IP=192.168.1.1
Environment=CONDITIONAL_FORWARDING_DOMAIN=lan
Volume=pihole_pihole:/etc/pihole:Z
Volume=pihole_dnsmasq:/etc/dnsmasq.d:Z
PublishPort=80:80/tcp
PublishPort=443:443/tcp
PublishPort=67:67/udp
PublishPort=53:53/tcp
PublishPort=53:53/udp

[Service]
Restart=always
TimeoutStartSec=900

[Install]
WantedBy=multi-user.target

Save and exit (Ctrl+O, Enter, Ctrl+X in nano).

Step 2: Reload Systemd

Tell systemd to process the Quadlet file with Podman’s quadlet generator:

sudo systemctl daemon-reload

This generates a transient pihole.service in /run/systemd/generator/.

Step 3: Start the Container

Kick it off manually the first time:

sudo systemctl start pihole.service

Check it’s running:

sudo podman ps -a

You should see your pihole container up and humming.

Step 4: Test Autostart on Reboot

The WantedBy=multi-user.target line ensures Pi-hole starts on boot. Test it:

sudo reboot

After reboot, verify:

sudo podman ps -a

If pihole is running, you’re set—no systemctl enable needed, as Quadlets handle autostart dynamically.

Notes

  • Why No enable? Generated services in /run/ are transient and can’t be enabled traditionally. The [Install] section ties it to the boot process instead.

  • Tweaks: Older Quadlet guides mention Hostname or RestartPolicy, but these are unsupported now—stick to the basics above.

  • Hostname: Defaults to pihole from ContainerName. If you need pi-hole, you’d need a custom workaround or a classic systemd service.

That’s it! Your Pi-hole is now a proper Fedora CoreOS citizen, managed via Podman Quadlets. Enjoy ad-free browsing!