How to Install Podman on Almalinux/Rocky Linux 9

How can we help?
< All Topics
Print

How to Install Podman on Almalinux/Rocky Linux 9

Podman Container Engine

Podman is a daemon-less container engine that is fully compatible with Docker. If you usually work with docker, you can alias it with alias docker=podman.

In this article, I will show you how to install Podman on Almalinux or Rocky Linux 9 (or any Enterprise Linux 9).

TLDR

# Install podman
sudo dnf install podman

# Set alias
echo "alias docker=podman" >> ~/.bashrc
source ~/.bashrc

# Test podman
docker run hello-world

Installation Steps

The podman package is available in the appstream repository, so you can directly do the following command to install it:

sudo dnf install podman

It will also install the required dependencies. Enter y to continue.

Once done, it should show similar to this:

Running Containers

One thing that makes podman differs from docker is that it is rootless. Meaning, any user can run any containers without having a privileged access and it’s more secure. For more details on this, you can read the following article on Redhat: What makes Podman different from other container engines?

So, without having to add your user to the docker group as you might do when using docker, you can just run any containers directly:

podman run hello-world
Running hello-world

If you see the Hello Podman World output, then it works perfectly.

Notice: You might encounter the below warnings, it means you aren’t directly logged in as your user (either by sudo or su from the root user). But you can safely ignore it.

WARN[0000] The cgroupv2 manager is set to systemd but there is no systemd user session available
WARN[0000] For using systemd, you may need to login using an user session
WARN[0000] Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root)
WARN[0000] Falling back to --cgroup-manager=cgroupfs
WARN[0000] The cgroupv2 manager is set to systemd but there is no systemd user session available
WARN[0000] For using systemd, you may need to login using an user session
WARN[0000] Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root)
WARN[0000] Falling back to --cgroup-manager=cgroupfs

Setting Alias

Podman syntaxes are fully compatible with docker’s. So, if you’re used to work with docker, you can simply create an alias for it.

alias docker=podman

Then to make it persist, put the line in your .bashrc file located in your home directory.

echo "alias docker=podman" >> ~/.bashrc

Conclusion

Podman is a container engine that is daemon-less and very compatible for docker. Hopefully this tutorial can help you with your work and project. Feel free to give questions or comments down below, and please give it a rate for us to create better article and tutorials.

Find more tutorials at our Knowledge Base, or you can visit our Youtube channel for a video tutorials.

Table of Contents

Ready, Set, Cloud

Ready, Set, Cloud