Set Up Rootless Podman from Scratch
Intermediatev1.0.0
Configure rootless Podman with user namespace mappings, storage drivers, networking, and verify the setup with your first rootless container.
Content
Overview
Rootless Podman runs containers entirely in user space without needing root privileges or a background daemon. This is the most secure way to run containers — even if a container is compromised, the attacker only has the unprivileged user's access.
Why This Matters
- -Security — no root daemon, no root containers by default
- -Multi-user — each user has isolated container storage and networking
- -No daemon — containers are direct child processes, not managed by a service
- -Docker compatible — same CLI commands and image format
How It Works
Step 1: Install Podman
Step 2: Configure User Namespace Mappings
Step 3: Configure Storage
Step 4: Run Your First Rootless Container
Step 5: Enable Lingering for Persistent Services
Best Practices
- -Always verify rootless mode with
podman info | grep rootless - -Enable lingering for any user running long-lived containers
- -Use
podman system pruneregularly to reclaim storage - -Configure registries in
~/.config/containers/registries.conf - -Use
podman unshareto inspect user namespace mappings
Common Mistakes
- -Running
sudo podmanout of habit (creates rootful containers) - -Missing subuid/subgid entries (user namespace fails)
- -Not enabling lingering (containers die on logout)
- -Expecting rootless containers to bind port < 1024 (use
sysctl net.ipv4.ip_unprivileged_port_start=80)
FAQ
Discussion
Loading comments...