WSL2 (Windows Subsystem for Linux version 2) is finally generally available on recent editions of Windows! Because of Docker’s great support for WSL2, it’s now the preferred way to run your DDEV-Local development environment on Windows. DDEV-Local on WSL2 is as fast as DDEV-Local on Linux, but you have all the Windows niceties you love there.
Traditionally, web developers working on Windows have had to cobble together all the tools that Linux (and macOS) developers take for granted, as well as maintaining and managing versions. With WSL2 Windows developers now have a full Linux toolkit with anything they could ever want (bash, zsh, grep, awk, vim, composer, make, npm, yarn, and on and on), standard packaging, all readily available. With DDEV-Local in the mix they also have a super-fast local development environment that works just the same as it does on Linux, macOS, (or traditional Windows, but much, much faster). And of course the traditional Windows problems with symlinks, different line endings, file formats, shell script support, all are solved by WSL2.
In this screencast I’m just walking through the official DDEV-Local WSL2 Installation Docs, but adding a little more detail. Then I show the basics of installing Chocolatey, mkcert, Docker Desktop, Homebrew, and DDEV-Local, and basic usage of DDEV-Local in action, including a TYPO3 CMS Composer install and demonstrations of a few key commands.
Note: One of the weaknesses of WSL2 is that PHPStorm isn’t really completely ready for it yet. There are two not-quite-satisfactory ways to use PHPStorm though. BUT… VSCode has full and robust support for WSL2, including inside Docker containers. Our original article on WSL2 tells how to set up VSCode for use inside WSL2.
Here’s the video table of contents (opens on YouTube):
- What is DDEV-Local? (1:02)
- What is WSL2? (2:52)
- Advantages and Disadvantages of WSL2 (3:44)
- WSL2 Installation (5:49)
- Installing Docker Desktop (13:29)
- Installing Homebrew and DDEV-Local inside WSL2 (15:22)
- Installing and using bash-completion (19:06)
- Creating a super-simple PHP project (junk project) (20:38)
- Creating a TYPO3 project with
ddev composer create(27:57)
- Some most-important ddev commands (32:11)
- Resources and wrap-up (36:01)
Resources for you:
- DDEV-Local documentation.
- WSL2 and DDEV Installation docs
- Support: Drupal slack and TYPO3 slack #ddev, gitter #ddev, Stack Overflow, and the DDEV-Local issue queue.
- DDEV-Local Project Repository
- More about PHPStorm on WSL2, with full details about how to run it.
- Using WSL2 (and VSCode), DDEV ❤️ WSL2: getting started
- DDEV-Local’s counterpart, DDEV-Live: Includes a free 10-day trial for you to kick the tires on our hosting platform.