Podman is a daemonless container runtime for Linux compatible with Docker. It offers several advantages over using Docker to manage and run containers. First, there is no overhead associated with running a background service as is the case with Docker. Podman also allows users to run rootless containers which provides a higher degree of protection for the system. Podman integrates deeply with Linux, taking advantage of a number of specific features. Notably, it uses namespaces for process isolation and integrates nicely with systemd. Just like Kubernetes, Podman is built on the concept of pods, groups of one or more containers, instead of individual containers.

Podman is only available in the Ubuntu repositories as of Ubuntu 20.10, making it just an apt install away. For older Ubuntu LTS releases, the Kubic PPA can be used to get Podman which is described here.

Tutorial

This tutorial provides the necessary steps to install Podman on elementary OS 5.1, i.e. Ubuntu 18.04, as well as Ubuntu 20.04 proper. It is assumed that you are familiar with Linux, Ubuntu, and the command-line.

  1. Add the Kubic repository for Podman to the system’s sources list.

    Ubuntu 18.04
    echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /" \
      | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
    deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /
    Ubuntu 20.04
    echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" \
      | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
    deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /
  2. Import the Kubic repository’s GPG key.

    Ubuntu 18.04
    wget -qO - https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/Release.key \
      | gpg --dearmor \
      | sudo tee /etc/apt/trusted.gpg.d/kubic_libcontainers.gpg > /dev/null
    Ubuntu 20.04
    wget -qO - https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key \
      | gpg --dearmor \
      | sudo tee /etc/apt/trusted.gpg.d/kubic_libcontainers.gpg > /dev/null
  3. Refresh Aptitude.

    sudo apt update
  4. Upgrade any installed packages to those from the Kubic repository.

    sudo apt -y upgrade
  5. Install Podman.

    sudo apt -y install podman
  6. On Ubuntu 18.04, restart dbus in order to use rootless containers.

    systemctl --user restart dbus

If you’re using Btrfs or ZFS, now is a good time to switch over to appropriate driver. Just follow the simple steps in Podman With Btrfs and ZFS.

Conclusion

You should now have the power of Podman available. When you want to use Podman, just use the same Docker command-line but substitute podman for docker.