Installing Podman
This guide provides step-by-step instructions for installing Podman on various operating systems. For the most up-to-date information, refer to the official Podman documentation.
Linux
Podman can be installed on various Linux distributions. Below are the installation instructions for the most common distributions.
For all Linux distributions, after installing Podman, you can install podman-compose to manage multi-container applications.
|
Installing Podman
Ubuntu
# Set up the repository for Podman (Ubuntu 22.04 LTS example)
sudo apt-get update
sudo apt-get install -y curl
# Add Podman repository for Ubuntu 22.04 (Jammy)
REPO="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/"
sudo sh -c "echo 'deb $REPO /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
curl -fsSL $REPO/Release.key | sudo gpg --dearmor -o /usr/share/keyrings/devel-kubic-libcontainers-stable.gpg
# Install Podman
sudo apt-get update
sudo apt-get -y install podman
# Verify installation
podman --version
Red Hat Enterprise Linux (RHEL) 8+
# Enable required repositories
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
# Install Podman
sudo dnf -y install podman
# Verify installation
podman --version
Debian
# Set up the repository for Podman (Debian 12 Bookworm example)
sudo apt-get update
sudo apt-get install -y curl
# Add Podman repository for Debian 12 (Bookworm)
REPO="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/"
sudo sh -c "echo 'deb $REPO /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
curl -fsSL $REPO/Release.key | sudo gpg --dearmor -o /usr/share/keyrings/devel-kubic-libcontainers-stable.gpg
# Install Podman
sudo apt-get update
sudo apt-get -y install podman
# Verify installation
podman --version
Running Podman as Non-Root User
To run Podman without root privileges, you need to create a user namespace:
# Enable user namespaces
sudo sh -c "echo $USER:$(id -u):65536 >> /etc/subuid"
sudo sh -c "echo $USER:$(id -g):65536 >> /etc/subgid"
# Verify non-root operation
podman run hello-world
Configuring Podman as a System Service
To ensure Podman containers start automatically on system boot, you can create a systemd service:
# Create a systemd service file for your container
podman generate systemd --new --name your_container_name --files
# Move the service file to systemd directory
sudo mv container-your_container_name.service /etc/systemd/system/
# Reload systemd
sudo systemctl daemon-reload
# Enable and start the service
sudo systemctl enable --now container-your_container_name.service
Customizing Log Driver and Retention
To configure log driver and retention for all containers:
# Edit the containers.conf file
sudo nano /etc/containers/containers.conf
# Add or modify these settings under [containers]
[containers]
log_driver = "k8s-file"
log_size_max = 52428800 # 50MB
log_tag = "{{.Name}}/{{.ID}}"
Windows Desktop
-
Download the Podman installer for Windows from the official GitHub releases page: https://github.com/containers/podman/releases.
-
Run the installer and follow the on-screen instructions.
-
After installation, open a new PowerShell window and verify the installation:
podman --version
-
Initialize the Podman machine (required for the first run):
podman machine init podman machine start
Using Podman Compose
Using Podman Desktop
Podman Desktop offers a built-in way to manage Compose. Go to Settings > Resources > Compose, and follow the prompts to set up Compose with Podman Desktop.
Using Python
-
Install Python and pip: If you don’t have Python and pip (Python’s package installer) already, download and install them from the official Python website.
-
Install podman-compose: Open a PowerShell or command prompt and run:
pip install podman-compose
-
Verify installation:
podman-compose --version
-
Configure system PATH (if necessary): If
podman-compose
orpython
commands are not recognized, you may need to add Python’s scripts directory (e.g.,C:\Users\<YourUser>\AppData\Local\Programs\Python\<PythonVersion>\Scripts
) to your system’s PATH environment variable.To modify the PATH:
-
Search for "environment variables" in the Windows search bar and select "Edit the system environment variables".
-
Click "Environment Variables…"
-
Select "Path" under "System variables" or "User variables" and click "Edit…"
-
Click "New" and paste the path to Python’s scripts directory
-
Click "OK" on all open dialogs
You may need to restart your terminal or log out and back in for the changes to take effect.
-
-
Using podman-compose:
-
Run
podman-compose up
: Navigate to the directory containing yourcompose.yaml
file and run the command to start your application. -
Verify: Use
podman ps
to see the running containers and access your application in a web browser, if applicable.
-
Windows Server
this installation is only available for Windows Server with desktop environment. |
-
Install podman on the official website.
-
Follow the installation instructions to set-up podman.
-
Verify the installation with the following command:
podman --version
macOS
Using Homebrew (Recommended)
-
Install Homebrew if you haven’t already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Podman:
brew install podman
-
Start the Podman machine:
podman machine init podman machine start
-
Verify the installation:
podman --version
-
If you want to run the docker-compose file for GlueSync, you have to install podman-compose with this command:
brew install podman-compose
-
Run the docker-compose file for GlueSync:
podman-compose up -d
Using Podman Desktop
-
Download and install Podman Desktop from the official website.
-
Launch Podman Desktop and follow the setup wizard.
-
The application will automatically set up a Podman machine for you.
-
You can now use Podman commands in your terminal.