Set up freeCodeCamp on Windows Subsystem for Linux (WSL)
This guide covers some common steps with the setup of WSL2.
Once some of the common issues with WSL2 are addressed, you should be able to follow this local setup guide to work with freeCodeCamp on Windows running a WSL distro like Ubuntu.
System Requirements
Hardware:
A fast CPU (6+ cores)
At least 12+ GB RAM
20+ GB of free disk space
(Optional) 30-50 Mbps internet connection
Operating System: Windows 10 64-bit (Version 2004, Build 19041 or higher).
We recommend using Ubuntu-22.04 or above with WSL2.
As of November 2023, Ubuntu and Debian are the only Linux distributions officially supported by Playwright, the end-to-end testing library used by freeCodeCamp.
You may use other non-Debian-based distributions, they all come with their own ‘gotchas’ that are beyond the scope of this guide.
We recommend installing Visual Studio Code. It has great support for WSL and automatically installs all the necessary extensions on your WSL distribution.
Essentially, you will edit and store your code on Ubuntu-22.04 with VS Code installed on Windows.
Docker Desktop for Windows allows you to install and run databases like MongoDB and other services like NGINX and more. This is useful to avoid common pitfalls with installing MongoDB or other services directly on Windows or WSL2.
Follow the instructions on the official documentation and install Docker Desktop for your Windows distribution.
Once Docker Desktop is installed, follow these instructions and configure it to use the Ubuntu-22.04 installation as a backend.
This makes it so that the containers run on the WSL side instead of running on Windows. You will be able to access the services over http://localhost on both Windows and Ubuntu.
We recommend you install the LTS release for Node.js with node version manager - nvm. Once installed use this command to install and use the latest Node.js LTS version:
Terminal window
nvminstall--lts
For instructions on installing and using a different version of Node.js, please refer to the nvm docs.
Node.js comes bundled with npm, which you can use to install pnpm: