KevsRobots Learning Platform
56% Percent Complete
By Kevin McAleer, 3 Minutes
Page last updated May 24, 2025

One of Podman’s standout features is its native support for pods — a concept borrowed directly from Kubernetes.
Pods allow you to group containers so they share the same network namespace, making it easy to colocate services like a web server and a database.
A pod is a group of one or more containers that:
localhost📦 This is useful when building applications with tightly coupled components that need to run together — and it mirrors how Kubernetes deploys workloads.
Create a new pod:
podman pod create --name webstack
List all pods:
podman pod ps
Inspect a pod:
podman pod inspect webstack
Add a container to your pod:
podman run -dt --pod webstack nginx
Then add another:
podman run -dt --pod webstack redis
Podman run flags
The
podman runcommand uses several flags:
-druns the container in detached mode-tallocates a pseudo-TTY--pod webstackspecifies the pod to join
Both containers now share:
localhost connectivity🔧 This is very similar to running containers in a
docker-composenetwork, but native to the Podman CLI.
See what’s inside the pod:
podman pod inspect webstack
List all containers in a pod:
podman ps --pod
Stop and remove the pod (and its containers):
podman pod stop webstack
podman pod rm webstack
podman pod create --name blogpod -p 8080:80
podman run -dt --pod blogpod --name blogdb \
-e POSTGRES_PASSWORD=secret postgres
podman run -dt --pod blogpod --name blogweb \
-e DATABASE_URL=postgres://postgres:secret@localhost/postgres \
myblog:latest
Your blogweb container can now talk to blogdb over localhost:5432.
podman-compose)Podman’s pod feature is a stepping stone to full Kubernetes deployment. You can even export pods as Kubernetes YAML:
podman generate kube blogpod > blogpod.yaml
Then replay it later with:
podman play kube blogpod.yaml
🔄 This makes Podman a great tool for local development of Kubernetes apps.
Next up: Docker Compose vs Podman Compose
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments