Install Podman on Your Favorite Linux Distribution

Linux TLDR
Last Updated:
Reading time: 2 minutes

Podman is an open-source container management tool for creating, managing, and running containers and images. It’s often used as an alternative to Docker, allowing users to run standalone (non-orchestrated) containers without requiring a daemon.

Podman was developed by Red Hat, but it is supported by most Linux distributions, including macOS and Windows.

In this article, you will learn how to install Podman on your preferred Linux distribution, with command usage to kickstart your journey.

Tutorial Details

DescriptionPodman
Difficulty LevelModerate
Root or Sudo PrivilegesYes (for installation)
OS CompatibilityUbuntu, Manjaro, Fedora, etc.
PrerequisitesNo
Internet RequiredYes (for installation and Pulling Image)

How to Install Podman on Linux

The installation is straightforward – open your terminal and run one of the provided commands based on your Linux distribution.

$ sudo apt install podman                                                                             #For Debian 11+ or Ubuntu 20.10+
$ sudo dnf install podman                                                                             #For Fedora
$ sudo yum install podman                                                                           #For CentOS
$ sudo pacman -S podman                                                                           #For Arch or Manjaro
$ sudo zypper install podman                                                                      #For OpenSUSE
$ sudo emerge app-containers/podman                                                   #For Gentoo
$ sudo apk add podman                                                                                #For Alpine Linux
$ brew install podman                                                                                   #For Homebrew

If you are using RHEL 7, then enable the Extras channel and install Podman.

$ sudo subscription-manager repos --enable=rhel-7-server-extras-rpms
$ sudo yum install podman

For RHEL 8, Podman is included in the β€œcontainer-tools” module, along with Buildah and Skopeo.

$ sudo yum module enable container-tools:rhel8
$ sudo yum module install container-tools:rhel8

Once the installation is finished, run the following command to ensure Podman is accessible from the terminal:

$ podman --version

Output:

Checking Podman version

Usage of the Podman Command

The Podman command-line interface is quite identical to Docker. So, you can easily search and pull images from docker.io or quay.io and run your desired container efficiently.

Below, I’ll provide an overview of some common Podman commands and their usage:

1. Managing Images

  • Pull a container image from a registry.
$ podman pull [OPTIONS] IMAGE_NAME
  • List the local container images.
$ podman images [OPTIONS]
  • Remove one or more container images.
$ podman rmi [OPTIONS] IMAGE [IMAGE...]

2. Running Container

  • Create and run a container from an image.
$ podman run [OPTIONS] IMAGE [COMMAND] [ARG...]
  • List the running containers.
$ podman ps [OPTIONS]
  • Start, stop, and restart containers.
$ podman start CONTAINER_ID
$ podman stop CONTAINER_ID
$ podman restart CONTAINER_ID

3. Working with Containers

  • Run a command inside a running container.
$ podman exec [OPTIONS] CONTAINER COMMAND [ARG...]
  • View container logs.
$ podman logs [OPTIONS] CONTAINER
  • Display detailed information about a container or image.
$ podman inspect [OPTIONS] NAME_OR_ID

4. Managing Containers

  • Manage container networks.
$ podman network [OPTIONS] COMMAND [ARG...]
  • Manage pods that group multiple containers.
$ podman pod [OPTIONS] COMMAND [ARG...]
  • Manage volumes for data persistence.
$ podman volume [OPTIONS] COMMAND [ARG...]

Final Word

If you are aware of Docker command usage, then you can easily transition from Docker to Podman and start your journey without any hesitation.

Apart from that, if you have any questions or queries related to the topic, then feel free to ask them in the comment section.

Till then, peace!

Join The Conversation

Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.