UbuntuUbuntu Based

How To Install Podman on Ubuntu 24.04 LTS

Install Podman on Ubuntu 24.04

In this tutorial, we will show you how to install Podman on Ubuntu 24.04 LTS. Podman is a daemonless container engine that enables users to develop, manage, and run containers and pods under the Open Container Initiative (OCI) standards. Developed by Red Hat, Podman provides a command-line interface (CLI) similar to Docker, making it easy for users familiar with Docker to transition seamlessly.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Podman on Ubuntu 24.04 (Noble Numbat). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • Basic familiarity with the command line interface.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • Sufficient storage space for the Podman application.
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • An Ubuntu 24.04 system with root access or a user with sudo privileges.

Install Podman on Ubuntu 24.04

Step 1. Updating the Package Repository.

Updating your system ensures that you have access to the latest packages and security fixes. To update your Ubuntu 24.04 LTS system, open the terminal and run the following command:

sudo apt update
sudo apt upgrade

This command will update the package lists and upgrade any outdated packages to their latest versions.

Step 2. Installing Podman.

With your system updated, you can now proceed to install Podman. Since Podman is available in the official Ubuntu repositories for versions 20.10 and newer, installing it on Ubuntu 24.04 LTS is straightforward. In the terminal, run the following command:

sudo apt install podman

Once the installation is complete, verify that Podman is successfully installed by checking its version. Run the following command in the terminal:

podman --version

This command will display the installed version of Podman, confirming that the installation was successful.

You can also retrieve more detailed information about your Podman installation using the info subcommand:

sudo podman info

This command provides comprehensive details about your Podman setup, including the version, storage configuration, and runtime environment.

Step 3. Basic Podman Commands.

Now that Podman is installed, let’s explore some basic commands to get you started with container management.

  • Running a Container

To run a container using Podman, use the run subcommand followed by the container image name. For example, to run a “hello-world” container, execute the following command:

sudo podman run -it hello-world
  • Listing Containers

To view the list of running containers, use the ps subcommand:

sudo podman ps

 To see all containers, including stopped ones, add the -a flag:

sudo podman ps -a
  • Removing Containers

To remove a container, use the rm subcommand followed by the container ID or name. First, obtain the container ID using the podman ps -a command, and then remove the container with:

sudo podman rm <container_id>

Step 4. Advanced Podman Usage.

Podman offers a wide range of features and capabilities for advanced container management. Let’s explore a few of them.

  • Handling Images

Podman allows you to manage container images efficiently. To list the available images, use the images subcommand:

sudo podman images

To remove an image, use the rmi subcommand followed by the image ID:

sudo podman rmi <image_id>
  • Using Volumes

Volumes provide a way to persist data beyond the lifecycle of a container. To run a container with a volume mounted, use the -v flag followed by the host and container paths:

sudo podman run -v /path/on/host:/path/in/container -it /bin/bash
  • Creating and Managing Pods

Podman’s native support for pods allows you to manage multiple containers as a single unit. To create a new pod, use the pod create subcommand:

sudo podman pod create --name mypod

To run a container inside the created pod, use the --pod flag:

sudo podman run --pod mypod -d <image>

Step 5. Running Rootless Containers.

Podman supports running containers as a non-root user, enhancing security by reducing the attack surface. To run a container as a regular user, simply omit the sudo prefix

podman run -it hello-world

This command runs the “hello-world” container as the current user, without requiring root privileges.

Congratulations! You have successfully installed Podman. Thanks for using this tutorial for installing the Podman on the Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Podman website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button