Execute a command or open an interactive shell in a running podman container

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

Documented steps

  1. Resolve the container name or ID with podman ps (or podman ps -a for stopped ones).
  2. Open an interactive shell: podman exec -it <container> sh (use /bin/bash if present in the image).
  3. Run a non-interactive one-off command: podman exec <container> ls -la.
  4. Override the working directory with -w /path, run as another user with --user <uid>[:<gid>], and set environment with -e KEY=value or --env-file <file>.
  5. Detach a long-running exec session with -d, which prints an exec session id and returns immediately.

Known gotchas

Related routes

Run a command or open an interactive shell in a running container with kubectl exec
kubernetes.io · 7 steps · unrated
Run a container with podman using Docker-compatible CLI syntax
containers · 6 steps · unrated
Execute a command in a running container through the Kubernetes exec subresource
kubernetes.io · 11 steps · unrated

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

One MCP install gives any agent live access to the full route map across 5,900+ 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