Skip to main content

I recently decided to switch from Docker Desktop to Podman; this article talks about the installation process for both Windows and macOS.

---
title: "Switching from Docker to Podman: Installation Guide"
subtitle: I recently decided to switch from Docker Desktop to Podman; this article talks about the installation process for both Windows and macOS.
author: Jon LaBelle
date: November 8, 2024
source: https://jonlabelle.com/snippets/view/markdown/switching-from-docker-to-podman-installation-guide
---

This guide provides step-by-step instructions for installing Podman, [Podman Compose](https://podman-desktop.io/docs/compose), and Podman Desktop on both Windows and Mac using [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/) and [Homebrew](https://brew.sh).

## Why Switch to Podman?

[Podman](https://podman.io) offers several advantages, including [enhanced security](https://www.redhat.com/en/blog/enhancing-application-container-security-and-compliance-podman) and a daemonless architecture. It also provides full compatibility with [Docker CLI commands](https://docs.docker.com/reference/cli/docker/).

Additionally, [Podman Desktop](https://podman-desktop.io) provides a graphical user interface similar to [Docker Desktop](https://www.docker.com/products/docker-desktop/), making it easier to manage containers visually.

### Summary of Benefits

**Security**  
Podman runs containers as non-root by default, reducing the attack surface and enhancing security.

**Daemonless Architecture**  
Unlike Docker, Podman does not require a central daemon, which simplifies the architecture and improves performance.

**Compatibility**  
Podman is designed to be a drop-in replacement for Docker, supporting most Docker CLI commands and Docker Compose files.

**Flexibility**  
Podman supports rootless containers, making it easier to run containers without elevated privileges.

**Podman Desktop**  
Provides a GUI similar to Docker Desktop, making it easier to manage containers, images, and pods visually.

Now, let's proceed with installing Podman on Windows and macOS.

## Installing Podman on Mac

For macOS, we'll use [Homebrew](https://brew.sh) to install Podman, Podman Compose, and Podman Desktop.

### Step 1: Ensure Homebrew is Installed

First, confirm that Homebrew is installed on your system. If not, you'll need to install it.

You can perform both of these steps with the following commands:

```sh
# If Homebrew isn't installed... install it
if ! command -v brew >/dev/null 2>&1
then
  bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
```

### Step 2: Install Podman on macOS

With Homebrew installed, proceed to install Podman:

```sh
brew install podman
```

### Step 3: Install Podman Compose on macOS

For Docker Compose compatibility, install `podman-compose`:

```sh
brew install podman-compose
```

### Step 4: Install Podman Desktop on macOS

To manage your containers visually, install Podman Desktop:

```sh
brew install --cask podman-desktop
```

### Step 5: Verify the Installation on macOS

Check the installation by verifying the Podman version:

```sh
podman --version
```

You should see the Podman version output, confirming the installation.

### Step 6: Create alias for Docker and Docker Compose

To use Podman as a drop-in replacement for Docker, create an alias in your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`):

```sh
alias docker='podman'
alias docker-compose='podman-compose'
```

Reload your shell configuration or restart your terminal to apply the changes.

## Installing Podman on Windows

On Windows, we'll use [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/) to install Podman, Podman Compose, and Podman Desktop.

### Step 1: Ensure Winget is Installed

Winget, the Windows Package Manager, is included in Windows 10 and Windows 11. If it's not available, install it from the [Microsoft Store](https://aka.ms/getwinget).

### Step 2: Install Podman on Windows

Open PowerShell or Command Prompt with administrative privileges and execute:

```sh
winget install --exact --id RedHat.Podman
```

### Step 3: Install Podman Compose on Windows

To use Docker Compose files, install `podman-compose` via Python's package manager, pip. Ensure Python and pip are installed, then run:

```sh
pip install podman-compose
```

### Step 4: Install Podman Desktop on Windows

To manage your containers visually, install Podman Desktop:

```sh
winget install --exact --id RedHat.Podman-Desktop
```

### Step 5: Verify the Installation on Windows

Confirm the installation by checking the Podman version:

```sh
podman --version
```

You should see the Podman version output, indicating a successful installation.

### Step 6: Create alias for Docker and Docker Compose in PowerShell

To use Podman as a drop-in replacement for Docker, create an alias in PowerShell.

1. Open PowerShell.
2. Add the alias to your PowerShell profile. You can edit the profile by running:
   ```powershell
   notepad $PROFILE
   ```
3. Add the following line to the profile:
   ```powershell
   Set-Alias -Name docker -Value podman
   Set-Alias -Name docker-compose -Value podman-compose
   ```

## Additional considerations for switching to Podman

### Networking

Podman uses a different networking model compared to Docker. For advanced networking configurations, refer to the [Podman Networking Guide](https://github.com/containers/podman/blob/main/docs/tutorials/basic_networking.md).

### Rootless Containers

Podman runs containers as non-root by default. This enhances security but may require adjustments to permissions and configurations. Refer to the [Rootless Containers Guide](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md) for more details.

### Volume Mounts

Ensure that volume mounts and file permissions are correctly configured, as Podman handles these differently from Docker.

## Conclusion

By following these steps, you have successfully installed Podman, Podman Compose, and Podman Desktop on your Mac or Windows machine.

Dive into the [Podman Documentation](https://podman.io/docs) for more advanced usage and configurations.