Managing Containers and Images

Learn how to manage containers, images, volumes, and logs using Podman’s CLI — including useful commands for day-to-day development and operations.

By Kevin McAleer,    2 Minutes

Page last updated May 24, 2025


Cover


Now that you know what makes Podman powerful, let’s get hands-on with managing containers and images.

You’ll use the Podman CLI to list, inspect, stop, remove, and troubleshoot containers — just like you would with Docker, but daemonless and rootless.


📋 Listing and Inspecting Containers

View running containers

podman ps

View all containers (including stopped)

podman ps -a

Inspect a specific container

podman inspect <container-id>

🧠 This returns detailed JSON output including network, storage, environment variables, and more.


🧼 Starting, Stopping, and Removing

Start a container

podman start <container-id>

Stop a container

podman stop <container-id>

Remove a container:

podman rm <container-id>

🛑 Always stop a container before removing it, unless you use -f (force).


🖼 Managing Images

Pull an image

podman pull ubuntu

List local images

podman images

Remove an image

podman rmi <image-id>

🔍 Need more control? Use podman image inspect or podman image history to see build layers and metadata.


📦 Volumes and Persistent Storage

Create a named volume

podman volume create mydata

Use a volume in a container

podman run -v mydata:/data alpine

List volumes

podman volume ls

Remove a volume

podman volume rm mydata

📁 Podman volumes live under ~/.local/share/containers/storage/volumes (in rootless mode).


🪵 Logs and Output

View container logs

podman logs <container-id>

Follow logs in real time

podman logs -f <container-id>

📜 Podman log output goes to the standard user log files in rootless mode. Combine with journalctl for systemd-managed containers.


🧰 Useful Extras

Copy files into a container

podman cp myfile.txt <container-id>:/root/

Execute a command in a running container

podman exec -it <container-id> bash

Clean up unused containers and images

podman container prune
podman image prune

Next up: Working with Pods


< Previous Next >

You can use the arrows `← →` on your keyboard to navigate between lessons.