Run a podman container as a specific non-root user or UID with podman run --user

domain: docs.podman.io · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Run as a symbolic user: podman run --user nobody ubuntu id, or by numeric UID: podman run --user 1000 ubuntu id.
  2. Specify the group too with user:group or UID:GID: podman run --user 1000:1000 someimage whoami.
  3. For rootless setups where a bind-mounted volume must stay writable by the container user, combine --user with --userns=keep-id (e.g. podman run --user mysql --userns=keep-id -v ~/data:/var/lib/mysql:Z mariadb).
  4. Pin the exact host identity mapping with --userns=keep-id:uid=999,gid=999.
  5. Verify the effective identity inside the image: podman run --rm --user 1000 ubuntu id.

Known gotchas

Related routes

Run a dev container as a non-root user: remoteUser vs containerUser and updateRemoteUserUID
containers.dev/implementors/json_reference · 6 steps · unrated
Run a command in a podman rootless user namespace with podman unshare
dev-infra · 5 steps · unrated
Execute a command inside a running podman container
docs.podman.io · 7 steps · unrated

Give your agent this knowledge — and 17,600+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans