Blue and Red Cargo Containers

Starting rootless containers at boot with Podman

I’m building out a new server at home, and decided to try out Podman instead of Docker for running containers. Everything is a bit different. I wanted some containers to start on boot, as I had previously setup with Docker. I found an article that got me most of the way there, but it was missing a few key things for rootless containers. Here’s how I got a Vaultwarden container I setup, named vaultwarden, booting for user username and group groupname, on an Ubuntu / systemd based system.

Create a service file in /etc/systemd/system/vaultwarden.pod.service

Description=Vaultwarden/Bitwarden Server (Rust Edition)

ExecStart=/usr/bin/podman start -a vaultwarden
ExecStop=/usr/bin/podman stop vaultwarden


The following command allows the container to run when the user isn’t logged in (further details):

sudo loginctl enable-linger username

Reload the daemon:

sudo systemctl daemon-reload

And, your rootless Podman container should run at boot.

Leave a Reply

Your email address will not be published. Required fields are marked *