How do rootless containers work in Podman?
Quick Answer
Rootless Podman maps the container's root user, UID 0, to an unprivileged UID range on the host via a Linux user namespace, so even a full container escape only grants the attacker the privileges of that unprivileged host user, not real root. This is enforced entirely by the kernel's user namespace feature, not by a daemon or an application-level sandbox.
Detailed Answer
Imagine a company that gives every employee a name badge that says "Manager" only inside a specific building, but the moment they walk out the front door, security systems automatically read their badge as "temp contractor" instead. Even if that employee tries to abuse their in-building "Manager" title to break down a door, once they're outside the building the real-world consequences are limited to what a low-level contractor could actually do, not what an actual manager could do.
Rootless containers exist because containers are not full security boundaries by default — a process running as root inside a container is still, in an unpatched or misconfigured setup, capable of escalating to real root on the host if it escapes the container via a kernel exploit or a dangerous mount. Podman's rootless mode addresses this by leaning entirely on Linux user namespaces, a kernel feature that lets a process see itself as UID 0 while the kernel actually enforces a different, unprivileged UID outside that namespace, so the "root" identity inside the container is cosmetic from the host's point of view.
When you run a rootless podman run, Podman consults /etc/subuid and /etc/subgid to find the block of UIDs and GIDs your host user has been allocated, for example a user might own host UIDs 100000 through 165536, creates a new user namespace, and maps container UID 0 to your real host UID, with the subordinate range covering additional container UIDs. Storage is handled by fuse-overlayfs, a FUSE-based overlay filesystem implementation, because the kernel's native overlay2 driver historically required real root to mount. Networking for rootless containers runs through slirp4netns or pasta, user-space network stacks that don't require root to create network namespaces or manipulate iptables, which is also why ports below 1024 don't bind directly without extra configuration — binding privileged ports is a real root-only kernel operation that user namespaces can't fake.
In production, what matters is making sure every user running rootless containers has a properly sized subuid/subgid allocation, since /etc/subuid entries are often forgotten when provisioning new CI runner users, causing cryptic "newuidmap: not allowed" errors, and monitoring for storage-layer slowness since fuse-overlayfs adds a userspace round-trip per filesystem operation compared to native overlay2, which shows up as elevated I/O latency for write-heavy workloads like build caches or database containers.
The subtle gotcha experienced engineers hit is that "rootless" does not mean "safe from all container escapes" — it means a successful escape lands as an unprivileged user instead of root, which is a real improvement but not a guarantee. A container escape can still access and potentially corrupt anything that unprivileged host user can read or write, including SSH keys, other rootless containers' storage under the same user's home directory, or CI credentials mounted into the user's environment. Rootless is a blast-radius reduction, not a full isolation boundary.