Last Updated on 1 week by Sachin G
Managing containers is a core task in DevOps and Linux administration, and Podman, a Red Hat-backed tool, offers a lightweight, secure, and daemonless alternative to Docker. In this article, I am going to show some top Podman basic commands for provisioning containerized services.
Having personally switched from Docker to Podman in production on Ubuntu and RHEL systems, I found its rootless containers support, systemd integration, and enhanced security model a game-changer. This guide blends real-world experience with practical Podman command examples for day-to-day use.
What is Podman and Why Use It?
Podman is an open-source container tool to create, manage images and Linux containers, and communicate with image registries. Podman is a similar command pattern to the Docker CLI, having nice features in it like it uses OCI images ( Open Container Initiative ). It is a part of Red Hat’s container ecosystem and fully compatible with OCI standards. Unlike Docker, Podman runs without a central daemon and supports rootless containers, making it more secure by design. It can store local images in a local file system and avoid unnecessary client/server arch. It also supports Kubernetes.
Podman vs Docker: Basic Command Differences
While the syntax of Podman vs Docker basic commands is nearly identical, their architecture differs. Podman does not require a background daemon, and users can manage containers as non-root users.
In our CI/CD pipelines, using Podman helped reduce the attack surface and simplified permissions. — techtransit.org
Learn more from the official Podman documentation.
How to Use Podman for Container Management
Let’s dive into the top Podman CLI commands for DevOps and how to use them effectively.
Top 10 Podman Basic Commands
1. podman info
info command will show system information such as host architecture, CPU, operating system distribution, registries, storage configuration container storage path, and other information.
# podman info
[techtransit@www ~]$ podman info
host:
arch: amd64
buildahVersion: 1.18.0
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.0.27-1.fc32.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.27, commit: 253f230b3f653ff8ed47efbfffa52f0ae3f1820d'
cpus: 4
distribution:
distribution: fedora
version: "32"
...
...
...
GoVersion: go1.14.10
OsArch: linux/amd64
Version: 2.2.1
2. podman search
An application runs in a container needed a container image, which is a file system bundle providing dependency on the application needed to run. Images of containers can be kept in images registries, which can be in local or remote registries. so the podman search command will find available images in local as well on remote registries.
# podman search image_name
through below podman search command i am filtering official image from container registery , if you want to list all images then you can directly type image name without filter option.
# podman search --filter is-official=true nginx
3. Fetching images
After the search in registries, the images can be downloaded through the podman pull subcommand. Its downloads and saves it locally for further use. Here I have taken the example of Nginx web server container image name.
# podman pull container_image_name
# podman pull nginx
[techtransit@www ~]$ podman search --filter is-official=true nginx
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/library/nginx Official build of Nginx. 15121 [OK]
[techtransit@www ~]$ podman pull nginx
Completed short name "nginx" with unqualified-search registries (origin: /etc/containers/registries.conf)
Trying to pull registry.fedoraproject.org/nginx:latest...
manifest unknown: manifest unknown
Trying to pull docker.io/library/nginx:latest...
Getting image source signatures
Copying blob 5430e98eba64 done
Copying blob 03e6a2452751 done
Copying blob edb81c9bc1f5 done
Copying blob b21fed559b9f done
Copying blob b82f7f888feb done
Copying blob b4d181a07f80 done
Copying config 4f380adfc1 done
Writing manifest to image destination
Storing signatures
4f380adfc10f4cd34f775ae57a17d2835385efd5251d6dfe0f246b0018fb0399
4. Listing images
After pulling the image from the registry podman save the images locally and through podman images subcommands, the images can be listed.
# podman images
5. podman inspect
podman inspect command shows metadata about container image and running or stopped container. The result of this command is produced output in the JSON format.
# podman inspect image_id/repository
6. Runs a container
To runs, containers podman run command executes and it runs a container based on local download image. The run subcommand generates a unique random ID and it can also generate different container names if not specified in the run subcommand.
Below is sample command to run ubuntu container image and it show hello output after run the container.
# podman run ubuntu echo 'Hello!'
7. podman ps
Podman ps displays all active running containers, showing the container’s unique ID and name of the containers. The container ID is unique and system-generated. The container name can be different because it can be specified through the run subcommand.
The below command shows only running containers.
# podman ps
with ps -a option, show all stopped and exited containers.
# podman ps -a
8. Stopping the container
You can stop the running container gracefully through the stop command. Below is the basic syntax to stop the container and you can stop all containers at the same time with the -a option with the podman stop command.
The below command will stop the specific container, for which we provided the ID or name of the container.
# podman stop container_id/container_name
with -a option stop all container .
# podman stop -a
9. Remove the container
rm subcommand to remove a container discards its status and file system, and if you want to remove or delete all containers, then you can use the -a option to delete all containers, but all the containers should be in a stopped condition.
# podman rm container_id/container_name
# podman rm -a
10. Removing the container image
if you want to delete an image or all images from local storage, we can use rmi subcommand to remove images and to remove all images with the -a option.
# podman rmi container_id/container_name
# podman rmi -a
Real-World Use Case: Podman in a DevOps Pipeline
In one of my projects, a Jenkins agent used Podman for job isolation without needing privileged Docker sockets. Thanks to Podman container management CLI, each build ran as a non-root user in its container, with images pulled and cleaned up automatically using podman run
and podman rm
.
This use of DevOps container tools significantly improved both pipeline speed and security posture.
FAQs:
Using podman generate systemd
, you can manage long-running services via systemd, making Podman suitable for production workloads.
Podman offers rootless containers, systemd support, and daemonless execution, which results in better security and flexibility for developers and system admins.
Start with podman pull
, podman run
, podman ps
, podman stop
, and podman rm
. These form the foundation of managing containers.
I’m Sachin Gupta — a freelance IT support specialist and founder of techtransit.org. I’m certified in Linux, Ansible, OpenShift (Red Hat), cPanel, and ITIL, with over 15 years of hands-on experience. I create beginner-friendly Linux tutorials, help with Ansible automation, and offer IT support on platforms like Upwork, Freelancer, and PeoplePerHour. Follow Tech Transit for practical tips, hosting guides, and real-world Linux expertise!