Podman runs OCI containers without a privileged daemon — each container is a child process of the invoking shell, started directly by the podman binary through runc or crun. Installing it correctly on Ubuntu means more than apt install podman: you need the user namespaces, the subuid/subgid maps, and the slirp4netns / fuse-overlayfs user-space helpers wired up so rootless mode actually works.
How to verify
After the install, three commands tell you whether rootless mode is healthy:
podman info --format '{{.Host.Security.Rootless}}'
cat /etc/subuid /etc/subgid | grep $USER
podman unshare cat /proc/self/uid_map
podman run --rm alpine id
ls -la $HOME/.local/share/containers/storage 2>/dev/null
The first must print true. The uid_map shows the namespace remap (typically 0 100000 65536). The id inside the container reports uid=0, but ps -ef on the host shows your real UID owning the process — that is the whole point.
What’s happening
Podman is daemonless: there is no long-running server process. A podman run invocation forks conmon (the monitor) which execs the OCI runtime (crun by default, runc as fallback), which sets up the namespaces and pivots into the container. When you exit, everything is gone. State lives in $HOME/.local/share/containers/ for rootless and /var/lib/containers/ for root.
Rootless mode relies on three kernel features. User namespaces let your unprivileged UID map to UID 0 inside the container. subuid/subgid provide the additional 65 536 IDs the namespace needs. slirp4netns (or pasta on newer hosts) gives the container a network stack without needing CAP_NET_ADMIN on the host. If any one of these is missing the rootless container will either refuse to start or run with a degraded feature set.
The procedure
- Add the official Podman repository (Ubuntu’s archive is often a major version behind):
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${VERSION_ID}/ /" | \
sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_${VERSION_ID}/Release.key | \
sudo gpg --dearmor -o /etc/apt/keyrings/podman.gpg
sudo apt-get update
- Install Podman and the user-space helpers —
slirp4netns,fuse-overlayfs, andcrunare not always pulled as required dependencies:
sudo apt-get install -y podman crun slirp4netns fuse-overlayfs uidmap
- Verify that the subordinate UID/GID ranges exist for the operator account. On a fresh user this is usually pre-populated, but service accounts and LDAP users frequently are not:
grep $USER /etc/subuid || sudo usermod --add-subuids 100000-165535 $USER
grep $USER /etc/subgid || sudo usermod --add-subgids 100000-165535 $USER
podman system migrate
- Switch the storage driver to
overlaywith the FUSE helper. The defaultvfsdriver works everywhere but copies the whole image on every layer write — it is unusable for anything beyond a smoke test:
mkdir -p $HOME/.config/containers
cat > $HOME/.config/containers/storage.conf <<'EOF'
[storage]
driver = "overlay"
runroot = "/run/user/1000/containers"
graphroot = "/home/operator/.local/share/containers/storage"
[storage.options.overlay]
mount_program = "/usr/bin/fuse-overlayfs"
EOF
- Smoke-test with a known image and verify the host process tree:
podman run -d --name nginx-test -p 8080:80 docker.io/library/nginx:alpine
ps -ef | grep conmon
curl -I http://localhost:8080
podman stop nginx-test && podman rm nginx-test
The published port 8080 works without root because slirp4netns proxies it. Privileged ports below 1024 require sysctl net.ipv4.ip_unprivileged_port_start=80 or setcap cap_net_bind_service=+ep on the binary.
Common pitfalls
apt install podmanfrom Ubuntu’s archive on releases older than 24.04 pulls in a version too old to honour modern compose files — always use the OBS repository for production hosts.- Missing
uidmappackage:podman runreturns “newuidmap: write to uid_map failed” and rootless mode is broken until installed. - Forgetting
podman system migrateafter editing/etc/subuid— existing containers still hold the old mapping and fail to start until purged. - Running
podmanover SSH withoutloginctl enable-linger $USER— yourXDG_RUNTIME_DIRevaporates at logout, killing every container. - Mixing root and rootless storage paths:
sudo podman psshows nothing from your rootless tree because the graph roots are different.
Stack Harbor runs Podman as the default container runtime on hosts where the Docker daemon is a footgun — see managed operations for how we standardise the install, the storage config, and the lingering systemd-user services across a fleet.