---
title: How to Install Podman on Ubuntu 22.04
url: https://docs.vultr.com/how-to-install-podman-on-ubuntu-2204
description: Learn how to install Podman on Ubuntu 22.04 with our step-by-step guide. Discover the commands, configuration options, and tips for this Docker alternative.
publish_date: 2025-04-30T11:48:04.871000Z
last_updated: 2025-04-30T12:16:43.409000Z
author: Aashish Chaurasiya
header_image: https://docs.vultr.com/public/doc-assets/2176/c1735daf-aeae-42ec-9966-f8b26d4a6e1f.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Podman is an open-source container management tool that enables you to develop, manage, and run OCI containers without a background daemon process. Its daemonless design enhances security and reduces resource usage.

This article explains installing Podman on Ubuntu 22.04 and performing essential container operations to manage containerized applications.

## Prerequisites

Before you begin:

* Have an [Ubuntu 22.04 server](https://www.vultr.com/servers/ubuntu/).

* Create a Container Registry to store your Podman container images. This article uses Vultr Container Registry as an example, but the commands can be adapted to any registry by switching to the appropriate registry-specific variables.

* Access the server using SSH as a non-root user with sudo privileges.

* [Update the server](https://docs.vultr.com/how-to-update-a-vultr-cloud-server#how-to-update-almalinux,-centos,-rocky-linux,-and-vzlinux).

## Install Podman

Podman is available in the default Ubuntu 22.04 package repositories. Follow the steps below to install Podman using the APT package manager:

1. Update the server's package index.

    ```console
    $ sudo apt update
    ```

1. Install Podman.

    ```console
    $ sudo apt install podman -y
    ```

1. View the installed Podman version on your server.

    ```console
    $ podman --version
    ```

    Your output should be similar to the one below.

    ```
    podman version 3.4.4
    ```

## Manage the Podman System Service

Podman uses two system services: `podman` for managing containers through the CLI, and `podman.socket` for remote API access via systemd. `podman.socket` enables remote management and integration with development tools. Follow the steps below to manage and enable Podman services on your server.

1. Enable the service to automatically start at system boot.

    ```console
    $ sudo systemctl enable podman.socket
    ```

1. Start the service.

    ```console
    $ sudo systemctl start podman.socket
    ```

1. Stop the service.

    ```console
    $ sudo systemctl stop podman.socket
    ```

1. Restart the service.

    ```console
    $ sudo systemctl restart podman.socket
    ```

1. View the service status and verify that it's running.

    ```console
    $ sudo systemctl status podman.socket
    ```

    Output:

    ```
    ● podman.socket - Podman API Socket
         Loaded: loaded (/usr/lib/systemd/system/podman.socket; enabled; preset: enabled)
         Active: active (listening) since Mon 2024-08-26 12:07:01 UTC; 37s ago
       Triggers: ● podman.service
           Docs: man:podman-system-service(1)
         Listen: /run/podman/podman.sock (Stream)
         CGroup: /system.slice/podman.socket
    ```

## Deploy Containerized Applications using Podman

Podman uses image sources defined in the `/etc/containers/registries.conf` file to pull container images. Follow the steps below to deploy an HTTP server using the Nginx container image from Docker Hub.

1. Pull the Nginx container image from Docker Hub.

    ```console
    $ podman pull docker.io/nginx:alpine
    ```

    Output:

    ```
    Trying to pull docker.io/library/nginx:alpine...
    //...
    Writing manifest to image destination
    1ae23480369fa4139f6dec668d7a5a941b56ea174e9cf75e09771988fe621c95
    ```

1. List all container images available on the server.

    ```console
    $ podman images
    ```

    Verify that the Nginx container image is available in your output.

    ```
    REPOSITORY               TAG         IMAGE ID      CREATED      SIZE
    docker.io/library/nginx  alpine      1ae23480369f  6 weeks ago  45.1 MB
    ```

1. Run a new containerized application using the Nginx image.

    ```console
    $ podman run -d --name nginx-server -p 9090:80 docker.io/nginx:alpine
    ```

1. List all running Podman container processes.

    ```console
    $ podman ps
    ```

    Output:

    ```
    CONTAINER ID  IMAGE                           COMMAND               CREATED        STATUS        PORTS                 NAMES
    20628c4b7d0f  docker.io/library/nginx:alpine  nginx -g daemon o...  4 seconds ago  Up 4 seconds  0.0.0.0:9090->80/tcp  nginx-server
    ```

1. Test access to the container using the host port `9090`.

    ```console
    $ curl http://localhost:9090
    ```

    Output:

    ```
    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to nginx!</title>
    //.....
    ```

## Log in to Vultr Container Registry

Podman supports custom registries like the Vultr Container Registry for building and storing container images. Follow the steps below to create a Python FastAPI application, build a container image, and push it to your Vultr Container Registry.

1. Access your Vultr Container Registry's management panel to view the registry's username and API key credentials.
1. Create a new environment variable to store your Vultr Container Registry name.

    ```console
    $ export VULTR_CONTAINER_REGISTRY_NAME=<enter the Vultr Container Registry name>
    ```

1. Create another environment variable to store the registry username.

    ```console
    $ export VULTR_CONTAINER_REGISTRY_USERNAME=<enter the Vultr Container Registry username>
    ```

1. Create a environment variable to store the registry's API key.

    ```console
    $ export VULTR_CONTAINER_REGISTRY_API_KEY=<enter the Vultr Container Registry API key>
    ```

1. Log in to your Vultr Container Registry using the environment variable values.

    ```console
    $ podman login sjc.vultrcr.com/$VULTR_CONTAINER_REGISTRY_NAME -u $VULTR_CONTAINER_REGISTRY_USERNAME -p $VULTR_CONTAINER_REGISTRY_API_KEY
    ```

    Replace `sjc.vultrcr.com` with the URL of the region where your VCR is hosted.

    Output:

    ```
    Login Succeeded!
    ```

1. Create a new Python application file `app.py`.

    ```console
    $ nano app.py
    ```

1. Add the following contents to the file.

    ```python
    from fastapi import FastAPI, Response
    import uvicorn

    app = FastAPI()

    @app.get("/")
    def hello():
        return Response(content="Hello from Vultr", media_type="text/plain")

    if __name__ == "__main__":
        uvicorn.run(app, host="0.0.0.0", port=5000)
    ```

    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.

1. Create a new `Dockerfile` configuration.

    ```console
    $ nano Dockerfile
    ```

1. Add the following contents to the file.

    ```dockerfile
    FROM python:3.12-slim
    WORKDIR /app
    COPY app.py /app
    RUN pip install fastapi uvicorn
    EXPOSE 5000
    CMD ["python", "app.py"]
    ```

    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`.

1. Build the container image with all files in your working directory.

    ```console
    $ podman build -t python-fastapi-app .
    ```

    Output:

    ```
    //...
    Successfully tagged localhost/python-fastapi-app:latest
    8f00b7a023da93ce714c41ab817be66913385f8c8583b4c38e59a35e53af0037
    ```

1. Tag the container image with your Vultr Container Registry's name.

    ```console
    $ podman tag python-fastapi-app sjc.vultrcr.com/$VULTR_CONTAINER_REGISTRY_NAME/python-fastapi-app:v1
    ```

    Replace `sjc.vultrcr.com` with the URL of the region where your VCR is hosted.

1. List all container images on your server and verify that the tagged image is available.

    ```console
    $ podman images
    ```

    Output:

    ```
    REPOSITORY                               TAG         IMAGE ID      CREATED         SIZE
    sjc.vultrcr.com/demo/python-fastapi-app  v1          8f00b7a023da  30 seconds ago  217 MB
    localhost/python-fastapi-app             latest      8f00b7a023da  30 seconds ago  217 MB
    docker.io/library/nginx                  alpine      1ae23480369f  6 weeks ago     45.1 MB
    docker.io/library/python                 3.12-slim   8d6f9eba56c9  11 days ago     135 MB
    ```

1. Push the image to your Vultr Container Registry.

    ```console
    $ podman push sjc.vultrcr.com/$VULTR_CONTAINER_REGISTRY_NAME/python-fastapi-app:v1
    ```

    Replace `sjc.vultrcr.com` with the URL of the region where your VCR is hosted.

    Output:

    ```
    //...
    Writing manifest to image destination
    ```

1. Deploy a new containerized application using your Vultr Container Registry image.

    ```console
    $ podman run -d --name demo-app -p 5000:5000 sjc.vultrcr.com/$VULTR_CONTAINER_REGISTRY_NAME/python-fastapi-app:v1
    ```

1. Test access to the application using Curl on the host port `5000`.

    ```console
    $ curl http://localhost:5000
    ```

    Output:

    ```
    Hello from Vultr
    ```

## Conclusion

In this article, you installed Podman on Ubuntu 22.04 and deployed containerized applications. Podman allows you to build, store, and run containers on your server efficiently.
