How to install Podman on Ubuntu?. Podman (Pod Manager) is a tool used to create and maintain containers. It is part of the libpod library. The Red Hat team has been working on a set of tools for running containers without a daemon. Did you know you can’t run Docker containers without Docker Engine daemon?.
The following set of tools work together to power the use of Containers without an all-time running daemon process.
- Buildah to facilitate building of OCI images
- Skopeo for sharing/finding container images on Docker registries, the Atomic registry, private registries, local directories and local OCI-layout directories.
- Podman for running containers without need for daemon.
Buildah’s commands replicate all of the commands that are found in a Dockerfile. Buildah containers are just created to allow content to be added back to the container image.
Podman gives you all the commands and functions required to maintain and modify OCI images, such as pulling
and tagging
. It also allows you to create, run, and maintain
containers created from those images.
Install Podman on Ubuntu 22.04|20.04|18.04
The podman package is on a PPA repository which needs to be added prior to installation. Start a new terminal session on your Ubuntu machine and run commands below.
Add Kubic project repository to your Ubuntu system to install the latest release of Podman.
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add -
Once the repository is added, proceed to install Podman.
sudo apt update
sudo apt -y install podman
After the installation, you can display information pertaining to the host, current storage stats, and build of podman.
$ podman --version
podman version 3.4.4
$ podman info
Test Podman on Ubuntu 22.04|20.04|18.04
Pull Alpine docker image.
$ podman pull alpine
Trying to pull docker.io/library/alpine…Getting image source signatures
Copying blob 8e402f1a9c57: 2.63 MiB / 2.63 MiB [=======================] 5s
Copying config 5cb3aa00f899: 1.48 KiB / 1.48 KiB [=====================] 0s
Writing manifest to image destination
Storing signatures
5cb3aa00f89934411ffba5c063a9bc98ace875d8f92e77d0029543d9f2ef4ad0
List Downloaded images
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/alpine latest 5cb3aa00f899 3 days ago 5.79 MB
docker.io/library/hello-world latest fce289e99eb9 2 months ago 5.62 kB
Podman’s local repository is in /var/lib/containers
Run container with command – command options similar to docker.
$ podman run -it --rm docker.io/library/alpine /bin/sh
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
v3.18.3-55-g2ee93b9273a [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
v3.18.3-56-g4a3b0382caa [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
OK: 20063 distinct packages available
/ # apk add vim
(1/5) Installing vim-common (9.0.1568-r0)
(2/5) Installing xxd (9.0.1568-r0)
(3/5) Installing ncurses-terminfo-base (6.4_p20230506-r0)
(4/5) Installing libncursesw (6.4_p20230506-r0)
(5/5) Installing vim (9.0.1568-r0)
Executing busybox-1.36.1-r2.trigger
OK: 38 MiB in 20 packages
/ # exit
Show running containers.
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1eb35f1b7de8 docker.io/library/alpine:latest /bin/sh 4 seconds ago Up 4 seconds ago pedantic_roentgen
ec9c5b12db46 docker.io/library/alpine:latest /bin/sh 5 minutes ago Up 5 minutes ago ecstatic_wiles
For more on usage, check:
To setup private registry, checkout:
Conclusion
Podman seems to be a replacement for Docker and other container management tools which require a daemon to work. It is still fresh and in early development stages to tell a lot. In RHEL 8, the officially supported tools for managing Docker containers are Podman and Buildah.
Related guides: