{"id":23317,"date":"2023-12-31T19:20:12","date_gmt":"2023-12-31T19:20:12","guid":{"rendered":"https:\/\/linuxways.net\/?p=23317"},"modified":"2023-12-31T19:20:12","modified_gmt":"2023-12-31T19:20:12","slug":"install-podman-on-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/install-podman-on-debian-12\/","title":{"rendered":"How To Install Podman on Debian 12"},"content":{"rendered":"<p>In the Linux operating system, the applications can be installed and managed by containerizing them and to manage all the containerizing applications Podman is used. Podman can be used either by the command line interface or its GUI application. It is similar to that of the Docker container engine, but the only difference is that it is a deamon-less architecture. Containers actually are the complete package of an application which not only has the application itself but all the required dependencies needed for the proper function of the respective application.<\/p>\n<h3><strong>Outline: <\/strong><\/h3>\n<ul>\n<li><a href=\"#post-23317-i3tka0gjff5w\"><strong>Install Podman<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-njtkjhvb3vek\"><strong>Through alvistack Repository<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-tz3ogny2mvvd\"><strong>Through Flatpak<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-epj1gkwhppny\"><strong>Through Default Repository<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-eu1nwc503696\"><strong>Configuring Podman<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-pzeps0fvukzs\"><strong>Using Podman in Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-kczt4ezg9l2m\"><strong>Removing Podman<\/strong><\/a><\/li>\n<li><a href=\"#post-23317-5gisg3th9w4t\"><strong>Conclusion<\/strong> <\/a><\/li>\n<\/ul>\n<h2><a id=\"post-23317-i3tka0gjff5w\"><\/a><strong>How To Install Podman on Debian 12<\/strong><\/h2>\n<p>Podman due to its new and innovative architecture makes it a favorable choice for developers especially when it comes to Linux operating systems like Debian. Moreover, from the developer&#8217;s perspective, it is quite difficult to manage applications due to complex infrastructure and this is where containers come into play. So Podman is the open-source tool that manages all the containers in a Debian system, here are some ways to install it:<\/p>\n<h2><a id=\"post-23317-njtkjhvb3vek\"><\/a><strong>Method 1: Through alvistack Repository <\/strong><\/h2>\n<p>Repositories in Linux systems are the locations from where the applications can be installed if a more advanced version is required or if the default repository has the respective application missing. Here are some steps for installing Podman on Debian 12:<\/p>\n<h3><strong>Step 1: Add alvistack Repository <\/strong><\/h3>\n<p>The repository related to the advanced packaging tool is usually added to the file which contains all the sources list so to save the address for the repository execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st_h\">'deb http:\/\/download.opensuse.org\/repositories\/home:\/alvistack\/Debian_12\/ \/'<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>home:alvistack.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"233\" class=\"wp-image-23320\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-1.png 770w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-1-300x91.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-1-768x232.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<h3><strong>Step 2: Download the Repository Key <\/strong><\/h3>\n<p>Usually installing any application on any Linux system such as Debian through repositories requires an authentication key so in the case of Podman execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-fsSL<\/span> https:<span class=\"sy0\">\/\/<\/span>download.opensuse.org<span class=\"sy0\">\/<\/span>repositories<span class=\"sy0\">\/<\/span>home:alvistack<span class=\"sy0\">\/<\/span>Debian_12<span class=\"sy0\">\/<\/span>Release.key <span class=\"sy0\">|<\/span> gpg <span class=\"re5\">--dearmor<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>trusted.gpg.d<span class=\"sy0\">\/<\/span>home_alvistack.gpg <span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">\/<\/span>dev<span class=\"sy0\">\/<\/span>null<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"466\" class=\"wp-image-23322\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-2.png 761w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-2-300x184.png 300w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/p>\n<p>Once you have added the key and the repository update the packages list for the advanced packaging tool so that Podman can be added.<\/p>\n<h3><strong>Step 3: Install Podman on Debian 12<\/strong><\/h3>\n<p>Once the repository is successfully added to the advanced packaging tool install Podman on Debian by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> podman <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"321\" class=\"wp-image-23325\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-3.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-3-300x125.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-3-768x319.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p>Now to verify the installation of Podman on Debian check its version:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"190\" class=\"wp-image-23331\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-4.png 760w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-4-300x75.png 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/p>\n<h2><a id=\"post-23317-tz3ogny2mvvd\"><\/a><strong>Method 2: Through Flatpak <\/strong><\/h2>\n<p>Just like the advanced packaging tool flatpak is also a package manager that is used to install applications on Debian. Whereas the flathub is the repository that provides the applications to flatpak. Usually, by default, flatpak is not installed on Debian 12 so you have to install it first and for that execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> flatpak<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"488\" class=\"wp-image-23338\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-5.png 760w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-5-300x193.png 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/p>\n<p>If you want to get the GUI version of Podman then use this method as flathub provides the desktop version of Podman and for that execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">flatpak <span class=\"kw2\">install<\/span> flathub io.podman_desktop.PodmanDesktop<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"769\" height=\"368\" class=\"wp-image-23345\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-6.png 769w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-6-300x144.png 300w\" sizes=\"auto, (max-width: 769px) 100vw, 769px\" \/><\/p>\n<p>Now if you encounter the error of <em>no remote refs for flathunb<\/em> then it means that the repository for flathub is not added in the system so for that execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">flatpak remote-add <span class=\"re5\">--if-not-exists<\/span> flathub https:<span class=\"sy0\">\/\/<\/span>flathub.org<span class=\"sy0\">\/<\/span>repo<span class=\"sy0\">\/<\/span>flathub.flatpakrepo<\/div><\/div>\n<p>After that run the installation command again and there will be no error this time:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"474\" class=\"wp-image-23351\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-7.png 767w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-7-300x185.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/p>\n<p>Now again run the installation command for Podman and to launch the desktop version of Podman execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">flatpak run io.podman_desktop.PodmanDesktop<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"717\" class=\"wp-image-23359\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-8.png 793w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-8-300x271.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-8-768x694.png 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/p>\n<h2><a id=\"post-23317-epj1gkwhppny\"><\/a><strong>Method 3: Through Default Repository <\/strong><\/h2>\n<p>One of the easiest ways to install any application on any of the Linux distributions is by using its default package managing tool as it contains packages for almost all the applications so in the case of Podman execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> podman podman-compose <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"318\" class=\"wp-image-23366\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-9.png 762w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-9-300x125.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p>Now to verify the installation of Podman on Debian check its version<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"222\" class=\"wp-image-23372\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-10.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-10-300x87.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<h3><a id=\"post-23317-eu1nwc503696\"><\/a><strong>Configuring Podman on Debian 12<\/strong><\/h3>\n<p>To make Podman function properly it is necessary to have it configured properly as in the command below I am searching for the images related to docker, but Podman is giving an error of rootless mode. The rootless mode exempts the administrator privileges for editing any application. This approach comes with several advantages in scenarios where attackers won&#8217;t be able to gain root access and every user can run, manage, or edit any application on the same system.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman search docker<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"237\" class=\"wp-image-23378\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-11.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-11-300x93.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<p>Moreover, Podman as mentioned above is demon-less and by default, it uses the rootless mode for interacting with containers. Now to provoke the unprivileged user with network namespaces and user mode networking install the <em>slirp4netns<\/em> and since for the non-root users, the kernel overlay module is not accessible which results in the unavailability of overlay driver for storage and for that installation of fuse<em>-overlayfs<\/em> is required:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> slirp4netns fuse-overlayfs <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"298\" class=\"wp-image-23390\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-12.png 761w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-12-300x117.png 300w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/p>\n<p>Now give the number for the subordinate users and the ID for the groups that are associated with the account on which you are going to use Podman. Here I have given a random range for my account linuxways:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">--add-subuids<\/span> <span class=\"nu0\">100000<\/span>-<span class=\"nu0\">165535<\/span> <span class=\"re5\">--add-subgids<\/span> <span class=\"nu0\">100000<\/span>-<span class=\"nu0\">165535<\/span> linuxways<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"238\" class=\"wp-image-23396\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-13.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-13-300x93.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>Since the rootless mode allows running the Podman container on Debian without any administrator rights to run Podman in rootless mode <em>uidmap<\/em> is a dependency that needs to be installed. This dependency primarily uses the newuidmap and newgidamp executables to map the IDs for the users and groups on the host. As a result of this, the Podman containers can run without requiring admin rights:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> uidmap <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"294\" class=\"wp-image-23406\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-14.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-14-300x114.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-14-768x292.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p>Now try searching for any container, and you will see Podman running in rootless mode.<\/p>\n<h3><a id=\"post-23317-pzeps0fvukzs\"><\/a><strong>Using Podman in Debian 12 <\/strong><\/h3>\n<p>Podman like Docker can be used for running, building, and managing the containers as it uses the open container initiative which makes it suitable to be used on an industrial level. So here are commands for various tasks that will help you get started with Podman:<\/p>\n<h3><strong>1: Searching For Images Using Podman on Debian <\/strong><\/h3>\n<p>The images are a sort of read-only file for the application which is not executable and needs to be built to make it executable. So, search for any image in the Podman execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman search docker<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"279\" class=\"wp-image-23414\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-15.png 775w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-15-300x108.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-15-768x276.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<h3><strong>2: Downloading an Image Using Podman in Debian 12<\/strong><\/h3>\n<p>Downloading an image can serve multiple purposes as it can be shared with other users, used on a different architecture or to update the current application. Podman stores the downloaded image in the local storage as it can be reused again, the image can be downloaded by using the pull command with Podman, and for building a container it is not necessary to download its image:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman pull docker<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"580\" class=\"wp-image-23426\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-16.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-16-300x228.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<h3><strong>3: Building an Image with Podman on Debian<\/strong><\/h3>\n<p>For building an image or a container it is required to create a container file or a docker file which contains the code which is basically the instructions for building an image. So for illustration, I have created a docker file that contains the code for building an image of the latest version of Fedora:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">nano<\/span> Dockerfile<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"757\" height=\"572\" class=\"wp-image-23439\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-17.png 757w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-17-300x227.png 300w\" sizes=\"auto, (max-width: 757px) 100vw, 757px\" \/><\/p>\n<p>Here in the code I have used a dummy email, and using the <em>FROM<\/em> keyword, I have updated Fedora to the latest version. Next, I updated the packages for Fedora and installed the HTTP server using the run command. Further, the image size is also reduced by cleaning the cache and then the server is directed to port 80 using the <em>EXPOSE<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co0\"># Base on the most recently released Fedora<\/span><br \/>\n<br \/>\nFROM fedora:latest<br \/>\n<br \/>\nMAINTAINER ipbabble email buildahboy<span class=\"sy0\">@<\/span>redhat.com <span class=\"co0\"># not a real email<\/span><br \/>\n<br \/>\n<span class=\"co0\"># Install updates and httpd<\/span><br \/>\n<br \/>\nRUN <span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;Updating all fedora packages&quot;<\/span>; dnf <span class=\"re5\">-y<\/span> update; dnf <span class=\"re5\">-y<\/span> clean all<br \/>\n<br \/>\nRUN <span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;Installing httpd&quot;<\/span>; dnf <span class=\"re5\">-y<\/span> <span class=\"kw2\">install<\/span> httpd <span class=\"sy0\">&amp;&amp;<\/span> dnf <span class=\"re5\">-y<\/span> clean all<br \/>\n<br \/>\n<span class=\"co0\"># Expose the default httpd port 80<\/span><br \/>\n<br \/>\nEXPOSE <span class=\"nu0\">80<\/span><br \/>\n<br \/>\n<span class=\"co0\"># Run the httpd<\/span><br \/>\n<br \/>\nCMD <span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;\/usr\/sbin\/httpd&quot;<\/span>, <span class=\"st0\">&quot;-DFOREGROUND&quot;<\/span><span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p><strong><br \/>\n<\/strong>Once you have created and edited the file with the necessary instructions, then use the build command in the same directory in which you have created the docker file:<strong><br \/>\n<\/strong><\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman build <span class=\"re5\">-t<\/span> fedora-http-server .<\/div><\/div>\n<p><strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"337\" class=\"wp-image-23448\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-18.png 780w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-18-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-18-768x332.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/strong><\/p>\n<p>Here the t flag allows the user to name the image and the dot at the end tells that the instruction file is a docker file placed in the same directory.<\/p>\n<h3><strong>4: Listing Local Images Using Podman on Debian <\/strong><\/h3>\n<p>The images that are stored in the local storage of Podman can be listed to view their details which include their ID, name size, and creation time. These details can be further used in building an image or managing the build image, to list the images use the images command with Podman:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman images<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"214\" class=\"wp-image-23457\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-19.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-19-300x83.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-19-768x212.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<h3><strong>5: Running Container Images Using Podman on Debian <\/strong><\/h3>\n<p>To run any image using Podman on Debian use the <em>run <\/em>command and it will create and start a container from that image, moreover, if the image is not present in the local storage it will automatically pull the image. Here for illustration, I have run the docker image along with its version command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman run docker docker <span class=\"re5\">-v<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"217\" class=\"wp-image-23465\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-20.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-20-300x84.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-20-768x216.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<p>Likewise, I have run the image that I have built previously named <em>fedora-http-server<\/em>. Here in the command below the<em> p<\/em> flag publishes the ports of the container image to the host and the <em>rm<\/em> flag is used to remove the cache of the container image once it is terminated:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman run <span class=\"re5\">-p<\/span> <span class=\"nu0\">8080<\/span>:<span class=\"nu0\">80<\/span> <span class=\"re5\">--rm<\/span> fedora-http-server<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"776\" height=\"271\" class=\"wp-image-23470\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-21.png 776w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-21-300x105.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-21-768x268.png 768w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/><\/p>\n<p>Now to verify if the container image is running send the HTTP request to the same port, and if it is running then it will show the HTML code at the output:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl localhost:<span class=\"nu0\">8080<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"488\" class=\"wp-image-23475\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-22.png 782w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-22-300x187.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-22-768x479.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/p>\n<p>To know more about running images using Podman consult its command help by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman run <span class=\"re5\">--help<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"934\" height=\"436\" class=\"wp-image-23480\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-23.png 934w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-23-300x140.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-23-768x359.png 768w\" sizes=\"auto, (max-width: 934px) 100vw, 934px\" \/><\/p>\n<h3><strong>6: Listing Containers Using Podman in Debian <\/strong><\/h3>\n<p>Containers as mentioned above are the image instances that are used as a starting point and then in the run time, the containers use the parameters provided at their time of creation and execution. Since some containers keep on running in the background it is important to keep track of them and for that listing the running containers can be done by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"kw2\">ps<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1055\" height=\"280\" class=\"wp-image-23485\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-24.png 1055w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-24-300x80.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-24-1024x272.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-24-768x204.png 768w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/><\/p>\n<p>Now to list all of the containers on your Debian system using the Podman use the <em>a<\/em> flag with <em>ps <\/em>command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"kw2\">ps<\/span> <span class=\"re5\">-a<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1048\" height=\"319\" class=\"wp-image-23491\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-25.png 1048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-25-300x91.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-25-1024x312.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-25-768x234.png 768w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>To know more about the listing containers using Podman consult its command help by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"kw2\">ps<\/span> <span class=\"re5\">--help<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"769\" height=\"349\" class=\"wp-image-23494\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-26.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-26.png 769w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-26-300x136.png 300w\" sizes=\"auto, (max-width: 769px) 100vw, 769px\" \/><\/p>\n<h3><strong>7: Managing the Containers Using Podman on Debian<\/strong><\/h3>\n<p>Manning the containers usually includes either stopping, removing, or starting a container image so to stop a container image that is running in the background get its container ID and use the stop command to terminate it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman stop f644b0bebb49<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1054\" height=\"325\" class=\"wp-image-23497\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-27.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-27.png 1054w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-27-300x93.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-27-1024x316.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-27-768x237.png 768w\" sizes=\"auto, (max-width: 1054px) 100vw, 1054px\" \/><\/p>\n<p>Moreover, to remove a container image just get its name by listing the containers and use the rm command like this:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman <span class=\"kw2\">rm<\/span> <span class=\"sy0\">&lt;<\/span>container_name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"283\" class=\"wp-image-23501\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-28.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-28.png 894w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-28-300x95.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-28-768x243.png 768w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/p>\n<p>To create an image from a container just get its container ID and use the <em>commit<\/em> command with it, this can be helpful if you want to create a container image on another user that is associated with the same Debian system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman commit <span class=\"re5\">--author<\/span> <span class=\"st0\">&quot;&lt;account-name&gt;&quot;<\/span> b7159e657427<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"804\" height=\"511\" class=\"wp-image-23506\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-29.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-29.png 804w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-29-300x191.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-29-768x488.png 768w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/p>\n<p>Here, the <em>author<\/em> flag allows you to specify the name of the user account in which the image will be created. To know more about the listing containers using Podman consult its command help by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">podman commit <span class=\"re5\">--help<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"290\" class=\"wp-image-23508\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-30.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-30.png 748w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-30-300x116.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/p>\n<h2><a id=\"post-23317-kczt4ezg9l2m\"><\/a><strong>Removing Podman from Debian 12<\/strong><\/h2>\n<p>To remove the Podman if installed using the repository, use the<em> purge<\/em> command with the apt package manager:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt purge podman <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"214\" class=\"wp-image-23510\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-31.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-31.png 765w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-31-300x84.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/strong><\/p>\n<p>Since the repositories are saved in the sources.list.d directory, and they are not empty, purge command won\u2019t be able to do it. So, you have to manually delete them by navigating to that respective directory and then using the <em>rm<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> alvistack.list<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> home:alvistack.list<\/div><\/div>\n<p><strong><br \/>\n<strong><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"230\" class=\"wp-image-23513\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-32.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-32.png 756w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-32-300x91.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/strong><\/strong><\/p>\n<p>To remove the desktop version of Podman just execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">flatpak remove io.podman_desktop.PodmanDesktop<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"268\" class=\"wp-image-23514\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-33.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-33.png 765w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-33-300x105.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/p>\n<p>To remove Podman if installed through the default package manager, then use just execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove <span class=\"re5\">--autoremove<\/span> podman podman-compose <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"304\" class=\"wp-image-23515\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-34.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-34.png 756w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/12\/word-image-23317-34-300x121.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/p>\n<h2><a id=\"post-23317-5gisg3th9w4t\"><\/a><strong>Conclusion <\/strong><\/h2>\n<p>Podman is a container engine that comes with both the GUI version which is named as Podman desktop and the command line version. The desktop version can be installed from Flatpak and the CLI can be installed either using the alvistack repository or by using the advanced packaging tool. Opensuse gives the deb package as well but on Debian, they are uninstallable due to a broken packages error.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>In the Linux operating system, the applications can be installed and managed by containerizing them and to manage all the containerizing applications Podman is used. Podman can be&hellip;<\/p>","protected":false},"author":110,"featured_media":23529,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-23317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=23317"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23317\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/23529"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=23317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=23317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=23317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}