Podman Cheat Sheet


Basic Commands

  • Check Podman Version podman --version
  • Display Podman Info podman info

Managing Containers

  • List Running Containers podman ps
  • List All Containers (including stopped) podman ps -a
  • Run a Container podman run [OPTIONS] IMAGE [COMMAND] [ARG...] Example: podman run -d --name mycontainer -p 8080:80 nginx
  • Start a Container podman start <container_id_or_name>
  • Stop a Container podman stop <container_id_or_name>
  • Restart a Container podman restart <container_id_or_name>
  • Remove a Container podman rm <container_id_or_name> (Add -f to force removal.)
  • Attach to a Running Container podman attach <container_id_or_name>
  • Execute a Command in a Running Container podman exec [OPTIONS] <container_id_or_name> COMMAND [ARG...] Example: podman exec -it mycontainer /bin/bash

Managing Images

  • List Images podman images
  • Pull an Image podman pull IMAGE Example: podman pull ubuntu:latest
  • Remove an Image podman rmi IMAGE
  • Build an Image from a Dockerfile podman build -t IMAGE_NAME PATH_TO_DOCKERFILE

Working with Pods

  • Create a Pod podman pod create [OPTIONS] Example: podman pod create --name mypod -p 8080:80
  • Run a Container in a Pod podman run --pod mypod [OPTIONS] IMAGE [COMMAND] [ARG...]
  • List Pods podman pod ls
  • Inspect a Pod podman pod inspect <pod_id_or_name>
  • Stop and Remove a Pod podman pod stop <pod_id_or_name> podman pod rm <pod_id_or_name>

Container Storage & Volume Management

  • List Volumes podman volume ls
  • Create a Volume podman volume create myvolume
  • Remove a Volume podman volume rm myvolume
  • Mount a Volume to a Container podman run -v myvolume:/path/in/container IMAGE

Networking

  • List Networks podman network ls
  • Inspect a Network podman network inspect <network_name>

Useful Commands

  • View Container Logs podman logs <container_id_or_name>
  • Inspect a Container podman inspect <container_id_or_name>
  • Show Container Stats podman stats
  • Prune Unused Data (Containers, Images, Volumes) podman system prune

Help & Documentation

  • Get Help for a Specific Command podman <command> --help
  • General Help podman --help
  • Official Documentation
    Visit the Podman Documentation for more details.