Setting up Windows 10 for web development, including Docker, Linux, and Node.js

I recently had a catastrophic crash of my desktop, so it was time for a fresh Windows 10 install. Which also meant getting my development environment set back up. Modern webdev environments have a lot going on, especially when you throw Docker into the mix, and there are always a bunch of little useful Windows tweaks that are easy to forget. So I documented all the details for future reference, and to share.

Programs to Install

If you’ll be running Docker (see below), then a lot of your webdev needs can be met by various Docker images. Outside of those, the core programs I use for web development are:

  • Git

Setting up Linux and Docker (via WSL2)

You can get fantastic Docker + Linux support via “Windows Subsystem for Linux 2” (WSL2).

You can work through the official Docker docs and the official WSL2 installation docs, which will soon become more up to date than this post. Alternatively, I’ve tried to distill all the steps and make things easier to follow.

Here’s how to get Linux + Docker running on Windows for web development:

  1. Get Linux running via WSL2.

Whew, now you’re all set up!

To run your distro, you can directly go to Startwsl, or you can run the wsl command inside PowerShell or your favorite terminal.

Important: if your Docker containers will be accessing files, make sure those files are in the Linux filesystem instead of the mounted Windows one (otherwise performance is terrible). Once you’ve logged into your Linux distro, you can run cd ~ to get to your home folder inside the Linux filesystem.

When Docker is running on Windows, you can run the docker and docker-compose commands from within your Linux distro.

VSCode with WSL2

If you set up WSL2, you can launch VSCode in a Linux directory by running the code . command in Linux. The first time you do this, VSCode will offer recommended extensions that will make things run as smoothly as possible. Install those. The next time you do this, some other stuff will get installed. After that everything will work like magic.

CTO and Fullstack Webdev at Butterscotch Shenanigans