
Podman is an open-source container management tool that allows you to develop, run, and manage Open Container Initiative (OCI) containers without relying on a background daemon process. Its daemonless architecture enhances security by eliminating the need for a persistent root-privileged service, reducing attack surfaces and improving resource efficiency. On Ubuntu 24.04, Podman provides a lightweight and secure alternative to traditional container runtimes, making it an excellent choice for developers and system administrators looking to deploy containerized applications with greater control and flexibility.
This article explains how to install Podman on Ubuntu 24.04 and perform essential container operations to manage containerized applications. If you're using a different system, check out our articles on Installing and Using Podman on Ubuntu 20.04 and Installing Podman on Rocky Linux 9 for step-by-step instructions tailored to those platforms.
Before you begin:
Podman is available in the default package repositories on Ubuntu 24.04, and the latest version can be installed directly from the official sources. Follow the steps below to install Podman latest version on Ubuntu using the APT package manager on your server.
Update the server's package index.
Install Podman.
View the installed Podman version on your server.
Your output should be similar to the one below.
Podman uses two system services for managing containers, podman CLI and podman.socket. podman is the command-line interface that enables direct interaction with Podman, enabling users to manage resources such as containers, images, and pods. podman.socket is a systemd socket file that provides remote API access to Podman, which is useful for remote management and integration with container development tools. You can use podman.socket to run Podman as a system service. Follow the steps below to manage the Podman system service and enable the application to run on your server.
Enable the Podman service to automatically start at system boot.
Start the Podman service.
Stop the Podman service.
Restart the Podman service.
View the Podman service status and verify that it's running.
Output:
Podman uses a variety of image sources to find and pull container image using registries in the /etc/containers/registries.conf file. Follow the steps below to deploy an HTTP server application based on the Nginx container image from Docker Hub.
Pull the Nginx container image from Docker Hub.
Output:
List all container images available on the server.
Verify that the Nginx container image is available in your output.
Run a new containerized application using the Nginx image.
List all running Podman container processes.
Output:
Test access to the container using the host port 9090.
Output:
Podman supports custom registries such as the Vultr Container Registry to build and store container images. Follow the steps below to create a Python application using FastAPI, build a new application image and push the containerized application image to your Vultr Container Registry.
Access your Vultr Container Registry's management panel to view the registry's username and API key credentials.
Create a new environment variable to store your Vultr Container Registry name.
Create another environment variable to store the registry username.
Create a environment variable to store the registry's API key.
Log in to your Vultr Container Registry using the environment variable values.
Output:
Create a new Python application file app.py.
Add the following contents to the file.
Save and close the file.
The above FastAPI application initializes a new web server on port 5000 that displays a Hello from Vultr message when accessed.
Create a new Dockerfile configuration.
Add the following contents to the file.
Save and close the file.
The above Dockerfile sets up a Python 3.12 environment, installs fastapi and uvicorn, and starts a web server on port 5000 using the Python application file app.py.
Build the container image with all files in your working directory.
Output:
Tag the container image with your Vultr Container Registry's name.
List all container images on your server and verify that the tagged image is available.
Output:
Push the image to your Vultr Container Registry.
Output:
Deploy a new containerized application using your Vultr Container Registry image.
Test access to the application using Curl on the host port 5000.
Output:
You have installed Podman on an Ubuntu 24.04 server and deployed containerized applications. Podman enables you to build, store, and run containerized applications on your server. For more information and configuration options, please visit the Podman documentation.
0 Comments
Be the first to comment and share your perspective with the community.