Podman is the latest buzzword in containerization technology. Unlike Docker, Podman is a daemonless containerization engine that is rapidly gaining traction amongst developers and is seen as a replacement for the good old docker. Just like Docker, it helps developers to develop, manage, and run their applications on containers. In this short topic, you will learn how to install Podman on CentOS 8 / RHEL 8.
Before you proceed, ensure you have a running instance of a CentOS 8 server. You can easily deploy a fully-managed VPS at Cloudcone only $3.71 to get started.
To install Podman, follow the steps below
Step 1: Update the system
It’s always a good idea to update the system packages before getting started with the installation of additional packages. To grab your terminal as a sudo user and run the command:
# sudo dnf update
Step 2: Install Podman on CentOS 8
After the successful update of your system, run the command below to install Podman on your system
# sudo dnf install podman
Just to check the version of podman, run
# podman --version
How to manage containers using Podman
So far, we have managed to install Podman on a CentOS 8 system. Let’s see how we can use it to perform various operations with containers.
To search for an image, just like you would in Docker use the syntax:
# podman search image
For example, to search for a Debian image, run the command:
# podman search debian
The output will display the registry that you are searching in, the name and the description of the image and also the ‘Stars’ which indicate how popular the image is.
To download your preferred image, simply use the syntax
# podman pull image
For example, to download the Debian image run
# podman pull debian
Let’s pull another image, this time the Nginx image.
# podman pull nginx
Once you have pulled the images, you can list them using the command:
# podman images
If you want to run an image, use the syntax
# podman run image_name
To run the Debian image and confirm the OS version, the command will be:
# podman run debian cat /etc/os-release
To list containers that are either running or have exited run the command
# podman ps -a
You can also obtain the shell of a running image by running
# podman run -it debian bash
Once you obtain the shell, you can start running any commands on the image
To remove a container use the syntax:
# podman rm container-id
From the output above, we can clearly see that after removing the container with Id
44cd43f136a1 , the running containers have been reduced to one.
To remove an image run
# podman rmi image-id
And that’s all for now. Thank you for your time.