Podman or Pod Manager Tool is an open-source container engine without a daemon for developing, managing, and running OCI containers on our Linux system. Podman has emerged as a versatile container management tool, offering a lightweight alternative to Docker, particularly favored by those seeking greater security and flexibility in their container environments.
In this guide, we will go through the steps to install Podman on Ubuntu 22.04, providing a straightforward tutorial for beginners and experienced users alike. Whether you are exploring containerization for the first time or want to expand your skills, this tutorial will give you the knowledge you need to harness the power of Podman in your Ubuntu environment.
Requirements
- A cloud server running Ubuntu 22.04.
- Root access
Before you begin, you need to update your system to the latest version so you can install Podman from the Ubuntu repositories. You can do this with the following command:
# apt-get update && apt-get upgrade -y
Once your system is up to date, you can continue to the next step.
By default, Podman is available in the default Ubuntu 22.04 repository, so you can proceed with its installation directly. We explain how to install Podman using the Ubuntu repository and the official project's PPA, which ensures access to the latest versions of Podman beyond what is available in the official Ubuntu 22.04 repositories.
Install Podman with the following command:
# apt-get install podman
Check the version:
# podman info
To start the process, you will need to add the repository to your system. Run the following command:
# add-apt-repository -y ppa:projectatomic/ppa
Update the packages
# apt update
install Podman with the following command:
# apt install podman
Check the version:
# podman info
Once Podman has been installed, you can check all the information with the following command:
# podman info
arch: amd64
buildahVersion: 1.23.1
cgroupControllers:
- cpuset
- cpu
- io
- memory
- hugetlb
- pids
- rdma
- misc
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: 'conmon: /usr/bin/conmon'
path: /usr/bin/conmon
version: 'conmon version 2.0.25, commit: unknown'
cpus: 1
distribution:
codename: jammy
distribution: ubuntu
version: "22.04"
eventLogger: journald
hostname: podman
idMappings:
gidmap: null
uidmap: null
kernel: 5.15.0-25-generic
linkmode: dynamic
logDriver: journald
memFree: 473825280
memTotal: 2073772032
ociRuntime:
name: crun
package: 'crun: /usr/bin/crun'
path: /usr/bin/crun
version: |-
crun version 0.17
commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
os: linux
remoteSocket:
exists: true
path: /run/podman/podman.sock
security:
apparmorEnabled: true
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: false
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: false
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: 'slirp4netns: /usr/bin/slirp4netns'
version: |-
slirp4netns version 1.0.1
commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
libslirp: 4.6.1
swapFree: 255995904
swapTotal: 255995904
uptime: 23m 5.45s
plugins:
log:
- k8s-file
- none
- journald
network:
- bridge
- macvlan
volume:
- local
registries: {}
store:
configFile: /etc/containers/storage.conf
containerStore:
number: 0
paused: 0
running: 0
stopped: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /var/lib/containers/storage
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageStore:
number: 0
runRoot: /run/containers/storage
volumePath: /var/lib/containers/storage/volumes
version:
APIVersion: 3.4.4
Built: 0
BuiltTime: Thu Jan 1 01:00:00 1970
GitCommit: ""
GoVersion: go1.18.1
OsArch: linux/amd64
Version: 3.4.4
Configure the Podman configuration registries
Podman supports multiple registries from which you can pull container images. When a container name that does not contain a registry is specified, Podman searches a list of registries in the registry configuration file (/etc/containers/registries.conf) to pull the container image.
You can add different available container image registries such as docker.io(you can also add other registries) to the configuration file.
Edit the file /etc/containers/registries.conf:
# nano /etc/containers/registries.conf
Paste the following content at the end of the file and save.
[registries.search]
registries=["registry.access.redhat.com", "registry.fedoraproject.org", "docker.io"]
Working with Podman images
In this section, we will show you how to search for and pull images and run a container with the Podman command
# podman search ubuntu-22.04
You should see all the Ubuntu 22.04 images in the following output:
To pull Podman images, you can run the command podman pull .
In this example, we will pull the latest version of the nginx image: The output shows that the latest version of nginx can be pulled from any of the 3 registries, whether docker, redhat, or fedoraproject.
# podman pull nginx
Next, to run a test, download and run the “hello-world” image with the following command:
# podman run hello-world
You should see the following result:
Hello from Docker!
This message shows that your installation appears to be working correctly.
This message shows that your installation is working correctly.
To generate this message, Docker performed the following steps:
- The Docker client contacted the Docker daemon.
- The Docker daemon pulled the “hello-world” image from Docker Hub.
- The Docker daemon created a new container from that image that runs the executable that produces the output you are reading.
- The Docker daemon sent that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container:
First, we install podman-docker
# apt install podman-docker
Now we run the following command to run the container.
# docker run -it ubuntu bash
Share images, automate workflows, and much more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, you can visit: https://docs.docker.com/get-started/
Next, you can view the list of downloaded images with the following command:
# podman images
To list the Podman container running on the system, run the command:
# podman ps -a
Remember, if you have questions about this or any other issue related to your servers at Clouding, feel free to write to soporte@clouding.io We are here for whatever you need. Contact us!