Skip to main content
Logo
Overview

podman with terraform

October 25, 2026
1 min read

Using podman instead of regular docker with terraform.

My challenge here is not just using podman instead of docker under terraform but also the following:

  • debian 13 wsl
  • upgrading wsl1 vs wsl2 image
  • windows client is a VM under hyper-v

I needed this because my Windows instance is a VM under Hyper-V

Set-VMProcessor -VMName "VMName" -ExposeVirtualizationExtensions $true

conversion to wsl2 runs a while

PS C:\Users\rrosso> wsl --set-version Debian 2
...

check this is true

❯ cat /etc/wsl.conf
[boot]
systemd=true

check my wsl container is now v2

PS C:\Users\rrosso> wsl -l -v
NAME STATE VERSION
* Debian Stopped 2

install podman if not done already

sudo apt update
sudo apt install -y podman
systemctl --user enable --now podman.socket
systemctl --user enable --now podman.socket
❯ systemctl status podman.socket
○ podman.socket - Podman API Socket
Loaded: loaded (/usr/lib/systemd/system/podman.socket; disabled; preset: enabled)
Active: inactive (dead)
Triggers: ● podman.service
Docs: man:podman-system-service(1)
Listen: /run/podman/podman.sock (Stream)

test

❯ curl --unix-socket "$XDG_RUNTIME_DIR/podman/podman.sock" http://d/_ping
OK

set this before your terraform commands

❯ export DOCKER_HOST="unix://$HOME/podman.sock"