Looking for a powerful and secure alternative to Docker? This tutorial will show you how to install Podman on Ubuntu 22.04 or 24.04, enabling you to easily manage containers without the need for a daemon.
Step 1: Update the system
First, if you encounter any errors while using Podman, you should uninstall Podman from your system before proceeding with the installation. Next, update your system to ensure you have the latest security updates and to rebuild the repository cache.
sudo apt update
Step 2: Install Podman on Ubuntu
sudo apt install podman
Step 2: Configure Podman Registries (Optional)
If you don’t have a repository to retrieve and install container images using Podman, you will need to add them manually. You can utilize popular repositories like Docker.io, Red Hat, and Fedora. This allows you to easily access container images from these sources for use with Podman.
Let’s proceed by running the command to edit the registry configuration file (registries podman):
sudo nano /etc/containers/registries.conf
And copy the line below the last line of the file:
[registries.search] registries=["registry.access.redhat.com", "registry.fedoraproject.org", "docker.io"]
Afterward, save the file by pressing Ctrl+O, followed by the Enter key, and exit with Ctrl+X. You have now completed the installation of Podman on Ubuntu 22.04 LTS and can use Podman to start your projects.
Some terminal command using Podman
Command to check Podman information or version:
podman -v or podman info
Command to stop or start podman container:
podman stop arriveddev podman start arriveddev
Note that “arriveddev” here is just an example name, you need to replace it with the actual name of the container or container ID you want to interact with.