Skip to content

Instantly share code, notes, and snippets.

@PickledDragon
Last active January 21, 2026 22:03
Show Gist options
  • Select an option

  • Save PickledDragon/5357e1f31492721e1e368fc875e73791 to your computer and use it in GitHub Desktop.

Select an option

Save PickledDragon/5357e1f31492721e1e368fc875e73791 to your computer and use it in GitHub Desktop.
Quadlet file to run pihole as a systemd managed podman container on RedHat Enterprise Linux 10
# pihole.container
# This is a podman quadlet file to run Pi-hole as a container
# On my lab this runs in the context of a limited user account named `pihole`
# This file goes to `/home/pihole/.config/containers/systemd/pihole.container`
#
# Here are the steps to set it up. Oh for sure there are other ways to get it done, but this is my way!
# 0. Enable user lingering for the `pihole` user, if not already done:
# sudo loginctl enable-linger pihole
# 1. Open a shell as the `pihole` user:
# sudo machinectl shell pihole@
# 2. Create the Quadlet directory and save this file as pihole.container:
# mkdir -p ~/.config/containers/systemd
# # Paste the contents of this file into ~/.config/containers/systemd/pihole.container
# 3. Create persistent data directories in the user's home:
# mkdir -p ~/pi-hole/etc-pihole
# 4. Run systemd daemon-reload to pick up the new quadlet file (from within the user context):
# systemctl --user daemon-reload
# 5. Start the container:
# systemctl --user start pihole.container
# 6. Verify that the container is running:
# systemctl --user status pihole.container OR podman ps
[Unit]
Description=Pi-hole DNS container
After=network-online.target
Wants=network-online.target
[Container]
ContainerName=pihole
Environment=TZ=Europe/Amsterdam
Environment=FTLCONF_webserver_api_password=AddYourPasswordHere
Environment=FTLCONF_dns_listeningMode=ALL
# Tagged with the current docker image tag of the pihole container image 2025.11.1
Image=docker.io/pihole/pihole:2025.11.1
# I am using non-standard ports and using my firewall to forward the standard ports to these
PublishPort=1053:53/tcp
PublishPort=1053:53/udp
PublishPort=9443:443/tcp
# Persist the data on the host in the user's home directory
Volume=%h/pi-hole/etc-pihole:/etc/pihole:Z
[Service]
Restart=always
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment