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

    • Providing a license for package sources
      by Kasimba
      Arch Linux hasn't had a license for any package sources (such as PKGBUILD files) in the past, which is potentially problematic. Providing a license will preempt that uncertainty.

      In RFC 40 we agreed to change all package sources to be licensed under the very liberal 0BSD license. This change will not limit what you can do with package sources. Check out the RFC for more on the rationale and prior discussion.

      Before we make this change, we will provide contributors with...
      11-19-2024, 09:21 AM
    • Linux Binary Analysis for Reverse Engineering and Vulnerability Discovery
      by Kasimba



      by George Whittaker


      Introduction

      In the world of cybersecurity and software development, binary analysis holds a unique place. It is the art of examining compiled programs to understand their functionality, identify vulnerabilities, or debug issues—without access to the original source code. For Linux, which dominates servers, embedded systems, and even personal computing, the skill of binary analysis is...
      11-18-2024, 07:10 PM
    • Ubuntu vs Debian: Linux Distributions Compared Deep Dive
      by Kasimba
      Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide you on the key differences between them from perspective of both corporate enterprise and personal productivity or pleasure usage. After reading this blog post you should be in a better position to decide to select Ubuntu or Debian.
      Stewardship, Licensing, Community and Cost

      Where as Debian is 100% fully committed to free software as defined by the Debian Free Software Guidelines, Ubuntu is created...
      11-17-2024, 08:30 PM
    • Debian Backup and Recovery Solutions: Safeguard Your Data with Confidence
      by Kasimba



      by George Whittaker


      Introduction

      In the digital age, data loss is a critical concern, and effective backup and recovery systems are vital for any Debian system administrator or user. Debian, known for its stability and suitability in enterprise, server, and personal computing environments, offers a multitude of tools for creating robust backup and recovery solutions. This guide will explore these solutions,...
      11-13-2024, 05:30 PM
    • Installing Development Tools on Debian: Setting Up Compilers, Libraries, and IDEs for a Robust Development Environment
      by Kasimba



      by George Whittaker


      Introduction

      Debian is one of the most trusted and stable Linux distributions, making it a top choice among developers and system administrators. Setting up a powerful development environment on Debian involves installing the right tools, compilers, libraries, and Integrated Development Environments (IDEs) that can support various programming languages and workflows. This guide provides...
      11-07-2024, 11:22 PM
    • Building Your Own Ubuntu Personal Cloud: A Step-by-Step Guide to Creating a Secure Data Haven
      by Kasimba



      by George Whittaker


      In today’s digital world, data is more than just information; it’s a part of our lives. From photos and documents to sensitive personal information, our data represents our memories, work, and interests. While cloud storage services are widely available, they often come with privacy concerns, subscription fees, and limitations on customization. This is where building a personal cloud on Ubuntu comes...
      11-07-2024, 04:30 PM
    Working...
    X