Unleash the Power of Containerization: Installing and Running Podman on macOS

RuchikaSreedhar
3 min readSep 4, 2023

--

In the rapidly evolving landscape of software development and
deployment, containerization has become a cornerstone technology.
Among the myriad of containerization tools, Podman stands out as a lightweight, flexible, and efficient choice for macOS users. This guide is
your gateway to the world of Podman, taking you through the seamless
process of installing and running containers on your macOS system.

Installing Podman on MacOS

There are multiple avenues to bring Podman into your macOS
environment. Below, we’ll explore two popular methods: using Homebrew
for convenience and manual installation for those who prefer hands-on
control.

Method 1. Using Homebrew

Homebrew, the popular macOS package manager, simplifies software
installations. Let’s get started with Podman:

  1. Open your terminal: Launch your terminal to begin the installation journey.
  2. Install Homebrew: If Homebrew isn’t already installed, execute the following command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

3. Install Podman: Once Homebrew is up and running, simply type:

brew install podman                                                                                

Method 2. Manual Installation

For those who prefer a more hands-on approach, manual installation is the way to go:

  1. Visit Podman’s GitHub Releases Page: Go to the Podman GitHub releases page.
  2. Select the Right MacOS Version: Under the latest release, find the assets section and select the file corresponding to your macOS version.
  3. Install Podman: Once downloaded, drag the Podman desktop application to your Applications folder for a hassle-free installation.

Setting Up Podman

With Podman successfully installed on your macOS system, let’s explore
two paths for setting it up: using the intuitive desktop application or
leveraging the power of the command-line interface (CLI).

Using Podman Desktop

  1. Launch Podman Desktop: Find and open the Podman desktop application located in your Applications folder.
  2. Install Podman: Click on “Install Podman” within the application.It will automatically configure Podman for you. In case of errors, the CLI method is available as a backup.

Using CLI to Set Up Podman

In case you encounter issues with the desktop application, you can
manually set up Podman using the command-line interface:

  1. Open your terminal: Fire up your terminal for some command-line magic.
  2. Execute the Following Commands: Copy and paste these commands to initiate the Podman setup
podman machine stop
podman machine rm
podman machine init -v $HOME:$HOME -v /Users -v /Volumes -v /usr/local/lib/node_modules
podman machine set --rootful
podman machine start

These commands will ensure a smooth start for your Podman desktop.

Verifying Your Installation
To ensure Podman is up and running without a hitch, use these
commands:

  • Check Running Containers:
podman ps
  • Run a New Container (Example with Nginx):
podman run -d -p 8080:80 nginx
  • List Running Containers:
podman ps
  • Stop a Container (Replace <container_id> with the actual ID):
podman stop <container_id>

Uninstalling Podman

Should you ever decide to bid adieu to Podman, here’s how to do it:

  1. If you installed Podman using Homebrew:
  • Delete all Podman-related files from the /opt path of your computer.
  • Remove any Podman-related files from the /Cellar path.

2. If you installed Podman manually:

  • Delete all Podman-related files from the /opt path.

This will ensure a thorough and clean uninstallation of all Podman-related
files and directories.

Conclusion

Podman opens the door to effortless container and pod management on
macOS. Whether you opt for the swift Homebrew installation or the hands-
on manual setup, Podman empowers you with a robust containerization
solution for your development and deployment needs. Dive in today and
embark on your containerization journey with confidence. Happy coding!

--

--