Site icon techbeatly

Installing Podman on Red Hat Enterprise Linux 9

If you’re working with containers on Red Hat Enterprise Linux (RHEL), you’ve likely heard of Docker. However, there’s another powerful tool you can use: Podman. This tutorial will walk you through installing Podman on RHEL 9 and explore its advantages over Docker.

What is Podman?

Podman is a container management tool part of the lib pod library. It allows you to create, manage, and maintain containers and Pods like Docker, but with a few key differences. Podman is designed to be a more secure and lightweight alternative, especially for environments where security and resource efficiency are paramount.

Comparing Podman to Docker

While Podman and Docker are both popular container management tools, Podman has some distinct advantages:

Setting Up Podman on RHEL 9

Let’s dive into the installation process. Here’s how you can set up Podman on your RHEL 9 server.

Check Your System

First, ensure that your RHEL 9 server is up and running. You can check your system details with the following command:

$ uname -a
Linux rhel-9-1 5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 30 07:36:03 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux

Verify Subscription

Make sure your system is registered with Red Hat’s subscription management. You can verify this by running:

$ sudo subscription-manager identity
system identity: <removed>
name: rhel-9-1
org name: 1100xxxx
org ID: 1100xxxx

Install Podman

With your system and subscription in place, install Podman using dnf:

$ sudo dnf install podman

This command will download and install the latest version of Podman available for RHEL 9.

Verify Installation

Once installed, check the version of Podman to ensure it’s correctly installed:

$ podman --version
podman version 4.9.4-rhel

Try some of the commands to verify the Podman is working.

$ podman pull nginx
$ podman images

$ podman run -dt -p 8080:80/tcp nginx:latest 
9bc336cb7d9f9d8583e9e68ec23bc7a79081823cd7b070b4486e98153dd01cc4

Optional – Installing podman-compose on RHEL 9

podman-compose is a tool that helps you manage single or multi-container applications using Podman, similar to how docker-compose works with Docker. It reads a podman-compose.yml file and simplifies container orchestration.

Prerequisites

Ensure Python is installed on your system:

$ python -V
Python 3.9.14

Step 1: Install pip

Ensure pip (Python package manager) is installed and up-to-date:

$ python -m ensurepip --upgrade

Step 2: Install podman-compose

Use pip to install podman-compose:

$ python -m pip install podman-compose

Step 3: Verify Installation

Confirm that podman-compose is installed:

$ podman-compose --versionpodman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 5.3.1
podman-compose version 1.0.6
podman --version 
podman version 5.3.1
exit code: 0

Now you’re ready to define and manage multi-container setups using a podman-compose.yml file!

For more details, check the official repository: podman-compose GitHub and you can also find sample podman-compose.yml (or docker-compose.yml) in this repository: github.com/iamgini/podman-usecases

Podman’s Unique Features

Podman offers several features that make it stand out, especially when compared to Docker:

Conclusion

Podman is a powerful and secure alternative to Docker, particularly suited for environments where security and resource efficiency are top priorities. With its daemonless architecture, rootless mode, and strong integration with systemd, Podman is a great choice for managing containers on RHEL 9.

Installing and getting started with Podman is straightforward, as shown in this tutorial. Whether you’re migrating from Docker or starting fresh, Podman provides all the tools you need to effectively manage your containerized applications.

Consider giving Podman a try and take advantage of its robust features and security-focused design!

Exit mobile version