podman — quick reference
Containers — list and lifecycle
See what is running, start stopped containers, and remove finished ones.
| When to use | Command |
|---|---|
| List running containers | podman ps |
| List all containers (including stopped) | podman ps -a |
| Create a container without starting it | podman create IMAGE COMMAND |
| Start an existing container | podman start CONTAINER |
| Stop a running container | podman stop CONTAINER |
| Restart a container | podman restart CONTAINER |
| Remove one or more containers | podman rm CONTAINER |
| Remove all stopped containers | podman container prune |
Run and exec
| When to use | Command |
|---|---|
| Run a command in a new container (foreground) | podman run IMAGE COMMAND |
| Run detached in the background | podman run -d --name NAME IMAGE COMMAND |
| Remove the container when the command exits | podman run --rm IMAGE COMMAND |
| Map host port to container port | podman run -d -p HOST:CONTAINER IMAGE |
| Bind-mount a host directory | podman run -v /host/path:/ctr/path:Z IMAGE |
| Run a command inside a running container | podman exec CONTAINER COMMAND |
| Interactive shell in a running container | podman exec -it CONTAINER /bin/bash |
Images
| When to use | Command |
|---|---|
| List local images | podman images |
| Pull an image from a registry | podman pull REGISTRY/IMAGE:TAG |
| Remove an image | podman rmi IMAGE |
| Remove unused images | podman image prune |
| Build from a Containerfile | podman build -t NAME:TAG . |
| Tag an image with another name | podman tag SOURCE TARGET |
Volumes, networks, and inspection
| When to use | Command |
|---|---|
| Create a named volume | podman volume create VOLUME |
| List volumes | podman volume ls |
| Remove a volume | podman volume rm VOLUME |
| List Podman networks | podman network ls |
| Show port mappings for a container | podman port CONTAINER |
| Show container logs | podman logs CONTAINER |
Follow logs like tail -f |
podman logs -f CONTAINER |
| Inspect JSON configuration | podman inspect CONTAINER |
| Live resource usage | podman stats --no-stream CONTAINER |
System and info
| When to use | Command |
|---|---|
| Show Podman version | podman --version |
| Show storage, runtime, and host details | podman info |
| Disk use summary for images and containers | podman system df |
| Reclaim unused data | podman system prune |
| List subcommands | podman --help |
podman — command syntax
Synopsis from podman --help on Rocky Linux 10.2 (podman 5.8.2):
Usage:
podman [options] [command]
Available Commands:
attach Attach to a running container
build Build an image using instructions from Containerfiles
create Create but do not start a container
exec Run a process in a running container
images List images in local storage
logs Fetch the logs of one or more containers
network Manage networks
pod Manage pods
ps List containers
pull Pull an image from a registry
rm Remove one or more containers
rmi Remove one or more images from local storage
run Run a command in a new container
start Start one or more containers
stop Stop one or more containers
volume Manage volumes
...Rootless Podman stores state under ~/.local/share/containers/; the system-wide graph root is /var/lib/containers/storage. Most docker-style flags work the same way on podman run.
podman — command examples
Essential Run a one-off command in a new container
When you only need a quick command from an image — no leftover container — combine run with --rm.
Run the command:
podman run --rm quay.io/rockylinux/rockylinux:9 echo hello-podmanSample output:
hello-podmanPodman pulled the image if needed, started a container, ran echo, printed the line, and removed the container because of --rm.
Essential Run a detached container with port mapping
Use -d for background workloads and -p to publish a container port on the host.
Run the command:
podman run -d --name glc-web -p 18080:80 quay.io/rockylinux/rockylinux:9 sleep 3600Sample output:
5f9d3730e1330707ee9e6ad71c6627b84d7eb38b3357068a90fbb175e77b92beConfirm the mapping:
podman ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'Sample output:
NAMES STATUS PORTS
glc-web Up 3 seconds 0.0.0.0:18080->80/tcp0.0.0.0:18080->80/tcp means host port 18080 forwards to port 80 inside the container. Clean up with podman stop glc-web && podman rm glc-web when you are done.
Common Run a command inside a running container
exec attaches a new process to an existing container — useful for debugging without restarting the workload.
Start a long-running container:
podman run -d --name glc-exec quay.io/rockylinux/rockylinux:9 sleep 3600Run a command inside it:
podman exec glc-exec cat /etc/redhat-releaseSample output:
Rocky Linux release 9.8 (Blue Onyx)The release file comes from the image, not necessarily your host OS. Stop and remove the test container when finished.
Common Persist data with a named volume
Named volumes survive container removal — handy for databases and application data.
Run the command:
podman run --rm -v glc-data:/data:Z quay.io/rockylinux/rockylinux:9 sh -c 'echo data > /data/test.txt && cat /data/test.txt'Sample output:
dataThe :Z suffix relabels the volume for SELinux on RHEL-family hosts. Remove the test volume with podman volume rm glc-data.
Common Create then start — split lifecycle steps
create builds the container object; start runs it. Some admins prefer this in scripts over a single run.
Run the commands:
podman create --name glc-create quay.io/rockylinux/rockylinux:9 sleep 600Sample output:
c19cbefd6e190c1f29f3ed69d065cd5a0d854569cfbb2cbbea38da162b403bf2Start and verify:
podman start glc-create
podman ps --filter name=glc-create --format '{{.Names}} {{.Status}}'Sample output:
glc-create Up 2 secondsRemove the test container with podman rm -f glc-create.
Common Check logs and resource use
logs shows stdout/stderr; stats gives a CPU and memory snapshot.
Run the commands:
podman logs glc-create 2>&1 | head -3
podman stats --no-stream glc-createSample output:
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
c19cbefd6e19 glc-create 11.11% 385kB / 4.099GB 0.01% 536B / 132B 0B / 0B 1An empty logs line is normal for a sleep container. Use podman logs -f to follow output from services that print to stdout.
Essential Pull and list local images
Pull once, run many times — Podman stores images in local storage.
Run the commands:
podman pull quay.io/rockylinux/rockylinux:9
podman images --format '{{.Repository}}:{{.Tag}} {{.Size}}'Sample output:
quay.io/rockylinux/rockylinux:9 244 MBUse podman image prune to drop unused layers when disk space is tight.
Advanced See disk use across images and containers
Before pruning, check what Podman is holding on disk.
Run the command:
podman system dfSample output:
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 1 1 243.7MB 0B (0%)
Containers 0 0 0B 0B (0%)
Local Volumes 0 0 0B 0B (0%)RECLAIMABLE shows space you could free with podman system prune or targeted image / volume prune commands.
Advanced Confirm runtime and storage settings
podman info is the first command when rootless mode, cgroup driver, or registry auth misbehaves.
Run the command:
podman info 2>&1 | head -20Sample output:
host:
arch: amd64
buildahVersion: 1.43.1
cgroupControllers:
- cpuset
- cpu
- io
- memory
...
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.2.1-2.el10.x86_64
path: /usr/bin/conmonLook for cgroupManager: systemd and cgroupVersion: v2 on current RHEL-family releases. Rootless users should see a graph root under their home directory further down the output.
podman — when to use / when not
| Use podman when | Use something else when |
|---|---|
|
|
podman vs docker
Both speak similar CLI flags for day-to-day container work. The difference is architecture and defaults on RHEL-family Linux.
| podman | Docker Engine | |
|---|---|---|
| Daemon | Daemonless (fork/exec per container) | Central dockerd daemon |
| Rootless | First-class, default on many RHEL workflows | Supported but less common |
| Socket | Optional remote socket; no required group membership | Often requires docker group for socket access |
| systemd | Native Quadlet and generate systemd |
Possible with extra unit files |
| Best on | RHEL, Rocky, Fedora, rootless servers | Cross-platform dev teams, Compose-centric stacks |
See Docker vs containerd for how the broader container stack fits together.
Related commands
Nearby tools in the same container workflow — images, builds, orchestration, and cleanup.
| Command | One line |
|---|---|
| podman | Daemonless OCI container CLI (this page) |
| systemctl | Enable Podman-generated systemd units |
| ss | Verify published container ports on the host |
Browse the full index in our Linux commands reference.
podman — interview corner
What is podman and how is it different from Docker?
podman runs OCI containers on Linux without requiring a long-running container daemon. Each podman run forks a process tree managed by a lightweight runtime (typically crun) and conmon.
On RHEL-family distros, Podman is the default way to pull images, run rootless workloads, and wire containers into systemd. The CLI mirrors Docker closely — run, ps, exec, build — so most Docker examples translate with the command name swapped.
The big architectural difference: Docker Engine centers on dockerd and a socket; Podman is daemonless and fits rootless, SELinux-aware server workflows out of the box.
A strong answer is:
"Podman is the daemonless OCI container CLI on RHEL and Fedora — Docker-compatible commands, rootless by default, no central dockerd. I use it for single-host containers and systemd-integrated services."
Can podman run containers without root?
Yes. Rootless Podman maps container UIDs, uses user namespaces, and stores images under the caller's home directory (for example ~/.local/share/containers/).
That means an unprivileged user can build and run containers without membership in a privileged group — a common hardening goal on shared servers.
Check your graph root and IDs:
podman info | grep -E 'rootless|graphRoot|runRoot'If port binding below 1024 or certain cgroup limits fail, run the specific workload as root or adjust capabilities — not every container fits rootless mode.
A strong answer is:
"Yes — rootless Podman uses user namespaces and stores state in the user's home directory. It's the default pattern on RHEL for non-admin container workloads, though privileged ports and some devices still need root or extra caps."
How do you remove stopped containers and unused images?
Remove a named container:
podman rm CONTAINERForce-remove a running one:
podman rm -f CONTAINERBulk cleanup:
podman container prune
podman image prune
podman system pruneprune commands ask for confirmation unless you pass -f. Always list first with podman ps -a and podman images so you do not delete data a compose stack still references.
A strong answer is:
"I use podman rm for named containers, container prune for all stopped ones, and image or system prune to reclaim disk — after checking ps and images so I don't remove something a service still needs."
Why do Podman volume mounts sometimes need :Z or :z?
On SELinux-enforcing hosts (default on RHEL), bind mounts and volumes need a label the container process may access. The :Z suffix relabels the volume for private container use; :z allows shared content across containers.
Without the suffix you may see permission denied errors even when DAC permissions look correct.
Example:
podman run --rm -v /opt/data:/data:Z IMAGEA strong answer is:
"SELinux blocks containers from arbitrary host paths — :Z or :z on -v tells Podman to relabel the mount for container access. I use :Z for single-container private data."
How do you run a container as a systemd service?
Generate a unit file from a running or created container:
podman generate systemd --name myapp --filesOr define a Quadlet unit under /etc/containers/systemd/ on newer RHEL releases so systemd starts the container at boot.
Enable and start like any service:
sudo systemctl enable --now container-myapp.serviceSee create systemd service for general unit patterns.
A strong answer is:
"I either podman generate systemd from an existing container or use Quadlet drop-ins under /etc/containers/systemd, then enable the unit with systemctl — Podman integrates with systemd natively on RHEL."
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Error: short-name resolution enforced but cannot prompt |
Registries not fully qualified | Use full image names (quay.io/...) or configure /etc/containers/registries.conf |
cannot stat overlay / storage errors |
Corrupt or full graph root | podman system df; prune unused data; check disk space on /var or $HOME |
Bind for 0.0.0.0:80 failed: permission denied (rootless) |
Privileged port without capability | Use a high port (-p 8080:80) or run rootful Podman |
toomanyrequests on pull |
Docker Hub rate limit | podman login docker.io or pull from a mirror (quay.io, private registry) |
| Permission denied on volume mount | SELinux label | Add :Z or :z to the -v option |
| Container exits immediately | Wrong command or missing foreground process | Check podman logs CONTAINER; use -d with a long-running CMD |
Error: no such container |
Name typo or container already removed | podman ps -a; recreate with podman run |
References
- podman man page{target="_blank" rel="noopener"} — upstream Podman documentation
- Manage Docker containers with examples — parallel workflows on Docker Engine
- Docker vs containerd — runtime stack overview
- Linux commands cheat sheet — full command index

