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
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:
And, your rootless Podman container should run at boot.