Self-Hosted Systemd + Rootless Podman Production Templates
A curated set of systemd unit templates, journald drop-ins, and maintenance scripts for running rootless Podman containers on Linux servers. Designed for single-node or small-cluster self-hosting where you want systemd lifecycle management without a full orchestrator.
What’s Included
| Component | Purpose |
|---|---|
systemd/ | Template unit files (*.service, *.timer) for containers, pods, and Quadlet .container/.kube files. |
journald/ | Drop-in configs to cap journal size and keep logs in memory (volatile). |
scripts/ | backup.sh (with 70 GB circuit-breaker), prune.sh, healthcheck.sh. |
examples/ | Ready-to-deploy service definitions for common apps (Caddy, Gitea, Prometheus, etc.). |
Quick Start
# 1. Clone to a persistent location git clone https://github.com/yourorg/selfhosted-podman-templates.git /opt/templates # 2. Install journald drop-in (limits journal to 150 MiB in RAM) sudo mkdir -p /etc/systemd/journald.conf.d sudo cp /opt/templates/journald/volatile.conf /etc/systemd/journald.conf.d/ sudo systemctl restart systemd-journald # 3. Deploy a service (example: Caddy reverse proxy) cp /opt/templates/examples/caddy.container ~/.config/containers/systemd/ systemctl --user daemon-reload systemctl --user enable --now caddy.service Core Templates
1. Container Unit (Quadlet .container)
# ~/.config/containers/systemd/app.container [Unit] Description=My App After=network-online.target Wants=network-online.target [Container] Image=ghcr.io/user/app:latest Exec=/app/entrypoint.sh EnvironmentFile=%h/.config/app/env PublishPort=8080:8080 Volume=%h/app/data:/data:Z Volume=%h/app/logs:/var/log/app:Z # Rootless-specific: map host UID/GID inside UserNS=keep-id [Service] Restart=on-failure RestartSec=10 MemoryLimit=512M CPUQuota=200% [Install] WantedBy=default.target Deploy:
systemctl --user daemon-reload systemctl --user enable --now app.service 2. Pod Unit (Quadlet .kube + systemd)
# ~/.config/containers/systemd/stack.kube apiVersion: v1 kind: Pod metadata: name: monitoring spec: containers: - name: prometheus image: prom/prometheus:v2.54.0 volumeMounts: - name: data mountPath: /prometheus ports: - containerPort: 9090 - name: grafana image: grafana/grafana:10.2.0 volumeMounts: - name: data mountPath: /var/lib/grafana ports: - containerPort: 3000 volumes: - name: data hostPath: path: /home/user/monitoring/data type: DirectoryOrCreate # ~/.config/containers/systemd/stack.service [Unit] Description=Monitoring Stack Requires=network-online.target After=network-online.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/podman kube play --replace %h/.config/containers/systemd/stack.kube ExecStop=/usr/bin/podman kube down %h/.config/containers/systemd/stack.kube [Install] WantedBy=default.target 3. Volatile Journald Drop-in
# /etc/systemd/journald.conf.d/volatile.conf [Journal] Storage=volatile SystemMaxUse=150M RuntimeMaxUse=150M MaxFileSec=1day ForwardToSyslog=no Effect: Journals stay in /run/log/journal, survive reboots only if /run is tmpfs
Free Sample Preview — Self-Hosted Systemd + Rootless Podman Production Templates (2026.11.25)
Includes rootless Podman systemd templates, volatile journald configs, and 70GB circuit-breaker backup scripts.
[Journal] Storage=volatile SystemMaxUse=150M RuntimeMaxUse=150M