Podman: Networking in WSL

Check if you have any Podman machine available:

If you do not have any Podman machine, create it with:

Deploy something…

Normally on Docker you can access this port 8000 from outside your machine. But for Podman in WSL you will need to add extra command.

Open Windows Terminal or Cmd or PowerShell with Administrator privilege.

netsh interface portproxy add v4tov4 [listenport] [connectaddress] [connectport] [listenaddress]

The listenaddress=* parameter will listen from 0.0.0.0 and from your ip address e.g. 192.168.1.100. If you want more control over this you can make two separate rules.

Now you should be able to access 192.168.1.100:8000 from the host and from neighbouring machines.

If you still cannot access it from outside (neighbouring machines) then make sure you turn off windows firewall (or add port 8000) to the allow list.

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *