Podman is a daemonless, open-source tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. In this tutorial, we are going to show you how to install Podman on a Debian 12 server.
Podman, as opposed to Docker, doesn’t use a separate daemon to run containers. This makes Podman more lightweight and secure than Docker. It also provides support for running containers as root and non-root users, and it provides a CLI (Command Line Interface) which can be set as as a docker alias for most users (for example, alias docker=podman). Let’s start with the installation.
Table of Contents
Prerequisites
- A Debian 12 VPS
- SSH root access or a non-root user with sudo privileges
Step 1. Log in via SSH
Let’s log in to our Debian 12 VPS with SSH as a root user or as a regular user with sudo privileges.
ssh root@IP_Address -p Port_number
If you cannot log in as root, remember to replace “root” with a user that has sudo privileges. Additionally, replace the “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port.
Step 2. Install Podman on Debian 12
Update your package index files on the system with this command:
# apt update
You can now install Podman using the apt command:
# apt install podman podman-compose
To check if Podman has been successfully installed, you can run:
# podman version
After which you should receive a similar output to this:
Client: Podman Engine
Version: 4.3.1
API Version: 4.3.1
Go Version: go1.19.8
Built: Wed Dec 31 19:00:00 1969
OS/Arch: linux/amd64
Step 3. Podman container registries
You can check which container registries are configured to be used by Podman at:
/etc/containers/registries.conf
You can notice that by default, Podman is using these registries:
[registries.search]
registries = ['quay.io', 'docker.io']
You can use a different registry configuration for different users, and set up custom or private container registries by creating and editing this file which follows the same format as above:
$HOME/.config/containers/registries.conf
Step 4. Using Podman
Just like Docker, you can use almost the same commands to pull or run containers. To pull the alpine image for example, you can run:
# podman pull docker.io/alpine
You can also simply run podman pull alpine
and select from which container registry to pull the image.
Running an Nginx container with port mapping can be done with this command:
# podman run -dit --name nginx -p 8080:80 docker.io/nginx
This will run an Nginx container in the background, mapping port 80 from the container to port 8080 on our server.
You can also check the containers that are currently running, or all containers that were also previously running with the commands:
# podman ps
# podman ps -a
You can also create pods, for example. To create an empty pod, you can run this:
# podman pod create --name alpine-pod
You can then add containers in the pod with the command:
# podman run -dit --pod alpine-pod apline
To check the containers running inside a pod, you can now run:
# podman ps --pod
Congratulations! You have successfully installed Podman on Debian 12 as well as practiced some of the basic management commands for Podman.
Of course, you don’t have to set up Podman on Debian 12 if you use one of our Debian VPS Hosting services, in which case you can simply ask our expert Linux admins to set up Podman on your Debian 12 VPS for you. They are available 24/7 and will take care of your request immediately.
PS. If you liked this post on how to set up Podman on Debian 12, please share it with your friends on social networks or simply leave a reply in the comments section. Thanks.