Overview
This page documents Podman Quadlet deployment, a permanent and production-ready way to run Podman containers as systemd user services. Quadlet units are placed in ~/.config/containers/systemd/ and automatically generate the corresponding systemd units.
Why Quadlet: Quadlet provides a more permanent and maintainable solution compared to podman compose. It integrates with systemd, supports boot-start persistence, and is ideal for long-running services on both homelab VMs and laptop systems.
File Layout
For a multi-container stack, organize your units like this:
~/.config/containers/systemd/
├── <service1>.build # Build unit (for custom images)
├── <service1>.container # Service 1 container
├── <service2>.container # Service 2 container
└── <network>.network # Bridge network (optional)
Example from LightRAG:
~/.config/containers/systemd/
├── docling.build # Build unit (for custom images)
├── docling.container # Docling service
├── lightrag.container # LightRAG service
└── rag.network # Bridge network
Activation
mkdir -p ~/.config/containers/systemd
# copy unit files there
podman compose down # if any old containers are running
systemctl --user daemon-reload
systemctl --user start <service1>.service <service2>.service
loginctl enable-linger <username> # boot-start without loginExample from LightRAG:
systemctl --user start docling.service lightrag.service
loginctl enable-linger ai # boot-start without loginQuadlet Quirks and Caveats
-
Quadlet-generated units are transient —
systemctl --user enabledoes not work on them. Use[Install] WantedBy=default.target(which Quadlet honours) plusloginctl enable-linger <username>. -
depends_on→Requires=+After=. Start ordering only, not readiness. Container A calling Container B at startup tolerates this. -
mem_limit: 3g→Memory=3g. Rootless caveat: if cgroup memory delegation is not enabled, the limit is silently ignored. Check:cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/user@$(id -u).service/cgroup.controllersLook for
memory. -
Quadlet does not resolve
./. Use absolute paths (e.g.,/home/ai/rag/...). -
Build unit:
<service>.build.servicebuilds before<service>.servicestarts. Rebuild after an image update:systemctl --user restart <service>.build.service systemctl --user restart <service>.service -
Container name consistency: If your compose stack used
container_name: <name>, the Quadlet unit should explicitly setContainerName=<name>to preserve the DNS name on the bridge network.
Optional .target
A .target unit (in ~/.config/systemd/user/) groups the containers for start/stop-as-one:
[Unit]
Description=<Stack Name> (<service1> + <service2>)
Wants=<service1>.service <service2>.service
[Install]
WantedBy=default.targetIn each container unit, add PartOf=<stack>.target under [Unit] and WantedBy=<stack>.target under [Install]. Then systemctl --user start <stack>.target. Not strictly needed for two services (Service A’s Requires= already pulls Service B in), but useful if the stack grows.
Example from LightRAG:
[Unit]
Description=RAG stack (Docling + LightRAG)
Wants=docling.service lightrag.service
[Install]
WantedBy=default.targetLogs
# Interleaved journal for both containers
journalctl --user -u <service1>.service -u <service2>.service -f
# Warnings and above only
journalctl --user -u <service1> -u <service2> -p warning -f
# Since last boot
journalctl --user -u <service1> -u <service2> -bOptional shared syslog tag: add LogDriver=journald and PodmanArgs=--log-opt tag=<stack> under [Container] in each unit, then journalctl --user -t <stack> -f.
journalctl -u <stack>.target shows the target’s own messages, not member output. Use the shell function pattern or the tag.
Related Documentation
- Podman Compose - Historical compose deployment
- Auth and API Keys - Authentication configuration
- LightRAG Stack - Comprehensive guide