In this guide, we want to teach you How To Install and Use Podman on Centos 7.
Podman is an open-source container management tool for developing, managing, and running OCI containers.
Advantages of Podman:
- Images created by Podman are compatible with other container management tools
- It can be run as a normal user without requiring root privileges
- It provides the ability to manage pods
- It only runs on Linux-based systems
- There is no alternative for Docker Compose
Steps To Install and Use Podman on Centos 7
To complete this guide, you have to log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Centos 7.
Install Podman on Centos 7
First, you need to update your local package index with the following command:
sudo yum update -y
Then, you need to install the Epel repository on your Centos 7 server by using the command below:
sudo yum install epel-release -y
Now you can use the following command to install Podman:
sudo yum install podman -y
Then, verify your installation by checking its version:
Output podman version 1.6.4
To get full information about Podman, you can use:
Output host: BuildahVersion: 1.11.7 CgroupVersion: v1 Conmon: package: conmon-2.0.8-1.el7.x86_64 path: /usr/bin/conmon version: 'conmon version 2.0.8, commit: f85c8b1ce77b73bcd48b2d802396321217008762' Distribution: distribution: '"centos"' version: "7" MemFree: 2668564480 MemTotal: 3973296128 OCIRuntime: name: runc package: runc-1.0.0-69.rc10.el7_9.x86_64 path: /usr/bin/runc version: 'runc version spec: 1.0.1-dev' ...
When your installation is completed, you can proceed to the next step to see how to use Podman.
How To Use Podman on Centos 7
Now that you have installed Podman on your server let’s see its basic usage.
Search and pull images with Podman
Just like Docker, you can use the Podman command line to search Images but from different repositories.
For example, if you want to install a Centos container using Podman, then you can search what are the images available through the different repositories.
podman search centos
Then, you can download and pull images with the following command:
podman pull centos
List all Images with Podman
If you have downloaded multiple images and now want to see what are the available images on your system, you can list all of them using the following command:
In my case:
Output REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/centos latest 5d0da3dc9764 13 months ago 239 MB
Create a Container with Podman
Once you have the image of the application that you want, you can create a container with it. Here we have downloaded the Centos image with Podman. Now we will show how to use it to create a container using Centos Image.
To do this, you can use the following command:
podman run -dit --name orca centos
Note: –name is a parameter to give the container whatever friendly name you want to assign.
To access your Container command line, use the following command:
podman attach orca
You will see that your command prompt changes to your container ID:
[[email protected] /]#
To start your container, you can use the command below:
podman start container-id or name
To stop your container, you can use the following command:
podman stop container-id or name
For more information, you can visit the Podman Documentation page.
At this point, you have learned to Install and Use Podman on Centos 7.
Hope you enjoy it.
You may be like these articles:
Install and Use Podman on AlmaLinux 8