Install and Use Podman on AlmaLinux 8

In this guide from the Orcacore website, we want to teach you How To Install and Use Podman on AlmaLinux 8. Podman is a container engine that’s compatible with the OCI Containers specification. Podman is part of RedHat Linux, but can also be installed on other distributions.

As it’s OCI-compliant, Podman can be used as a drop-in replacement for the better-known Docker runtime. Most Docker commands can be directly translated to Podman commands.

How To Install and Use Podman on AlmaLinux 8

To install Podman, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on the Initial Server Setup with AlmaLinux 8.

Now follow the steps below to complete this guide.

1. Install and Enable Podman on AlmaLinux 8

First, you need to update and upgrade your local package index with the following command:

sudo dnf update -y && sudo dnf upgrade -y

Podman packages are available in the default AlmaLinux repository. So, use the following command to install Podman on your server:

sudo dnf install podman -y

Then, verify your installation by checking its version:

podman --version
Output
podman version 4.1.1

Start and enable your Podman service by using the following commands:

# sudo systemctl start podman
# sudo systemctl enable podman

Check that your podman service is active and running on AlmaLinux 8:

sudo systemctl status podman
podman service - Podman API Service

To get full information about Podman, you can use:

podman info
podman info on almalinux 8

When your installation is completed, you can proceed to the next step to install Podman Compose.

2. Install Podman Compose on AlmaLinux 8

If you plan to use Docker Compose with Podman’s backend, you can use the following command to make it run docker-compose.yml unmodified and rootless or create a new one. In short, it is a drop-in replacement for Docker Compose.

First, install the EPEL repository on AlmaLinux 8:

sudo dnf install epel-release -y

Then, use the following command to install Podman Compose:

sudo dnf install podman-compose -y

 Use Docker as a command tool instead of Podman (optional)

To use Docker as a command tool instead of Podman, you can install the podman-docker.

This means you can use the familiar Docker command while the underlying Podman will be executing.

sudo dnf install podman-docker -y

Then, check the versions:

podman -v
or
docker -v

These will give you the same result.

Output
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
podman version 4.1.1

3. How To Use Podman on AlmaLinux 8?

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 for Images from different repositories.

For example, if you want to install an AlmaLinux container using Podman, then you can search what are the images available through the different repositories.

podman search almalinux

Then, you can download and pull images with the following command:

podman pull almalinux

List all Images with Podman

If you have downloaded multiple images and now want to see what images are available on your system, you can list all of them using the following command:

podman images

In my case:

Output
REPOSITORY                   TAG         IMAGE ID      CREATED     SIZE
docker.io/library/almalinux  latest      d1c25ed4de19  3 days ago  195 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 AlmaLinux image with Podman. Now we will show how to use it to create a container using the AlmaLinux Image.

To do this, you can use the following command:

podman run -dit --name orca almalinux

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:

sam@82512000164c:/#

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.

Conclusion

At this point, you have learned to install and use Podman on AlmaLinux 8. By using the default DNF package manager, you can install Podman directly from the official repositories. Once installed, Podman is ready to use for managing containers without needing a daemon.

Hope you enjoy it. You may also like these articles:

Set up and Configure BIND on AlmaLinux 8

How To Install and Use Docker on AlmaLinux 8

Set up and Configure XRDP on AlmaLinux 8

How To Set up Plesk on AlmaLinux 8

Share your love

Stay informed and not overwhelmed, subscribe now!