Need Assistance?

In only two hours, with an average response time of 15 minutes, our expert will have your problem sorted out.

Server Trouble?

For a single, all-inclusive fee, we guarantee the continuous reliability, safety, and blazing speed of your servers.

How to install and run Podman and Buildah on Rocky / AlmaLinux

Table of Contents

Podman (short for pod manager) is an open source tool for developing, managing, and running containers. Developed by Red Hat engineers along with the open source community, Podman manages the entire container ecosystem using the libpod library. Podman helps you to run, build, manage, and debug OCI containers directly within your Kubernetes cluster. Its REST API socket allows remote applications to create and control containers on demand, while providing compatibility with the Docker API and Docker Compose for seamless integration with existing tools. In this guide, we will discuss how to Install Podman and Buildah on Rocky / AlmaLinux to efficiently manage your containerized environments.

Buildah is designed for building Open Container Initiative (OCI) images. It replicates Dockerfile functionality, allowing images to be created from scratch, from existing containers, or directly from Dockerfiles. Buildah also gives developers the flexibility to use various scripting languages to build container images without relying on a background daemon.

In this blog, we’ll go through the steps to install and configure Podman and Buildah on Rocky Linux or AlmaLinux.

Prerequisites

  • A system running Rocky Linux or AlmaLinux (version 8 or later)
  • Root or sudo privileges
  • Sufficient system resources

Step 1: Installing Buildah

We begin by installing Buildah, a lightweight tool for building OCI-compliant container images:

dnf -y install buildah
buildah --version

This confirms that Buildah is installed successfully and ready for use.

Step 2: Installing Podman

Next, we install Podman, which runs and manages containers:

dnf -y install podman

If you are new to Podman, you can refer to the blog(provide link to “Setting up Podman on AlmaLinux 9” this blog for reference) for a better understanding.

To test Podman, we can pull and run an Apache HTTPD container:

podman run -dt -p 8080:8080/tcp \
  -e HTTPD_VAR_RUN=/run/httpd \
  -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
  -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
  -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
  registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd

After running the container, check its status and inspect configuration details:

podman ps -a
podman inspect -l | grep "HostPort"
curl http://localhost:8080

Use the below command to stop the container from running:

podman stop <containerID>

Step 3: Building a Custom Image with Buildah

To get an idea on Buildah, let’s create an Apache web server that will run inside a container. For that first, pull a Linux based Image, here we use CentOS stream, for which run:

container=$(buildah from centos:stream9)

To install httpd Apache web server inside the container, run:

buildah run $container yum install -y httpd

Now create an index.html

echo "Hello from Skynats Technologies" > index.html
buildah copy $container index.html /var/www/html/index.html
buildah config --entrypoint "/usr/sbin/httpd -D FOREGROUND" $container
buildah commit $container skynats

To inspect the images, run:

buildah images

This builds a new image named skynats containing a simple webpage.

Step 4: Running the Custom Image with Podman

Before running the custom imageFinally, use Podman to run your newly created image:

podman run -d --name skynats -p 8080:80 skynats
podman ps

Visit http://localhost:8080 in your browser, and you’ll see your custom message.

Conclusion

With just a few commands, you can efficiently build and run containers on Rocky Linux or AlmaLinux using Podman and Buildah — a secure, daemonless alternative to Docker for modern container management.

If you need expert assistance to install Podman and Buildah on Rocky / AlmaLinux, our team at Skynats is here to help. With our professional Linux server management services and reliable DevOps support services, we ensure seamless setup, configuration, and container management for your infrastructure. Contact Skynats today to get expert guidance and 24/7 technical support for your Linux servers.

Liked!! Share the post.

Get Support right now!

Start server management with our 24x7 monitoring and active support team

Let us know your requirement.

Can't get what you are looking for?

Get Support Right Away!