How to Install Podman in Amazon RHEL[7 Easy Steps]

In this tutorial, we will learn about how to install Podman in RHEL using 7 easy steps. As we know, Pods are set of containers that runs together and share same set of resources. Podman manages these pods via command line interface. (CLI). Podman is supported on various Linux distribution like CentOS, RHEL, Fedora etc. Podman installation method on different Linux distribution is different. We will focus on installing Podman on RHEL EC2 instance in AWS.

 

What is Podman?

Podman, also known as POD manager is a daemonless and open source tool which is used to build images. Podman is a product developed by Red Hat with an intention to develop, manage and build containers in Linux systems. Podman is the best alternative of docker which is also a standard containerization tool. You can refer to Podman CLI command when playing around it.

 

How to Install Podman in Amazon RHEL[7 Easy Steps]

How to Install Podman in Amazon RHEL[7 Easy Steps]

Prerequisites

  • An existing EC2 instance. Check out How to Create EC2 instance for creating a new instance.
  • Any SSH client to connect to EC2 instance.

 

Step-1: Start EC2 instance

In this step, go to AWS management console and search for EC2 service. Select your EC2 instance and click on start instance if your instance is not in running state.

 

Step-2: Connect to EC2 instance

In this step, connect to the EC2 instance using any SSH client. I am Using Putty  to connect to my EC2 instance using key based method. Provide hostname as shown below. Next, then click on SSH -> Auth and select the path of your key file. Once all done, click on Open.

 

Step-3: Become root

In this step, before starting to install Podman, switch to root user using below command.

[ec2-user@ip-10-162-180-10 ~]$ sudo su
[root@ip-10-162-180-10 ec2-user]#

 

Step-4: Check OS version

In this step, check the OS version of machine using below command.

[root@ip-10-162-180-10 ec2-user]# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.0 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.0"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.0 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_li nux/9/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.0
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.0"

NOTE:

Installation method given in this tutorial will only work on RHEL distribution of Linux.

 

Step-5: Update Repo

In this step, update the yum repo using below command. This step will keep the repo upto date with the latest dependencies and packages.

[root@ip-10-162-180-10 ec2-user]# yum -y update
Last metadata expiration check: 0:05:11 ago on Mon 03 Apr 2023 10:47:56 AM UTC.
Dependencies resolved.
Nothing to do.
Complete!

 

Step-6: Install Podman

In this step, install the latest verison of podman using below command.

[root@ip-10-162-180-10 ec2-user]# yum install -y podman
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Red Hat Enterprise Linux 9 for x86_64 - AppStream from RHUI (RPMs) 6.5 MB/s | 17 MB 00:02
Red Hat Enterprise Linux 9 for x86_64 - BaseOS from RHUI (RPMs) 7.5 MB/s | 9.8 MB 00:01
Red Hat Enterprise Linux 9 Client Configuration 2.9 kB/s | 2.8 kB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 03 Apr 2023 08:02:59 AM UTC.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
podman x86_64 2:4.2.0-11.el9_1 rhel-9-appstream-rhui-rpms 12 M
Installing dependencies:
conmon x86_64 2:2.1.4-1.el9 rhel-9-appstream-rhui-rpms 55 k
container-selinux noarch 3:2.189.0-1.el9 rhel-9-appstream-rhui-rpms 53 k 
slirp4netns x86_64 1.2.0-2.el9_0 rhel-9-appstream-rhui-rpms 49 k
yajl x86_64 2.1.0-21.el9_0 rhel-9-appstream-rhui-rpms 42 k

...............................
...............................
................................
Installing weak dependencies:
aardvark-dns x86_64 2:1.1.0-5.el9_1 rhel-9-appstream-rhui-rpms 998 k

Transaction Summary
=============================================================================================================================================================
Install 23 Packages

Total download size: 18 M
Installed size: 59 M
Downloading Packages:
(1/23): libnet-1.2-6.el9.x86_64.rpm 246 kB/s | 61 kB 00:00
(2/23): libslirp-4.4.0-7.el9.x86_64.rpm 935 kB/s | 72 kB 00:00
(3/23): yajl-2.1.0-21.el9_0.x86_64.rpm 961 kB/s | 42 kB 00:00
(4/23): fuse3-libs-3.10.2-5.el9.x86_64.rpm 235 kB/s | 94 kB 00:00
...............................
...............................
................................
(23/23): nftables-1.0.4-9.el9_1.x86_64.rpm 8.0 MB/s | 405 kB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 9.8 MB/s | 18 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libnftnl-1.2.2-1.el9.x86_64 1/23
Running scriptlet: container-selinux-3:2.189.0-1.el9.noarch 2/23
Installing : container-selinux-3:2.189.0-1.el9.noarch 2/23
Running scriptlet: container-selinux-3:2.189.0-1.el9.noarch 2/23
libsemanage.semanage_pipe_data: Child process /usr/libexec/selinux/hll/pp failed with code: 255. (No such file or directory).
container: libsepol.policydb_read: policydb module version 21 does not match my version range 4-20
container: libsepol.sepol_module_package_read: invalid module in module package (at section 0)
container: Failed to read policy package
libsemanage.semanage_direct_commit: Failed to compile hll files into cil files.
(No such file or directory).
/usr/sbin/semodule: Failed!

Installing : protobuf-c-1.3.3-12.el9.x86_64 3/23
Installing : fuse3-libs-3.10.2-5.el9.x86_64 4/23
Installing : iptables-nft-1.8.7-28.el9.x86_64 5/23
Running scriptlet: iptables-nft-1.8.7-28.el9.x86_64 5/23
Installing : libnftnl-1.2.2-1.el9.x86_64 
...........................
...........................
........................... 
Verifying : nftables-1:1.0.4-9.el9_1.x86_64 23/23
Installed products updated.

Installed:
aardvark-dns-2:1.1.0-5.el9_1.x86_64 conmon-2:2.1.4-1.el9.x86_64 container-selinux-3:2.189.0-1.el9.noarch containers-common-2:1-49.el9_1.x86_64
criu-3.17-4.el9.x86_64 criu-libs-3.17-4.el9.x86_64 crun-1.5-1.el9.x86_64 fuse-common-3.10.2-5.el9.x86_64
fuse-overlayfs-1.9-1.el9_0.x86_64 fuse3-3.10.2-5.el9.x86_64 fuse3-libs-3.10.2-5.el9.x86_64 iptables-nft-1.8.7-28.el9.x86_64
libnet-1.2-6.el9.x86_64 libnftnl-1.2.2-1.el9.x86_64 libslirp-4.4.0-7.el9.x86_64 netavark-2:1.1.0-7.el9_1.x86_64
nftables-1:1.0.4-9.el9_1.x86_64 podman-2:4.2.0-11.el9_1.x86_64 podman-catatonit-2:4.2.0-11.el9_1.x86_64 protobuf-c-1.3.3-12.el9.x86_64
shadow-utils-subid-2:4.9-5.el9.x86_64 slirp4netns-1.2.0-2.el9_0.x86_64 yajl-2.1.0-21.el9_0.x86_64

Complete!

 

Step-7: Verify Podman

In this step, once podman installation completes, verify the installation.

[root@ip-10-162-180-10 ec2-user]# podman --version
podman version 4.2.0

 

Conclusion

In this tutorial, we learnt about how to install Podman on RHEL Now that Podman is installed successfully, start building the images and running the container to explore the features and working of Podman.

Leave a Comment