Install and Use Podman on AlmaLinux 8

In this guide, 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 the Initial Server Setup with AlmaLinux 8.

Now Follow the steps below to complete this guide.

Steps To Install Podman on AlmaLinux 8

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

sudo dnf update && sudo dnf upgrade

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

sudo dnf install podman

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 your podman service is active and running on AlmaLinux 8:

sudo systemctl status podman
Output
● podman.service - Podman API Service
   Loaded: loaded (/usr/lib/systemd/system/podman.service; enabled; vendor pres>
   Active: active (running) since Mon 2022-09-05 02:36:05 EDT; 2s ago
     Docs: man:podman-system-service(1)
 Main PID: 76661 (podman)
    Tasks: 7 (limit: 11384)
   Memory: 24.9M
   CGroup: /system.slice/podman.service
           └─76661 /usr/bin/podman --log-level=info system service

To get full information about Podman, you can use:

podman info
Output 
host:
  arch: amd64
  buildahVersion: 1.26.2
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
...

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

Installing Podman Compose

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

First, install the Epel repository on AlmaLinux 8:

sudo dnf install epel-release

Then, use the following command to install Podman Compose:

sudo dnf install podman-compose

 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 underlying Podman will be executing.

sudo dnf install podman-docker

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

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 Images but 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 are the available images 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 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 learn to Install and Use Podman on AlmaLinux 8.

Hope you enjoy it.

You may be interested in 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

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!