Podman has no daemon, which is one of its biggest strengths. It also raises an obvious question: if nothing runs in the background, who starts your containers after a reboot, restarts them when they crash, and collects their logs?
On Linux the answer is systemd, the service manager that already runs everything else on the machine. Quadlet is the tool that connects the two. You describe a container in a short, declarative file, and systemd runs it like any other service. This article explains how Quadlet works and walks through two practical examples.
What Quadlet is
Quadlet is a systemd generator that ships with Podman. It has been part of Podman since version 4.4. At boot, and every time you run systemctl daemon-reload, it reads your Quadlet files and turns them into ordinary systemd service units. Both system-wide (rootful) and per-user (rootless) services are supported.
You never edit the generated service files. You only maintain the short Quadlet file, which looks like any other systemd unit with an extra section such as [Container].
Why not podman generate systemd?
Before Quadlet, the usual approach was podman generate systemd. It created a long service file full of podman run and podman rm commands from a container that already existed. Those files were hard to read and went stale when Podman changed.
That command is now deprecated. The Podman project recommends Quadlet files for running containers or pods under systemd, and the old command only receives urgent bug fixes (podman-generate-systemd man page).
Where the files go
Where you put a Quadlet file decides who runs it:
- Rootless (your own user):
~/.config/containers/systemd/ - Rootful (system-wide):
/etc/containers/systemd/
For most workloads, start rootless. You keep the security benefits of Podman, and you manage the services with systemctl --user.
The file types
Each file extension describes one kind of resource. The file name becomes the service name, and Podman prefixes the resource it creates with systemd-.
web.container: a single container, run asweb.servicedata.volume: a named volume, created bydata-volume.serviceapp.network: a Podman network, created byapp-network.serviceapp.pod: a pod that containers can join, run asapp-pod.serviceapp.kube: containers from a Kubernetes YAML file, run asapp.servicebase.image: an image to pull and cache, viabase-image.serviceapp.build: an image built from a Containerfile, viaapp-build.service
So web.container runs a container named systemd-web under the service web.service. You can override the names with options such as ContainerName=. See the Podman documentation for podman-systemd.unit for every option.
Example 1: A single container
Create the folder and a file called web.container:
nano ~/.config/containers/systemd/web.container
Description=Nginx web server
[Container]
Image=docker.io/library/nginx:alpine
PublishPort=8080:80
AutoUpdate=registry
[Service]
Restart=always
[Install]
WantedBy=default.target
Each section has a clear job:
[Unit]is standard systemd: a description, and dependencies if you need them.[Container]is the Quadlet part. It holds what you would otherwise pass topodman run: the image, ports, volumes, environment variables and so on.[Service]is standard systemd again.Restart=alwaysbrings the container back if it stops.[Install]decides when the service starts.WantedBy=default.targetstarts it when your user session starts.
Now tell systemd to read the file and start the service:
systemctl –user start web.service
curl http://localhost:8080
Note that you do not run systemctl enable. Quadlet services are generated, so systemd treats them as transient. The [Install] section is what makes the service start at boot.
Example 2: A database with a network, a volume and a secret
Real services usually need more than one container. This example runs Postgres with persistent storage, plus Adminer as a small web interface to it. It uses four files in the same folder.
First, store the database password as a Podman secret, so it never appears in a file:
app.network creates a private network for the two containers:
db.volume creates a named volume for the data:
db.container runs Postgres:
Description=Postgres database
[Container]
Image=docker.io/library/postgres:16
Network=app.network
Volume=db.volume:/var/lib/postgresql/data
Secret=db-password,type=env,target=POSTGRES_PASSWORD
[Service]
Restart=always
[Install]
WantedBy=default.target
adminer.container runs the web interface and waits for the database:
Description=Adminer database UI
Requires=db.service
After=db.service
[Container]
Image=docker.io/library/adminer:latest
Network=app.network
PublishPort=8081:8080
[Service]
Restart=always
[Install]
WantedBy=default.target
Notice how the files refer to each other by file name: Network=app.network and Volume=db.volume:.... Quadlet resolves these to the real resources and adds the dependencies for you, so the network and volume always exist before the containers start.
Reload and start both services:
systemctl –user start db.service adminer.service
Open http://localhost:8081 and log in with server systemd-db, user postgres and your password. Containers on the same Podman network reach each other by container name, which is why the server is systemd-db.
Managing the services
Once a container is a systemd service, you manage it with the tools you already know:
- Check status:
systemctl --user status web.service - Follow logs:
journalctl --user -u web.service -f - Restart:
systemctl --user restart web.service - Apply an edited file:
systemctl --user daemon-reload, then restart - See the generated unit and any errors:
/usr/lib/systemd/system-generators/podman-system-generator --user --dryrun
Start at boot without logging in
Rootless services normally start when you log in and stop when you log out. On a server, that is not what you want. Enable lingering for the user once, and the services start at boot:
Keep images up to date
The AutoUpdate=registry line in Example 1 marks the container for automatic updates. Turn on Podman’s update timer, and it checks the registry daily, pulls a newer image if one exists, and restarts the service. If the new container fails to start, Podman rolls back to the previous image.
You can also run podman auto-update --dry-run to see what would change.
Allow time for image pulls
The first start may pull a large image, and systemd gives a service 90 seconds by default. If the start times out, raise the limit in the [Service] section with TimeoutStartSec=900.
Running Kubernetes YAML with Quadlet
If you already have a Kubernetes manifest, for example one created with podman kube generate, a .kube file runs it as a service without rewriting anything:
Description=Web app from Kubernetes YAML
[Kube]
Yaml=webapp.yaml
[Install]
WantedBy=default.target
Place webapp.yaml next to the .kube file. This gives you one set of files that runs under systemd on a single host today and on a Kubernetes cluster later. Quadlet supports only part of the Kubernetes YAML specification, so test the manifest before you rely on it.
Limits and tips
- Linux only. Quadlet needs systemd and cgroup v2. On Windows and macOS it only works inside the Podman machine VM, so it is a tool for Linux servers and workstations.
- One host, not a cluster. Quadlet restarts and updates containers on one machine. It does not spread work across servers or move containers when a host fails. For that, use Kubernetes.
- Ports below 1024 need root. Rootless services publish on ports such as 8080, with a reverse proxy or firewall rule in front.
- Keep the files in Git. A Quadlet folder is plain text, so it is easy to review, version and copy to the next server.
- Debug with the dry run. When a service does not appear after
daemon-reload, the generator’s dry-run output usually names the line it could not parse.
Quadlet fills the space between a single podman run and a full Kubernetes cluster. For a home lab, an edge device or a small set of servers, it is often all you need.