| Tested on | Rocky Linux 10.2 (Red Quartz) |
|---|---|
| Package | podman 5.8.2 |
| Applies to | RHEL, Rocky Linux, AlmaLinux, CentOS Stream, Fedora |
| Privilege | Normal user for rootless Podman; sudo or root only when the workload or system configuration requires it |
| Man page | podman(1) |
| Scope | podman runs OCI containers and pods without a central daemon. On RHEL, Rocky Linux, AlmaLinux, and Fedora it is the default container CLI — pull images, run rootless workloads, manage volumes and networks, and integrate. |
| Related guides | Find and remove unused Docker containers systemctl ss Linux commands |
For a structured path through install, networking, and Quadlet, start with the Podman tutorial. The sections below summarize the daily commands; deeper walkthroughs live in the linked course chapters.
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 |
Detached runs, port publishing, and cleanup patterns beyond this table are covered in run containers with podman run.
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 |
| Resource-usage snapshot | 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 docker.io/library/nginx:alpineSample output:
5f9d3730e1330707ee9e6ad71c6627b84d7eb38b3357068a90fbb175e77b92beConfirm the mapping and that something is listening:
podman port glc-web
curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1:18080/Sample output:
80/tcp -> 0.0.0.0:18080
HTTP 20080/tcp -> 0.0.0.0:18080 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 quay.io/rockylinux/rockylinux:9 sh -c 'echo data > /data/test.txt && cat /data/test.txt'Sample output:
dataNamed volumes survive container removal. Remove the test volume with podman volume rm glc-data. For SELinux relabeling of host paths, see the bind-mount row in the quick-reference table (-v /host/path:/ctr/path:Z).
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 and commonly used | Supported but less common |
| Socket | Optional remote socket; no required group membership | Often requires docker group for socket access |
| systemd | Native Quadlet; generate systemd deprecated |
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.
podman — interview corner
What is podman and how is it different from Docker?
podman runs OCI containers on Linux without a long-running container daemon. The CLI mirrors Docker (run, ps, exec, build), but Podman is daemonless and fits rootless, SELinux-aware RHEL-family workflows without a central dockerd.
"Podman is the daemonless OCI container CLI on RHEL and Fedora — Docker-compatible commands, first-class rootless support, no central dockerd."
How do you run a container as a systemd service?
Use a Quadlet .container file under /etc/containers/systemd/ for rootful services or ~/.config/containers/systemd/ for rootless services. Add the appropriate [Install] section to the Quadlet file, run systemctl daemon-reload, then start the generated service. The Quadlet generator handles enablement from the [Install] section. podman generate systemd still exists but is deprecated for new deployments.
"I use Quadlet drop-ins for boot-time containers on RHEL; generate systemd is legacy compatibility only."
Why do Podman bind mounts sometimes need :Z or :z?
On SELinux-enforcing hosts, bind-mounted host paths can have labels that deny container access. :Z gives a private container relabel and :z a shared relabel.
podman run --rm -v /opt/data:/data:Z IMAGE"SELinux blocks containers from arbitrary host paths — :Z or :z on a bind mount tells Podman to relabel the source for container access."
When your symptom is not listed here, search the Podman troubleshooting library for log-line-specific fixes.
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 host permission | Use a host port above the configured unprivileged-port threshold, or adjust the host's net.ipv4.ip_unprivileged_port_start policy if appropriate |
toomanyrequests on pull |
Docker Hub rate limit | podman login docker.io or pull from a mirror (quay.io, private registry) |
| Permission denied on bind mount | SELinux label on host path | Add :Z or :z to the bind-mount -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

