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
2. Install Podman:
$ sudo apt install podman -y
3. Verify the installed version:
$ podman --version
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
2. Check the socket status:
$ sudo systemctl status podman.socket
3. Stop or restart the socket when needed:
$ sudo systemctl stop podman.socket
$ sudo systemctl restart podman.socket
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
2. Run the container:
$ sudo podman run -d --name example-nginx -p 9090:80 docker.io/nginx:alpine
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
4. Test the container response:
$ curl http://localhost:9090
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
2. Create a Dockerfile:
$ nano Dockerfile
FROM python:3.12-slim
WORKDIR /app
RUN pip install fastapi uvicorn
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]
3. Create a simple application file:
$ nano app.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"message": "Hello from Podman on Ubuntu 26.04"}
4. Build the image:
$ sudo podman build -t example-fastapi-app .
5. Run the custom image:
$ sudo podman run -d --name example-app -p 5000:5000 example-fastapi-app
6. Test the application:
$ curl http://localhost:5000
Next Steps
Podman is now running and serving containers. From here you can:
- Use
podman composefor 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)