Skip to main content

Lucoles LTDA

Full Stack Developer, Acquia Certified Drupal 10 and Drupal 7, ITIL, PSM

jump start your full stack local development with WSL2, Node, and Docker integrating Ubuntu under Windows 11

Image
a 3D blue guy with thick nerdy glasses, wearing a lab coat, has an excited look on his face in front of a table with several tech devices laid down.

some time ago I wrote an article with my findings on how to create a local development environment under Windows. since then, a lot has changed, and yet something hasn't: I'm still running Windows (now version 11).

anyway, since I've upgraded my setup, I think it's time to look back on that piece and retrace my steps, updating it for the modern tech we're all using — aren't we?

if you're also on this OS, follow these steps and you'll be running Ubuntu, with pretty much everything you need to mirror your favourite webhost, in a tight and lean package.

so let's dive in.

1. enable WSL2 on Windows 11

open PowerShell as Administrator and enable WSL:

PS> wsl --install
Image
a Powershell screenshot with the output of the command "wsl --install" , which wraps up with the message: "Operation is successful. Changes will not be effective until the system is rebooted."
Caption
by the way, remember to update. and reboot.
$ wsl --update

then set WSL2 as the default version:

$ wsl --set-default-version 2

what's the difference between WSL versions 1 and 2? well, that's a great question, rhetorical person. you can find out more at https://aka.ms/wsl2, but here's a nifty chart:

Image
a table comparing WSL versions 1 and 2; more info at https://aka.ms/wsl2#comparing-features.
Caption
courtesy of Microsoft.

2. install Ubuntu LTS (Long Term Service)

you can find several different Ubuntu versions in the Windows Store. for the purpose of this solution, grab the generic one, which will keep you up to date with current and future major versions.

Image
screenshot of the Ubuntu terminal environment on the Microsoft Windows Store, with some captions in English and others in Portuguese.
Caption
but can you find Windows in the Ubuntu Store? 🤪

keep in mind that the first time you launch it, setting up will take a few minutes. meanwhile, pick a username and password once prompted.

Image
screenshot of the Ubuntu WSL installation wizard in Portuguese with ASCII art of several Linux distributions at the center top and a welcome message below; a Terminal window (in English) to the bottom right with installation outputs and a prompt for username entry; and a list of features to the left, with a Settings button at the bottom left.
Caption
so friendly!

next, update Ubuntu via its terminal:

$ sudo apt update && sudo apt upgrade -y

this is a good command to run from time to time, by the way.

another great tool is Windows Terminal, which will group all your favourite command lines in one, tab-separated place.

3. install NVM (Node Version Manager)

each project runs a different Node.js version. in order to keep up with that, it's nice to have a tool to assist you in swapping versions. that's where NVM comes into play.

run the following command:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash

note: the /v0.40.2/ part is the latest version at the time of writing. double-check periodically at the NVM GitHub repo — look for the readme with instructions.

next, close and reopen the terminal, or run:

$ source ~/.bashrc

then check if NVM is working with:

$ nvm --version

which should return the same value as the version in the URL — in this case, 0.40.2.

then install Node.js v22.14.0 LTS (the latest one) using NVM:

$ nvm install 22

use it with:

$ nvm use 22.14.0

you should see a message such as:

Now using node v22.14.0 (npm v10.9.2)
Creating default alias: default -> 22 (-> v22.14.0)

npm being the Node Package Manager, which installs Node.js dependencies.

if by any chance you don't get the default set, you can set it yourself with:

$ nvm alias default 22.14.0

and verify Node.js:

$ node --version

if you downloaded Windows Terminal, you can open Ubuntu under WSL2 with the down arrow like so:

Image
screenshot of a Windows Terminal zoomed in to show the new tab menu with the options: Windows PowerShell, Command Prompt, Azure Cloud Shell, PowerShell, Ubuntu (highlighted by mouse hover); each option has its corresponding shortcut. below those, in Portuguese: Settings, Command Palette, and About.
Caption
there is really only one choice as far as this guide is concerned.

4. install Docker

along with NVM, Docker will assist you in creating several different containers for your projects, each with a different stack.

start with:

$ sudo apt install -y docker.io docker-compose

then add your user to the docker group:

$ sudo usermod -aG docker $USER

next, you'll choose either DDEV or Lando for your projects. I've already published a guide for the latter, which you can check out here (and as a bonus, will assist you with a Drupal multisite installation.)

and that's it for this guide. happy coding!


Originally published at https://linkedin.com on March 27, 2025.