Skip to content

Instantly share code, notes, and snippets.

@nmofonseca
Last active October 9, 2025 15:50
Show Gist options
  • Save nmofonseca/46f8a5360900120e65508d289594e551 to your computer and use it in GitHub Desktop.
Save nmofonseca/46f8a5360900120e65508d289594e551 to your computer and use it in GitHub Desktop.
Use Podman form other WSL

Podman installation

Just download podman from their website and follow the instraction steps to install and setup podman on Windows

WSL distro setup

The steps described here all come from from Podman documentation but for ease of use they are all here described.

Get podman-remote in WSL

export PODMANVERSION="v5.6.2"
wget https://github.com/containers/podman/releases/download/${PODMANVERSION}/podman-remote-static-linux_amd64.tar.gz
sudo tar -C /usr/local -xzf podman-remote-static-linux_amd64.tar.gz

User profile changes

In my case I use zsh, so changes have been done on .zshrc

# Podman
export PATH="$PATH:/usr/local/bin"
alias podman='podman-remote-static-linux_amd64'
alias docker='podman'

Config podman-remote to connect via pipe

podman system connection add --default podman-machine-default-root unix:///mnt/wsl/podman-sockets/podman-machine-default/podman-root.sock

Add user to the right group

sudo usermod --append --groups 10 $(whoami) exit

Testing

From a new WSL session we should now be able to use podman

  • Check connections
podman system connection list
Name                         URI                                                                     Identity    Default     ReadWrite
podman-machine-default-root  unix:///mnt/wsl/podman-sockets/podman-machine-default/podman-root.sock              true        true
  • Check version
podman version
Client:       Podman Engine
Version:      5.6.2
API Version:  5.6.2
Go Version:   go1.25.1
Git Commit:   9dd5e1ed33830612bc200d7a13db00af6ab865a4
Built:        Tue Sep 30 20:38:25 2025
OS/Arch:      linux/amd64

Server:       Podman Engine
Version:      5.6.2
API Version:  5.6.2
Go Version:   go1.24.7
Git Commit:   9dd5e1ed33830612bc200d7a13db00af6ab865a4
Built:        Tue Sep 30 01:00:00 2025
OS/Arch:      linux/amd64
  • Pull image
podman version
Client:       Podman Engine
Version:      5.6.2
API Version:  5.6.2
Go Version:   go1.25.1
Git Commit:   9dd5e1ed33830612bc200d7a13db00af6ab865a4
Built:        Tue Sep 30 20:38:25 2025
OS/Arch:      linux/amd64

Server:       Podman Engine
Version:      5.6.2
API Version:  5.6.2
Go Version:   go1.24.7
Git Commit:   9dd5e1ed33830612bc200d7a13db00af6ab865a4
Built:        Tue Sep 30 01:00:00 2025
OS/Arch:      linux/amd64

You are now able to use podman from your own WSL distro

Add compose support

For this I chose to use docker compose, to install docker compose do the following.

DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
COMPOSE_VERSION="v2.40.0"
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

# To remove the warning 
>>>> Executing external compose provider "/home/nof/.docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<
# Add the following to .zshrc or .bashrc depending or your shell
export PODMAN_COMPOSE_WARNING_LOGS="false"

Test compose

e.g. compose.yaml file:

---
services:
  nginx:
    image: nginx:alpine
    ports:
      - "8080:80"

We should be able now to run compose

podman compose up -d
[+] Running 10/10
 ✔ nginx Pulled                                                                                                                               3.4s
   ✔ e2d0ea5d3690 Download complete                                                                                                           0.0s
   ✔ f80aba050ead Download complete                                                                                                           0.1s
   ✔ 83ce83cd9960 Download complete                                                                                                           0.0s
   ✔ 03e63548f209 Download complete                                                                                                           0.0s
   ✔ 621a51978ed7 Download complete                                                                                                           0.0s
   ✔ 2d35ebdb57d9 Download complete                                                                                                           1.4s
   ✔ 7fb80c2f28bc Download complete                                                                                                           0.0s
   ✔ 76c9bcaa4163 Download complete                                                                                                           0.3s
   ✔ 5e7abcdd2021 Download complete                                                                                                           0.0s
[+] Running 2/2
 ✔ Network democompose_default    Created                                                                                                     0.0s
 ✔ Container democompose-nginx-1  Started               
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment