Learn the commands to install and use Podman on Debian 12 or 11 Linux, a Docker alternative for creating virtual containers.
Podman is open source and a user-friendly way to create virtual containers but with a daemon-less approach. That’s what makes it different from other traditional containerization platforms. However, its command line is quite similar to Docker to create, deploy, and manage containers but without the need for a dedicated container runtime daemon.
Here in this tutorial, we will discuss the steps involved in the installation of the Podman on Debian Linux using the command terminal.
Step 1: Update Debian Repositories
Before using the APT package manager to install any application, let’s first run the system update command. So, access your Debian 12, 11, or 10’s terminal and run the given command.
sudo apt update
Step 2: Install Podamn on Debian 12, 11 or 10
Podman doesn’t require any third-party repository to get installed on Debian Linux, it is already available to fetch through the system’s default ones. So, we just need to use our APT package manager to run the given command.
sudo apt install podman
The above command will ask for your user password. Provide that and the system will install the required packages automatically.
Step 3: To Check the version
As we are done with the installation, let’s check what version of Podman is installed on our system, this will also confirm we have this platform on our system.
Step 4: Search and pull images
Let’s now pull some images to create our first container, here we are going for the Ubuntu image. For that, we use the Pull command just like we do in Docker because the command syntax & options of Podman and Docker are similar.
podman pull ubuntu
Step 5: Create a Container
Now, we have the Ubuntu Image on our system, let’s see how to use it for creating a container. But one thing before doing that, if you have multiple Images on your system and want to list them all, the command will be:
This helps you to choose the right image before creating a container.
Now, the command is:
podman run -dit --name linuxshout ubuntu
--name is a parameter to give the container whatever friendly name we want to assign, here we have used
Ubuntu is the name of the Image we have downloaded and want to use.
We have successfully created the container, and if you want to check what containers are currently active, you can use:
And to see both active and stopped containers, in short, all of them, use:
podman ps -a
Get running container command-line access:
podman attach container-name
For example, here our container name is Linuxshout, so the command will be:
podman attach linuxshout
Step 6: Stop or Start a Container
If you want to start or stop any container, then the command will be:
podman stop container-id or name
podman stop linuxshout
podman start container-id or name
podman stop linuxshout
In case you don’t require Podman any more than to remove it, you can follow the given command. However, before that backup your containers and their data.
sudo autoremove --purge podman