Skip to content

Setup Podman on macOS

Podman is a utility that can be used to create and maintain containers. This post will teach you how to set up Podman on macOS and perform some basic commands.

Preparation

Homebrew

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

bash 5

Install via Homebrew:

brew install bash

Podman

Install via Homebrew:

brew install podman

Podman Machine

Create and start your first Podman machine (2 CPUs, 100GB disk, 4GB memory). Podman machines are backed by QEMU. This will become the default Podman machine:

podman machine init --cpus 2 --disk-size 100 --memory 4096

List all machines:

podman machine ls
NAME                     VM TYPE     CREATED             LAST UP             CPUS        MEMORY      DISK SIZE
podman-machine-default*  qemu        About a minute ago  About a minute ago  2           4.295GB     107.4GB

Start the default machine:

podman machine start

Verify the installation:

podman info

The machine will be configured in rootless mode. If your containers require root permissions (e.g. ports < 1024), or if you run into compatibility issues with non-podman clients, you can switch using the following command:

podman machine set --rootful

Test

Run the Hello World container:

podman run hello-world

Podman Desktop

To start a podman machine automatically at login, also install the Podman Desktop:

brew install --cask podman-desktop