{"id":15822,"date":"2025-09-30T18:23:50","date_gmt":"2025-09-30T12:53:50","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15822"},"modified":"2025-10-01T18:55:37","modified_gmt":"2025-10-01T13:25:37","slug":"how-to-setup-podman-on-almalinux-9","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-setup-podman-on-almalinux-9\/","title":{"rendered":"How to Setup Podman on AlmaLinux 9"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-introduction\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Containers have become a foundational tool in modern software development and deployment. Podman (short for pod manager) is an open source tool for developing, managing, and running containers. Developed by Red Hat engineers along with the open source community, Podman manages the entire container ecosystem using the libpod library. In this blog, we will go through the podman installation on <a href=\"https:\/\/almalinux.org\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">AlmaLinux 9<\/mark><\/a> and use it to run containers \u2014 including mounting custom volumes \u2014 which will help get you started with container management on your server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An AlmaLinux\u202f9 server&nbsp;<\/li>\n\n\n\n<li>A non-root user with sudo \/ root privileges<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These are required so you can install packages and manage containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Steps for installation<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Installing Podman<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Podman is included in the AlmaLinux AppStream repository, so you can install it directly via :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install podman<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once installed, verify the version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also get detailed info about the installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman info<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-running-podman-as-a-non-root-user\"><strong>Running Podman as a Non-root User<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To run containers without relying on the root account, create a regular user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo useradd -m -s \/bin\/bash podmanuser\nsudo passwd podmanuser<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add that user to the wheel group to allow sudo rights:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG wheel podmanuser<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable lingering for the user so container processes can run even if the user is logged out:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo loginctl enable-linger podmanuser<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Switch to the new user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - podmanuser<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run a simple container to test:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman run hello-world<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If successful, you get an output like;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1011\" height=\"492\" sizes=\"(max-width: 1011px) 100vw, 1011px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png\" alt=\"\" class=\"wp-image-15823\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png 1011w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-3-300x146.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-3-768x374.png 768w\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Check all containers (running or exited):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman ps -a<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is configured correctly, you should see the hello-world container with status Exited.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"58\" sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4-1024x58.png\" alt=\"\" class=\"wp-image-15824\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4-1024x58.png 1024w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4-300x17.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4-768x43.png 768w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4-1200x68.png 1200w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-4.png 1258w\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-finding-container-images\"><strong>Finding Container Images<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Podman can pull images from DockerHub, quay.io, Red Hat\u2019s registries, and others. By default, these are configured in \/etc\/containers\/registries.conf.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To search for images with a given term (e.g. httpd):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman search httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can limit results by:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman search httpd --limit 3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Downloading Images<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you find an image you like, download it (i.e. \u201cpull\u201d) from the registry:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman pull httpd:alpine<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the pull completes, list your images:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman images<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should now see images like hello-world and the httpd:alpine image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-inspecting-images\"><strong>Inspecting Images<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To inspect a container image for metadata like default command, ports, working directory, etc.:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman inspect docker.io\/library\/httpd:alpine<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also format the output to show specific fields, e.g.:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman inspect --format \"size: {{.Size}}\" docker.io\/library\/httpd:alpine\npodman inspect --format \"ports: {{.Config.ExposedPorts}}\" docker.io\/library\/httpd:alpine\npodman inspect --format \"workdir: {{.Config.WorkingDir}}\" docker.io\/library\/httpd:alpine<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-running-container\"><strong>Running Container<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To start a container (detached, mapping ports, naming it, auto\u2011removing on stop):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman run -it --rm -d -p 8080:80 --name httpd docker.io\/library\/httpd:alpine<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To list running containers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman ps<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can test by using curl (replace with your server\u2019s address):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl http:\/\/&lt;Your_server_IP&gt;:8080\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also point a browser to http:\/\/&lt;server-ip&gt;:8080\/ and expect to see the container\u2019s default page.\\<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Checking Logs of a Container<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To view all logs from the httpd container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman logs httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To limit the log output to, say, the last 20 lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman logs --tail 20 httpd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-stopping-a-container\"><strong>Stopping a Container<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To stop the httpd container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman stop httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then check active\/exited containers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman ps\npodman ps -a<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because the container was run with &#8211;rm, it will be automatically removed upon stopping.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Running Container with Custom Volume<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this part, you will mount a directory from the host into the container:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a directory in the home of user podmanuser, and an index.html file inside:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p ~\/data\/\nnano ~\/data\/index.html<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following HTML content to index.html:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;Hello from Podman&lt;\/title&gt;\n    &lt;style&gt;\n        body {\n            font-family: Arial, sans-serif;\n            text-align: center;\n            padding-top: 100px;\n            background-color: #ffffff;\n   color: #000000;\n        }\n\n        h1 {\n            font-size: 2em;\n            font-weight: bold;\n        }\n\n        p {\n            font-size: 1em;\n            color: #333333;\n        }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Hello from Podman!&lt;\/h1&gt;\n    &lt;p&gt;This HTML page is served from a container using Podman.&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run a new container with the host data directory mounted into the container\u2019s document root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman run --privileged=true -it --rm -d -p 8080:80 --name httpd -v ~\/data:\/usr\/local\/apache2\/htdocs docker.io\/library\/httpd:alpine<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: The &#8211;privileged=true flag is used here for testing; the container still runs under user podmanuser, not root.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the container is running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman ps<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use curl (or a browser) to check that your custom HTML page is served:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl http:\/\/&lt;Your_server_IP&gt;:8080\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"508\" sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-1024x508.png\" alt=\"\" class=\"wp-image-15825\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-1024x508.png 1024w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-300x149.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-768x381.png 768w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-1536x761.png 1536w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5-1200x595.png 1200w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/09\/image-5.png 1600w\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the contents of the index.html you created earlier being served by the container.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-conclusion\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You have now got an idea on the installation and basic usage of Podman on AlmaLinux\u202f9. You learned how to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Podman from the default repositories<\/li>\n\n\n\n<li>Use Podman as a non-root user<\/li>\n\n\n\n<li>Search, pull, inspect, run, log, and stop containers<\/li>\n\n\n\n<li>Mount a host directory as a volume into a container<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for expert help with podman installation on AlmaLinux 9? Our 24\/7 <a href=\"https:\/\/www.skynats.com\/devops-support\/\">DevOps Support Services<\/a> ensure fast setup, reliable performance, and seamless container management. Contact us today to get started!<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Containers have become a foundational tool in modern software development and deployment. Podman (short for pod manager) is an open source tool for developing, managing, and running containers. Developed by Red Hat engineers along with the open source community, Podman manages the entire container ecosystem using the libpod library. In this blog, we will [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1127,1129,1064,972,1128,1130],"class_list":["post-15822","post","type-post","status-publish","format-standard","hentry","category-blog","tag-almalinux-9","tag-almalinux-9-server","tag-devops-support-services","tag-podman","tag-podman-installation","tag-running-podman"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15822"}],"version-history":[{"count":2,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15822\/revisions"}],"predecessor-version":[{"id":15828,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15822\/revisions\/15828"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}