Replacing Docker with Podman on Windows
Peter Saktor

Peter Saktor @petersaktor

Joined:
Dec 8, 2024

Replacing Docker with Podman on Windows

Publish Date: Mar 11
2 0

If you're looking for a lightweight and daemonless alternative to Docker on Windows, Podman is a great choice. This guide walks you through installing Podman on Windows, setting up Podman Compose, and configuring it to work seamlessly with the Docker CLI.

1. Installing Podman Desktop and Podman on Windows

Podman provides a user-friendly desktop application along with the command-line tool. To install it:

  1. Navigate to the official Podman Desktop installation guide.
  2. Follow the instructions to download and install Podman Desktop and Podman CLI.

After installation, ensure that Podman is added to your system PATH and verify the installation:

podman --version
Enter fullscreen mode Exit fullscreen mode

2. Setting Up Podman Compose

Podman Compose allows you to run multi-container applications using docker-compose.yml files. To set it up:

  1. Follow the official Podman Compose setup guide.
  2. Verify the installation:
   podman-compose --version
Enter fullscreen mode Exit fullscreen mode

3. Installing Docker CLI

While Podman provides a Docker-compatible command-line interface, some tools may still require the Docker CLI. You can install it using Windows Package Manager winget:

winget install Docker.DockerCLI
Enter fullscreen mode Exit fullscreen mode

4. Creating a Symlink for Docker Compatibility

To make the Docker CLI use Podman under the hood, create a symbolic link:

  1. Open a PowerShell console and navigate to the WinGet links directory:
   cd C:\Users\<currentuser>\AppData\Local\Microsoft\WinGet\Links
Enter fullscreen mode Exit fullscreen mode
  1. Rename the original Docker executable:
   rename docker.exe docker-ori.exe
Enter fullscreen mode Exit fullscreen mode
  1. Create a symbolic link to the Podman executable:
   New-Item -ItemType SymbolicLink -Path "docker.exe" -Target "C:\Program Files\RedHat\Podman\podman.exe"
Enter fullscreen mode Exit fullscreen mode

Replace <currentuser> with your actual Windows username.

5. Configuring User Permissions

To ensure Podman works properly with the Docker CLI, verify and configure the docker-users group:

  1. Check Available Local Groups: Run the following command to list all local groups:
   net localgroup
Enter fullscreen mode Exit fullscreen mode

Look for docker-users in the list.

  1. Create the 'docker-users' Group (if it doesn't exist): If the docker-users group is not listed, create it using:
   net localgroup docker-users /add
Enter fullscreen mode Exit fullscreen mode
  1. Add Your User to 'docker-users' Group: Run the following command, replacing YourUsername with your actual Windows username:
   net localgroup docker-users YourUsername /add
Enter fullscreen mode Exit fullscreen mode
  1. Log Out and Log Back In This ensures that the group changes take effect.

6. Restart Windows

To ensure all changes take effect, restart your system.

7. Verify Docker Compatibility

After restarting, open PowerShell and check if the docker command now points to Podman:

docker --version
Enter fullscreen mode Exit fullscreen mode

If everything is set up correctly, you should see a version message from Podman.

Conclusion

Congratulations! You've successfully replaced Docker with Podman on Windows. This setup allows you to run containerized applications while maintaining compatibility with existing Docker-based workflows.

For more details, refer to the official Podman documentation.

Comments 0 total

    Add comment