DEV Community

Cover image for Installing Podman on Ubuntu 26.04
Aashish Chaurasiya for Vultr

Posted on • Originally published at docs.vultr.com

Installing Podman on Ubuntu 26.04

Podman is a daemonless container engine compatible with Docker's CLI and OCI container formats. Unlike Docker, Podman runs without a background daemon — each container is its own process, with no single point of failure. This guide installs Podman on Ubuntu 26.04, deploys a live Nginx container, and builds a custom image from a Dockerfile. By the end, you'll have Podman running containers and a custom application image ready for use.


Install Podman

Podman is available in Ubuntu 26.04's default APT repository.

1. Update the APT package index:

$ sudo apt update
Enter fullscreen mode Exit fullscreen mode

2. Install Podman:

$ sudo apt install podman -y
Enter fullscreen mode Exit fullscreen mode

3. Verify the installed version:

$ podman --version
Enter fullscreen mode Exit fullscreen mode

Manage the Podman Service

Enable the Podman socket for API access and compatibility with Docker-based tooling.

1. Enable and start the socket:

$ sudo systemctl enable podman.socket
$ sudo systemctl start podman.socket
Enter fullscreen mode Exit fullscreen mode

2. Check the socket status:

$ sudo systemctl status podman.socket
Enter fullscreen mode Exit fullscreen mode

3. Stop or restart the socket when needed:

$ sudo systemctl stop podman.socket
$ sudo systemctl restart podman.socket
Enter fullscreen mode Exit fullscreen mode

Run a Containerized Application

Pull the official Nginx image and run it as a container to verify the installation.

1. Pull the Nginx image:

$ sudo podman pull docker.io/nginx:alpine
Enter fullscreen mode Exit fullscreen mode

2. Run the container:

$ sudo podman run -d --name example-nginx -p 9090:80 docker.io/nginx:alpine
Enter fullscreen mode Exit fullscreen mode

Flags:

  • -d: run detached (background)
  • --name example-nginx: human-readable container name
  • -p 9090:80: map host port 9090 to container port 80

3. Verify the container is running:

$ sudo podman ps
Enter fullscreen mode Exit fullscreen mode

4. Test the container response:

$ curl http://localhost:9090
Enter fullscreen mode Exit fullscreen mode

The Nginx welcome page in the output confirms the container is running.


Build a Custom Image

1. Create a project directory:

$ mkdir ~/example-app
$ cd ~/example-app
Enter fullscreen mode Exit fullscreen mode

2. Create a Dockerfile:

$ nano Dockerfile
Enter fullscreen mode Exit fullscreen mode
FROM python:3.12-slim
WORKDIR /app
RUN pip install fastapi uvicorn
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]
Enter fullscreen mode Exit fullscreen mode

3. Create a simple application file:

$ nano app.py
Enter fullscreen mode Exit fullscreen mode
from fastapi import FastAPI
app = FastAPI()

@app.get("/")
def read_root():
    return {"message": "Hello from Podman on Ubuntu 26.04"}
Enter fullscreen mode Exit fullscreen mode

4. Build the image:

$ sudo podman build -t example-fastapi-app .
Enter fullscreen mode Exit fullscreen mode

5. Run the custom image:

$ sudo podman run -d --name example-app -p 5000:5000 example-fastapi-app
Enter fullscreen mode Exit fullscreen mode

6. Test the application:

$ curl http://localhost:5000
Enter fullscreen mode Exit fullscreen mode

Next Steps

Podman is now running and serving containers. From here you can:

  • Use podman compose for multi-container orchestration with Docker Compose files
  • Push images to Docker Hub or a private registry with podman push
  • Configure rootless Podman to run containers without sudo

For the full guide with additional tips, visit the original article on Vultr Docs.

Top comments (0)