Welcome! This guide walks you through setting up a modern, container-first development environment on Windows using WSL2 and Docker CE.
You'll enjoy the best of both worlds: Linux power β‘ and Windows convenience πͺβwith everything managed visually and efficiently.
π‘ Tip: WSL2 lets you run Linux inside Windows. Ubuntu is the distro recommended for most devs.
wsl --install
-
Reboot your PC if prompted.
-
Check installed distros:
wsl.exe -l -v
- If Ubuntu is missing, install with:
(If you get errors, see manual install docs.)
wsl.exe --install Ubuntu
- If Ubuntu is missing, install with:
-
Ensure WSL2 mode:
wsl -l -v
Confirm that Ubuntu is using version 2.
-
Update Ubuntu:
π‘ Tip: Keep your Linux fresh and secure!
sudo apt update && sudo apt upgrade
Tip
You can configure WSL to not require a password for sudo.
Replace MY_USERNAME
below with your actual username:
sudo nano /etc/sudoers.d/$(whoami)
Add the following line:
$(whoami) ALL=(ALL) NOPASSWD:ALL
This script sets up Docker CE and DDEV natively in WSL2 π‘
π’ This is the most reliable way to run Docker in WSL2.
Youβll get Docker CE (Community Edition) and DDEV, a dev environment manager.
- Open a PowerShell terminal (not as admin).
- Run this script:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ddev/ddev/main/scripts/install_ddev_wsl2_docker_inside.ps1'))
- Enable Windows Update for other products:
- Go to Settings > Windows Update > Advanced Options
- Turn ON:
Receive updates for other Microsoft products
- Occasionally update WSL2:
wsl.exe --update
π‘ Tip: Now you can open the βUbuntuβ terminal app or Windows Terminal to use your new Linux dev box!
No need to install PHP, Composer, Node directly on WSL!
Use Docker containers for everything! π₯³
Example: Run a PHP script
docker run -it --rm --name my-running-script \
-v "$PWD":/usr/src/myapp \
-w /usr/src/myapp \
php:8.2-cli php your-script.php
Quick PHP hello:
docker run --rm php:8.2-cli sh -c 'php -r "echo \"Hello, World!\n\";"'
Run Composer:
docker run --rm --interactive --tty \
--volume $PWD:/app \
composer <command>
π‘ Tip: Configure your Git identity so your commits are properly attributed.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --list
- Install the 1Password desktop app
- Install the 1Password CLI
- Enable 1Password SSH agent.
- Set up Git commit signing with SSH
Verify SSH connection to GitHub:
ssh -T [email protected]
From your Linux terminal, use these commands to download and install popular Linux applications. Remember, if your distribution isn't Ubuntu, the package manager may vary from apt. Once installed, access the app through the Start menu under your distribution name. For instance, Ubuntu -> Microsoft Edge.
For more info check Linux GUI Apps.
A secure, privacy-focused web browser.
sudo apt install brave-browser -y
# To Launch:
brave-browser
A modern, Rust-based terminal with AI features and speed.
Download:
Visit warp.dev for the latest Linux installation instructions.
Launch:
Type warp
in your terminal (after install).
Nemo is a powerful and user-friendly file manager.
sudo apt install nemo -y
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
# To Launch:
nemo
The new default text editor for GNOME/Ubuntu 22.10 and later.
sudo apt install gnome-text-editor -y
# To Launch:
gnome-text-editor
π Note:
If you're on Ubuntu older than 22.10 or prefer the classicgedit
, see below.
The previous default text editor for GNOME/Ubuntu.
sudo apt-get install gedit -y
# To Launch:
gedit
A free and open-source raster graphics editor for photo and image manipulation.
sudo apt install gimp -y
# To Launch:
gimp
π‘ Tip: Use VS Code or VS Code Insiders with Remote extensions for the best experience.
-
Install these VS Code extensions:
- Remote - WSL
- Remote - Containers
- Remote - SSH
- GitHub Codespaces
-
Launch VS Code from WSL2:
code . code-insiders .
(This starts the VS Code server in WSL2 if not already running.)
π― Task | π Command |
---|---|
Update WSL2 | wsl.exe --update |
Update Ubuntu | sudo apt update && sudo apt upgrade -y |
Run PHP in Docker | docker run --rm php:8.2-cli php -v |
Run Composer in Docker | docker run --rm -it -v $PWD:/app composer |
Open VS Code (WSL2) | code . |
Open VS Code Insiders | code-insiders . |
Test SSH to GitHub | ssh -T [email protected] |
Open File Manager (Nemo) | nemo . |
WSL2 Official Docs
DDEV Getting Started
Docker CE Install
1Password CLI Docs
VS Code Remote
π Happy Coding! Your dev environment is now modern, fast, and secure. π