Announcement

Collapse
No announcement yet.

How to Install Podman on Ubuntu 24.04

Collapse
X
Collapse
  •  

  • How to Install Podman on Ubuntu 24.04

    If you have worked with Docker, you must know about daemons, containers, and their functionality. Daemons are services that run in the background while the container has been utilized in any system. Podman is a free management tool that is used to manage and create the containers without depending on any daemon like Docker. Therefore, it has an edge in managing the containers without engaging with long-term background services. Also, Podman doesn’t require the use of root-level rights. This guide thoroughly discusses how to install Podman on Ubuntu 24.
    Update the System

    Let’s start with the system update by launching the Terminal shell of Ubuntu 24 since all our installations and upgrades are command-based. For this simple step, we will utilize the “apt” utility of Ubuntu with sudo rights in the “update” command. This command updates the system utilities and repositories to avoid potential conflicts upon installing new software and applications. You can also perform the system upgrade and update if required.

    Sudo apt update



    Install Podman

    After updating the Ubuntu 24 system, let’s move towards installing Podman. For its installation, we use the same “apt” utility that is very convenient and easy to use within the installation instructions. The “-y” flag is used to force the installation of Podman no matter what. Thus, the installation starts right after the execution of the following query:

    Sudo apt install -y podman



    The installation of the Podman tool may take longer than any other usual installation. Thus, you have to wait for a while until it’s done.



    After waiting for a while, the Podman will be installed and its symlink will be created as displayed in the output:



    Verify the Installation

    Now, we need to verify whether the Podman tool has been successfully installed and configured in our Ubuntu 24 system. For this, we look for the installed version of Podman with the help of a simple version command as follows:

    Sudo podman –version



    To get the information regarding the Podman tool that is installed at your end, you can also utilize the “info” command with sudo rights as follows:

    Sudo podman info



    Run the Containers via Podman

    We can say that the container is a service that utilizes different images for its processing. You can create containers or use the already built-in containers. Therefore, we must pull the container and run it on our end. For this, we use the “Run”  instruction, the “-it” flag, and the name of a container, i.e., hello-world. It will start pulling the container from its main source and running it on our end.

    Sudo podman run -it hello-world



    You will get the following output after the execution of this “run” instruction. You can see that this container has been pulled from the Docker’s main source:



    Now, we can look for all the currently running containers of Ubuntu 24. For this, we utilize the following shown Podman instruction with the “ps” option. The output of this instruction displays that there are no currently working containers. While looking for all the pulled containers, we can use the “-a” flag within the same instruction. You can see that the output with the “-a” option displays the information of one container.
    • Sudo podman ps
    • Sudo podman ps -a



    Remove the Containers

    Just like adding a new container to your system, you can also remove any added container from your Ubuntu 24 system using the Podman tool. You must utilize the “rm” option within the Podman instruction with the sudo rights. Make sure to mention the container ID after the “rm” option within the same query. The container with a particular ID will be removed permanently.

    Sudo podman rm 9bd8d19ef028



    Use Images via Podman

    An image in a Podman environment is said to be the set of instructions required to run a container service or application. So, to run the Podman container, we need a particular image. To list all the available images on Ubuntu 24, you need the same Podman command with the “images” keyword. It displays all the available images in your system, i.e. d2c94e258dcb.

    Sudo podman images



    To get a new image for your Podman environment, you can run the “pull” instruction along with the name of a new image, i.e. “debain”, as shown in the attached image.

    Sudo podman pull debian



    After using the image instructions again, you can see that the new image has been downloaded successfully.

    Sudo podman images



    Create Containers in Podman

    Now that the image has been downloaded, we must run it to create a container with a user-defined name. For this, the “run” instruction for Podman will be executed with the “-dit” and “—name” flags followed by the name of a container, i.e. “Debian-container”, and the name of an image that you just downloaded, i.e. “Debian”. After creating a container from the “Debian” image, you can also see it working in Podman.
    • Sudo podman run -dit –name debian-container debian
    • Sudo podman ps



    To connect with the newly running container named “debian-container”, you need to utilize the “attach” instruction of Podman. Now, you can work within this container.

    Sudo podman attach debian-container



    To get the version of the container, run the following command in this container:

    Cat /etc/os-release



    Now, to get out of the container and stop it from running, you have to use the “exit” instruction followed by the Podman “Stop” instruction with the name of a specific container.
    • exit
    • Sudo podman stop debian-container



    To start, stop, and remove a Podman container, you can use the following commands in a sequence:
    • Sudo podman start debian-container
    • Sudo podman stop debian-container
    • Sudo podman rm debian-container



    You can remove a Podman image using the “rmi” option in the same “remove” command.

    Sudo podman rmi debian



    Uninstall Podman

    It’s time to uninstall the Podman tool from our Ubuntu system using the “remove” instruction. Using the “apt” utility is a must since we installed it with “apt”.

    Sudo apt remove podman



    Conclusion

    This guide is all about using containers and images via the Podman tool. We elaborated on the main difference between a Podman and a Docker service. After that, we elaborated on the simplest method to install Podman in Ubuntu 24 and pulled some containers and images. After that, we went through how to use the containers using images and the steps to uninstall the Podman service.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • 5 Compelling Reasons to Choose Linux Over Windows
      by Kasimba



      by George Whittaker


      Introduction

      In the world of operating systems, Windows has long held the lion’s share of the market. Its user-friendly interface and wide compatibility have made it the default choice for many. However, in recent years, Linux has steadily gained traction, challenging the status quo with its unique offerings. What was once considered the domain of tech enthusiasts and developers is now...
      Yesterday, 06:52 AM
    • NGINX vs Apache; Web Server Comparison
      by Kasimba
      Overview of NGINX and Apache

      NGINX and Apache are leading web server solutions utilized for hosting websites and web applications. Apache, developed by the Apache Software Foundation, offers robust configuration options and extensibility. NGINX, created by Igor Sysoev, is known for its efficiency in handling numerous concurrent connections with low resource utilization. Both servers function not only as HTTP servers but also as reverse proxies, load balancers, and more.

      What is

      ...
      Yesterday, 03:54 AM
    • Monthly News – November 2024
      by Kasimba
      Hi everyone, I hope you are enjoying the BETA so far! This release introduces new features, tools, and artwork, so we anticipate a good number of bug reports. Every single fix helps us refine and improve the final release. Your feedback during the BETA phase is extremely important to us. Linux Mint 22.1 is our […]

      More...
      12-16-2024, 11:50 AM
    • Mastering OpenSSH for Remote Access on Debian Like a Pro
      by Kasimba



      by George Whittaker


      Introduction

      Remote access is a cornerstone of modern IT infrastructure, enabling administrators and users to manage systems, applications, and data from virtually anywhere. However, with great power comes great responsibility—ensuring that remote access remains secure is paramount. This is where OpenSSH steps in, providing robust, encrypted communication for secure remote management....
      12-13-2024, 10:31 PM
    • Unlocking the Full Potential of Linux's Most Versatile Search Tool
      by Kasimba



      by George Whittaker


      Introduction

      The grep command, short for "global regular expression print," is one of the most powerful and frequently used tools in Unix and Linux environments. From sifting through log files to finding patterns in text, grep is a Swiss Army knife for system administrators, developers, and data analysts alike. However, many users limit themselves to its basic functionality, unaware...
      12-13-2024, 09:24 PM
    • Linux Mint 22.1 “Xia” – BETA Release
      by Kasimba
      This is the BETA release for Linux Mint 22.1 “Xia”. Linux Mint 22.1 is a long term support release which will be supported until 2029. It comes with updated software and brings refinements and many new features to make your desktop even more comfortable to use. New features: This new version of Linux Mint contains […]

      More...
      12-12-2024, 09:31 AM
    Working...
    X