How to Install Podman on Almalinux/Rocky Linux 9
Podman is a daemon-less container engine that is fully compatible with Docker. If you usually work with docker, you can alias it with
In this article, I will show you how to install Podman on Almalinux or Rocky Linux 9 (or any Enterprise Linux 9).
# Install podman sudo dnf install podman # Set alias echo "alias docker=podman" >> ~/.bashrc source ~/.bashrc # Test podman docker run hello-world
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:
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
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
su from the root user). But you can safely ignore it.
WARN The cgroupv2 manager is set to systemd but there is no systemd user session available WARN For using systemd, you may need to login using an user session WARN Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root) WARN Falling back to --cgroup-manager=cgroupfs WARN The cgroupv2 manager is set to systemd but there is no systemd user session available WARN For using systemd, you may need to login using an user session WARN Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root) WARN Falling back to --cgroup-manager=cgroupfs
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.
Then to make it persist, put the line in your
.bashrc file located in your home directory.
echo "alias docker=podman" >> ~/.bashrc
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.