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.
Enable WSL
Follow the instructions on the official documentation to install WSL2.
Install Ubuntu
-
We recommend using an Ubuntu LTS release supported by Playwright with WSL2.
Playwright, the end-to-end testing library used by freeCodeCamp, supports specific Ubuntu and Debian releases. Check its system requirements before choosing a release.
You may use other non-Debian-based distributions, they all come with their own ‘gotchas’ that are beyond the scope of this guide.
Here is how you can run a linux flavour of your choice
-
Update the dependencies for the OS
sudo apt update sudo apt upgrade -y # cleanup sudo apt autoremove -y
Set up Git
Check that Git is installed in your Ubuntu distribution:
git --versionIf Git is not installed, run sudo apt install git.
(Optional but recommended) You can now proceed to setting up your ssh keys with GitHub.
Installing a Code Editor
We recommend installing Visual Studio Code on Windows with its WSL extension. Follow the official VS Code WSL guide to connect to your Ubuntu distribution.
You will edit and store your code in your Ubuntu distribution, with VS Code installed on Windows.
Installing Node.js and pnpm
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:
nvm install --ltsFor 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:
npm install -g pnpmOptimize memory allocation
The default settings for your WSL installation can vary. Allocate memory and swap space according to your workload and the resources available on your machine.
Follow the official WSL configuration guide to configure these limits and apply your changes.
Set up freeCodeCamp Locally
Now that you have installed the pre-requisites, follow our local setup guide to clone, install and set up freeCodeCamp locally on your machine.
Troubleshooting
Here are some useful links:
- Official FAQ for Windows Subsystem for Linux.
- Getting help from our community.