


# Install Docker, you can ignore the warning from Docker about using WSL On my machine it added these 2 files in ~/.docker within my WSL 2 instance: If you previously had Docker Desktop installed you may also want to delete a few symlinks that Docker adds to WSL 2. Since we’re installing Docker directly inside of WSL 2 you won’t need Docker Desktop installed to make this work. You’ll also have options to run Kubernetes directly in WSL 2 if you choose to use KinD or any other tool that lets you run a Kubernetes cluster without Docker Desktop. Volumes are also lightning fast (comparable to native Linux). You’ll get the same conviniences of Docker Desktop such as being able to access localhost in your Windows browser of choice to access any web services you run in Docker since this feature is native to WSL 2. I say “should” because I didn’t personally try every single distro but there’s nothing about this that would hint it won’t work on other distros. This post covers doing this on Ubuntu 20.04 and 22.04 but it should work with any distro that supports running Docker.

Besides going over the steps below it covers the “why” and the pros / cons of doing this. Prefer video? Here’s a recorded version of this tip on YouTube. You won't need to run systemd inside of WSL 2 either. Updated on November 22nd, 2022 in #dev-environment, #docker Install Docker in WSL 2 without Docker Desktop It's really fast and only requires a few lines of shell scripting.
