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

One of Podman’s strongest features is its Docker CLI compatibility. In most cases, you can use the exact same commands — often by simply replacing the word docker with podman.
This makes switching from Docker to Podman easier than you might expect.
| Task | Docker Command | Podman Command |
|---|---|---|
| Run a container | docker run -it alpine |
podman run -it alpine |
| List running containers | docker ps |
podman ps |
| List all containers | docker ps -a |
podman ps -a |
| Build an image | docker build -t myapp . |
podman build -t myapp . |
| View logs | docker logs <id> |
podman logs <id> |
| Stop a container | docker stop <id> |
podman stop <id> |
| Remove a container | docker rm <id> |
podman rm <id> |
| Remove an image | docker rmi <image> |
podman rmi <image> |
🧠 Tip: You can even create an alias:
alias docker=podman
pull, push, buildrun, exec, rm, stop, logs)Podman commands run directly without a background service. This affects:
Most Podman installations use rootless mode:
sudo needed)📁 Volumes and files created in containers are owned by the current user, not
root, in rootless mode.
Some Docker-style commands (e.g., docker system prune) may behave differently or be absent in Podman. Podman provides alternatives like:
podman image prune
podman container prune
Start a container and explore the CLI:
podman run -it --rm alpine
Inside the container:
apk add curl
Then exit and try listing and removing the container:
podman ps -a
You can choose to run Podman in root mode if needed:
sudo podman run ...
But in most cases, rootless mode is safer and preferred — especially for development.
Next up: Podman Features Docker Doesn’t Have
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments