Cyberithub

How to Install Podman on MacOS Using 8 Easy Steps

Advertisements

In this article, I will take you through the steps to install Podman on MacOS Using 8 Easy Steps. With the change in docker subscription policy, podman is becoming more and more popular as an alternative solution to create and manage containers. Podman, also known as pod manager tool is a daemonless container engine for developing, managing and running OCI containers on linux/unix distributions. It does not require any daemon service to run containers under the user as compared to docker which runs a daemon service on the background to create images and run containers.

Although podman is much identical to docker in its usage but it is known to be comparatively safer than docker. Podman can be easily installed on almost all the famous Linux and Unix distributions. Here we are going to look into the steps to install Podman on MacOS based systems. More on official website.

 

How to Install Podman on MacOS Using 8 Easy Steps

How to Install Podman on MacOS Using 8 Easy Steps

Also Read: Solved "podman-machine-default_ready.sock: connect: no such file or directory"

Step 1: Prerequisites

a) You should have a running MacOS System.

b) You should have a valid user account.

c) You should have brew utility installed in your System.

 

Step 2: Update Your System

In the first step, you need to install all the available updates definitions or formulae using brew update command as shown below.

cyberithub@macos1066 ~ % brew update

 

Step 3: Install Podman

In the next step, you can install podman by using brew install podman command as shown below. This will download and install podman along with all its dependencies.

cyberithub@macos1066 ~ % brew install podman
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##0=#  #
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################### 100.0%
==> Fetching podman
==> Downloading https://ghcr.io/v2/homebrew/core/podman/manifests/4.5.0
......................................

 

Step 4: Check Version

After successful installation, you can check the installed version by using podman --version command as shown below.

cyberithub@macos1066 ~ % podman --version
podman version 4.5.0

 

Step 5: Initialize Machine

Now that podman is installed, you need to initialize the machine by using podman machine init command as shown below. This basically initializes a linux virtual machine with ssh automatically configured and a user account added.

cyberithub@macos1066 ~ % podman machine init
Extracting compressed file
Image resized.
Machine init complete
To start your machine run:

         podman machine start

 

Step 6: Start Machine

After initializing successfully, you need to start the machine by using podman machine start command as shown below. This will start a default vm called podman-machine-default with all the volumes mounted. It is also important to note that this will configure vm in rootless mode. To give root permissions, you need to run podman machine set --rootful command.

cyberithub@macos1066 ~ % podman machine start
starting machine "podman-machine-default"
WARN[0000] podman helper is installed, but was not able to claim the global docker sock
Waiting for VM ...
Mounting volume... /Users:/Users
Mounting volume... /private:/private
Mounting volume... /var/folders:/var/folders

This machine is currently 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

API forwarding listening on: /Users/cyberithub/.local/share/containers/podman/machine/qemu/podman.sock

Another process was listening on the default Docker API socket address.
You can still connect Docker API clients by setting DOCKER_HOST using the 
following command in your terminal session:

       export DOCKER_HOST='unix:///Users/cyberithub/.local/share/containers/podman/machine/qemu/podman.sock'

Machine "podman-machine-default" started successfully

 

Step 7: SSH to VM

Once the vm started successfully, you can connect to vm using ssh connection by running podman machine ssh command as shown below. To exit out from the vm, you need to use `~.` or `exit`.

cyberithub@macos1066 ~ % podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 38.20230414.2.0
Tracker: https://github.com/coreos/fedora-coreos-tracker
Discuss: https://discussion.fedoraproject.org/tag/coreos

[core@localhost ~]$

 

Step 8: Verify VM

You can verify the current information of the vm by using cat /etc/os-release command as shown below. This will show all the OS and platform related information.

[core@localhost ~]$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="38.20230414.2.0 (CoreOS)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora CoreOS 38.20230414.2.0"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
HOME_URL="https://getfedora.org/coreos/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-coreos/"
SUPPORT_URL="https://github.com/coreos/fedora-coreos-tracker/"
BUG_REPORT_URL="https://github.com/coreos/fedora-coreos-tracker"
REDHAT_BUGZILLA_PROJECT="Fedora"
REDHAT_BUGZILLA_PROJECT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="CoreOS"
VARIANT_ID=coreos
OSTREE_VERSION='38.20230414.2.0'

Leave a Comment