How to Install Podman on Ubuntu: A Step-by-Step Guide

Learn how to install, verify, and run your first container with Podman on Ubuntu using the official Ubuntu repositories.

podman

Introduction to Container Management

Ubuntu

What is Podman?

Podman is an open-source, Linux-native container engine used to develop, manage, and run OCI (Open Container Initiative) containers on your system. Built as part of the libpod library, it allows developers and system administrators to package applications together with all their required files so they run smoothly in any environment. Because it uses standard container images, it works cleanly with images from popular registries like Docker Hub.

One of the biggest advantages of Podman is its daemonless architecture. Unlike traditional container tools that require a background service (daemon) running all the time with full administrator permissions, Podman runs containers directly as regular system processes. This design makes your system lighter, reduces potential security risks, and avoids a single point of failure.

Podman also supports rootless containers out of the box, which means you can pull images, start containers, and manage them as a normal non-root user. Its command-line structure is simple and easy to learn, and it uses familiar commands for pulling, running, stopping, and removing containers. You only need administrator (sudo) privileges during the initial installation, making everyday container management both safe and convenient.

Prerequisites

  • A computer or server running Ubuntu 20.10 or newer (such as Ubuntu 22.04 LTS or Ubuntu 24.04 LTS).
  • A non-root user account with sudo privileges.
  • Access to the Ubuntu Terminal (command line).
  • An active internet connection to download Podman packages and container images.
  • curl or a web browser installed on your machine to test your first running container.

Step-by-Step Installation

1

Update the Package List

Open your terminal and refresh the local Ubuntu package list so your system gets the latest package information from the official repositories:
BASH
sudo apt-get update
2

Install Podman

Install Podman directly from Ubuntu's official repository using the apt-get command:
BASH
sudo apt-get -y install podman
The -y flag automatically confirms the installation prompts.
3

Verify the Installation

Check that Podman is installed and working properly by running the info command as a normal non-root user:
Bash
podman info
You can also view all available commands and usage options at any time with:
Bash
podman --help
4

Pull a Sample Container Image

Download the official Apache HTTP Server (httpd) image to test your setup. Use the full image name (docker.io/library/httpd) so Podman downloads it from the exact registry you want:
Bash
podman pull docker.io/library/httpd
List your local images to confirm the download succeeded:
Bash
podman images
5

Run Your First Container

Start the Apache web server container in detached mode (-d) so it runs in the background, and forward port 8080 on your host machine to port 80 inside the container:
Bash
podman run -d -p 8080:80/tcp docker.io/library/httpd
Check that the container is currently running:
Bash
podman ps
6

Test the Running Container

Send a request to your container using curl on port 8080 (or open http://localhost:8080 in your web browser):
Bash
curl http://localhost:8080
If everything is working properly, you will see the default Apache web page HTML output (It works!).
7

Stop and Remove the Container

When you are finished testing, stop the most recently created container using the -l (--latest) flag:
Bash
podman stop -l
Remove the stopped container from your system:
Bash
podman rm -l
Confirm that the container has been completely removed:
Bash
podman ps -a

Discover CTCservers Dedicated Server Locations

CTCservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.