Quadlet: Running Podman containers under systemd
mo8it.com
mo8it.com
The only downside is they're not really an answer to docker-compose on the local development side and the podman team doesn't seem super interested in tackling that segment. User containers are nice for long running local test infra (i.e. a background database) but are too clunky for a normal compile-> docker compose up -> test -> docker compose down loop. The best answer is either .kube Quadlets (kubernetes plays) or using docker compose [0] against the podman socket.
Either way, I've enjoyed using quadlets enough that I've spent the last few months writing a gitops tool for managing them in my spare time. They just feel like the right way of managing containerized servers.
[0] NOT podman-compose, which the article points out as being not very good and under-developed. Podman implements most of the compose spec so you can use docker compose for most situations. I suspect many people who tried Podman when RH first started pushing it ran into Podman 3 being kinda of bleh and podman-compose being awful and bounced off it.
Ultimately my systemd just executes `podman compose up`.
What are the benefits of quadlets as opposed to letting compose do its job?
Update: podman runs under my user, no demon whatsoever.
I drop a .container file into ~/.config/containers/systemd/ and the rest is taken care of. I use yadm to manage my dot files and that way it ends up on all the systems I want it.
Never tried podlet, though. I just write the container file directly.
If you're already running podman containers as systemd units, then the main benefit would probably be better systemd integration and without having to write separate compose files. If you're fine with the latter than A) you're the only person I've met who's happy with podman compose and B) you probably won't gain that much from switching to quadlets. Out of curiosity, does systemd spinning up podman-compose still properly keep the resulting container processes in the same cgroup? If not, that would be a decent benefit to swapping to quadlets.
I am coming from docker files which give me a concise view of what services I’m configuring and how. The process of converting these tools into a (bunch of?) quadlets is where I got stuck.
As far as I could see at the time all containers in one compose file ended up in the same cgroup.
I’m not using podman compose but docker compose over the socket created by podman.
Can anyone share their experience with Podman + Docker Compose in recent times? It was a really great workflow for me at the time.
Then you can use docker contexts to make the default context your podman socket. Then you just use `docker compose` as you normally would. I usually use this with rootless podman installs.
I just took a look at the socket activation docs[0]. Is my understanding correct that no `compose.yaml` is required, just running `docker-compose up` with the appropriate env var pointing to the socket is enough to trigger a connection and service activation?
[0] https://github.com/containers/podman/blob/main/docs/tutorial...
As far as I remember my podman installations on both fedora and ubuntu came with a podman.socket service that I could enable as easily as running: `systemctl --user enable --now podman.socket`
Then I installed the standalone version of docker-compose: https://docs.docker.com/compose/install/standalone/
I don't remember having to do more to get a working `docker-compose` command.
You can use quadlets on those platform, you just need to put the quadlets file in the `~/.config/containers/systemd/` of the podman machine.
Quadlet wants me to have all the files in `~/.config/containers/systemd`, so they're really not isolated to the project any more, and not in a convenient place to be checked in and shared with other devs (who also have to be using podman). Most still use docker, its what's availabile on codespaces and other hosted dev envs.
So we use docker compose, with a checked-in yaml file. I use podman, so I have to manually add `:Z` to all the volumes, but regular docker chokes on that. I wouldn't mind having an alternative to docker compose for development, but Quadlet doesn't seem like a good fit.
[1] https://www.freedesktop.org/software/systemd/man/systemd-run...
Every once in a while I check up on podman compatibility... But by now I've made my peace with that and accepted that the rootless philosophy is just too different to ever be fully compatible.
This tool is still cool for prod though. I have a couple of hobby projects running on bare metal nodes under handcrafted systemd services (though currently in usermode containerd), I might just try migrating them... Whenever I find the time for that.
This is a similar format that Kubernetes with some nice addition (being able to build container for example).
The kube play can be at the root of your project, you can run `podman kube play project.yaml --build` and there it is! You pods, volume etc. running together.
The Quadlet file can be useful as deployment step, you want to publish your project on a VPS? Use a Kube Quadlet[2] in addition with the `project.yaml` you have!
[1] https://docs.podman.io/en/latest/markdown/podman-kube-play.1...
[2] https://docs.podman.io/en/latest/markdown/podman-systemd.uni...
Podlet can be useful and helpful, but ultimately it doesn’t support many of the features of Docker Compose and doesn’t always provide a clean translation. In particular, Podlet doesn’t support stacking multiple yaml files (e.g., -f docker-compose.yml -f docker-compose.override.yml)
Podlet is a helper. In the long run its better to work with quadlets.
Also, note that if plain quadlets aren't powerful enough for you, quadlets [3] and plain podman [4] also support running a limited set of kubernetes manifests.
Added later: I still haven't figured out how podman handles the 'restart' option in compose files, since podman doesn't have a supervisor daemon. Meanwhile, I know that the 'healthcheck' option depends on systemd timers. Automatic health check didn't work for me when using Podman on a non-systemd distribution (Gentoo). However, I could trigger the health check manually and that would lead to the rest of the setup running to completion.
[1] https://github.com/docker/compose
[2] https://docs.podman.io/en/latest/markdown/podman-system-serv...
[3] https://docs.podman.io/en/latest/markdown/podman-systemd.uni...
[4] https://docs.podman.io/en/latest/markdown/podman-kube-play.1...
How on earth is that possible? Docker compose requires a daemon and the DOCKER_HOST var fo be set.
I always thought using it defeated the point of podman.
Docker contexts [1] is an alternative to DOCKER_HOST variable. It may have been inspired by kubectl contexts (just a speculation). It's more principled than the variable, in my opinion.
> I always thought using it defeated the point of podman.
Podman doesn't have a persistent daemon like Docker's that monitors the running containers. However, taking inputs over a socket is a useful feature in Docker. Podman achieves this without a persistent daemon using systemd socket units [2]. Whenever a request is received at the socket, systemd spins up podman to serve it. Podman keeps listening on the socket and then exits after a short period of inactivity (like 5s). So it's not quite comparable to what Docker does.
[1] https://docs.docker.com/engine/manage-resources/contexts/
[2] https://docs.podman.io/en/stable/markdown/podman-system-serv...
Containers auto update with built in podman tooling, getting at logs and monitoring is through the usual systemd tools. When I need to change something, it's easy to work out where the config files are if I have forgotten and they are easy to read and change. Rootless and daemonless is nice too.
I tried a few things along the way, podman compose felt clunky so I'm glad it is deprecated and it's clear quadlets are the way to go.
There was a learning curve and there's less information out there than with docker, so keep that in mind. I would still lean towards docker and docker compose for local dev to bring a stack of services up and down.
If anyone is interested in doing the same, my configuration can be found here for inspiration: https://github.com/jeppester/coreos-nextcloud
What annoys me is Podman upstream doesn't offer a repo for Debian/Ubuntu. I was stuck at version 4.3.1 on Debian stable, missed many new features and eventually decided to go back to Docker compose.
The proposed workarounds were compiling Podman yourself or using debian/testing.
> There must be an easier way, you might think. Especially if you experienced the convenience that Docker Compose provides.
I really hope this new approach helps people migrate from Docker to Podman. Docker-Compose is the reason a lot of people resist switching (including myself), and admittedly, Podman didn't really have an answer until Quadlets. If you were hesitant about migrating from Docker because of Docker-Compose, Podman with Quadlets is a much more comparable alternative. You probably won't miss Docker as much as you think, and you'll benefit from enhanced security running rootless containers.
Normally system services run as system users in the system systemd-session, but for rootless containers the services reside in the user systemd sessions of the system user. I'd love to be able to run rootless quadlets within the system session.
I haven't found a way around that and would be very thankful for pointers.
Likewise. I'd also like to be able to run rootless quadlets with the DynamicUser= option. DynamicUser= has been a great way to restrict privileges for system services, and it just doesn't fit with podman right now.
Rather than using [container] they used [kube] and were able to bring along standard Kubernetes YAML making it quite portable.
Recently I took the journey to deep dive into Quadlets, and see how it can be integrated into Podman Desktop. With the extension system we have (very similar to VS-Code), I created an extension called `Podman Quadlets` and wrote a blog on our website[2].
It integrate with Podlet[3] (but I am trying to move away from it, as I am not able to contact the author to address some issues, especially on Windows[4])
With this extension, you can list, generate, remove, edit, access journalctl logs of Quadlets from Podman Desktop. I will continue to work on it, improving it, and adding new features, so if you have some feedback don't hesitate! Suggestion, bug report, all are welcome[5]
You can check it out on the extension repository[6] or, if you have Podman Desktop installed, you can found it in `Extensions > Catalog > Podman Quadlet`
If you are curious to learn some basics about Podman Quadlets, I made a talk at FOSDEM 2025 on the topic[7]
[1] https://podman-desktop.io/
[2] https://podman-desktop.io/blog/podman-quadlet
[3] https://github.com/containers/podlet
[4] https://github.com/podman-desktop/extension-podman-quadlet/i...
[5]https://github.com/podman-desktop/extension-podman-quadlet/i...
[6] https://github.com/podman-desktop/extension-podman-quadlet
[7] https://fosdem.org/2025/schedule/event/fosdem-2025-5383-runn...
https://github.com/containers/podman/blob/main/docs/tutorial...
> What do you get if you squash a Kubernetes kubelet? A quadlet
The idea is that podman doesn't have a supervisor daemon like docker does. Kubelet also performs more or less the same function. But podman can leverage the facilities in systemd to perform the same function. In a way, quadlets integrate a kubelet's functionalities into systemd (rather incompletely). That's the reason for the pun involving squashing a cube into a quadrilateral (a square actually).
I kept using things like Docker Compose for simple services until now but it always felt like a temporary solution.
So I try every year and every time I am not convince this thing is solid/polished enough yet. I am confident 2025 is gonna be a go according to the positive comments here.
My sincere question is: why did it took about 10 years to have a basic working integration between the service manager and containers (and by containers I mean the way we run most non system services nowadays)?
My intuition is there must be some ugly politics involved between IBM/Redhat, Systemd and some other actors but I can't figure it out....
> https://mo8it.com/blog/quadlet/#too-many-files
IMHO bad take- give people an option to consolidate build/orchestration into 1 file without relying on an external image repository (... like the author is doing with docker.io... ugh).
Being "all in one" makes docker-compose still competitive. In the year 2025, quadlet makes top-level project directories very busy.
Could be OK if all the files ended up in a sub-directory but systemd highly restricts usage of ".." traversal; so there's an explosion of files at the top level of your project.
As many projects still only mention docker/compose, it would be great to have a community maintained quadlet store - something like https://github.com/dwedia/podmanQuadlets?
The only issue is that they're not widespread yet, so often I have to spend the time to port a Dockerfile to a set of quadlet files. I've gotten fairly proficient at it by now, but I can see why most people would rather use podman compose instead.
[1] https://docs.podman.io/en/latest/markdown/podman-system-serv...
Edit: looks like Docker release docker-compose v2 as a go standalone tool (https://docs.docker.com/compose/install/standalone/). I stand corrected.