Cloud Native 11 min read

Run Podman on macOS Without Docker: A HyperKit‑Based Guide

This article explains how to run Podman on macOS by installing HyperKit, creating a lightweight Ubuntu VM, configuring Podman's remote API socket, and connecting the local CLI via SSH, providing a more resource‑efficient alternative to Docker Desktop.

Programmer DD
Programmer DD
Programmer DD
Run Podman on macOS Without Docker: A HyperKit‑Based Guide

HyperKit Introduction

HyperKit is a lightweight virtualization toolset that provides a full hypervisor based on xhyve (the BSD hypervisor) and serves as the backend for components such as VPNKit and DataKit.

Docker on macOS also uses HyperKit for better performance compared to the earlier VirtualBox approach.

1. Install HyperKit

You can compile HyperKit from source, but the recommended methods are:

Install Docker Desktop for Mac, which bundles HyperKit, then back up the hyperkit binary before uninstalling Docker if you wish to use HyperKit alone.

Install Multipass, which provides HyperKit on macOS, and retrieve the hyperkit binary from /Library/Application Support/com.canonical.multipass/bin/.

$ brew cask install multipass

2. Create a Virtual Machine

Using Multipass is the simplest way: $ multipass launch -c 2 -d 10G -m 2G -n podman -n : instance name

-c : CPU count

-d : disk size

-m : memory size

List VMs:

$ multipass list
Name    State    IPv4          Image
podman  Running  192.168.64.2  Ubuntu 20.04 LTS

Enter the VM:

$ multipass shell podman

3. Install Podman Inside the VM

ubuntu@podman:~$ . /etc/os-release
ubuntu@podman:~$ echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
ubuntu@podman:~$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
ubuntu@podman:~$ sudo apt-get update
ubuntu@podman:~$ sudo apt-get -y upgrade
ubuntu@podman:~$ sudo apt-get -y install podman

4. Set Up Podman Socket

Podman uses systemd socket activation. The podman.socket creates a listening socket at /run/podman/podman.sock. When a client connects, systemd starts podman.service to handle the request.

# /lib/systemd/system/podman.socket
[Unit]
Description=Podman API Socket
Documentation=man:podman-system-service(1)

[Socket]
ListenStream=%t/podman/podman.sock
SocketMode=0660

[Install]
WantedBy=sockets.target

# /lib/systemd/system/podman.service
[Unit]
Description=Podman API Service
Requires=podman.socket
After=podman.socket
Documentation=man:podman-system-service(1)
StartLimitIntervalSec=0

[Service]
Type=notify
KillMode=process
ExecStart=/usr/bin/podman system service

Enable and start the socket: $ sudo systemctl enable podman.socket --now Verify it works:

$ podman --remote info
host:
  arch: amd64
  cgroupManager: systemd
  cpus: 2
  ...

5. Configure the Local CLI

Generate an SSH key on macOS and add the public key to /root/.ssh/authorized_keys inside the VM.

$ ssh-keygen -t rsa   # press Enter for defaults

Install the Podman client locally: $ brew install podman Add the remote connection:

$ podman system connection add ubuntu --identity ~/.ssh/id_rsa ssh://[email protected]/run/podman/podman.sock

List connections (the first one becomes the default):

$ podman system connection list
Name      Identity                URI
podman*   /Users/youruser/.ssh/id_rsa  ssh://[email protected]:22/run/podman/podman.sock

Test the remote setup:

$ podman ps
$ podman pull nginx:alpine
$ podman image ls

Memory Usage

The HyperKit VM consumes about 921M of physical memory, which is lower than Docker Desktop’s typical footprint.

Conclusion

This guide shows how to run Podman on macOS by creating an Ubuntu VM with HyperKit, enabling Podman's socket‑activated API, and connecting the local CLI via SSH, offering a daemon‑less, lightweight container experience.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ContainermacOSPodmanremote APIHyperKit
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.