Skip to content

Instantly share code, notes, and snippets.

@nico-loeber
Last active May 6, 2022 17:45
Show Gist options
  • Save nico-loeber/bbdae25d1bf6862c791d7ac6cf6fce58 to your computer and use it in GitHub Desktop.
Save nico-loeber/bbdae25d1bf6862c791d7ac6cf6fce58 to your computer and use it in GitHub Desktop.
Proposal: Install DDEV in Windows with WSL Support

Installation

Windows

Install Docker Desktop

Download and install Docker Desktop using the installer for windows.

Install DDEV

Download and install DDEV using the installer for windows.

Check the Setup mkcert option in the installer, when installing DDEV the first time.

Verify your installation

Run ddev --version in a terminal, which should output something like ddev version v1.19.2.

WSL

Using the Windows Subsystem for Linux (WSL) provides close to native linux performance when using ddev.

Install WSL

Install a WSL Distribution by running wsl --install in an administrative terminal. See the Microsoft documentation for additional information.

Install DDEV on Windows

Please follow all the steps of the Windows installation guide above.

Create an alias for ddev in WSL

After installing your WSL distribution, add an alias for ddev.exe in your Linux shell, to access it by ddev.

echo 'alias ddev="ddev.exe"' > ~/.bash_aliases

Verify your installation

Run ddev --version in a terminal, which should output something like ddev version v1.19.2.

 

Troubleshooting

DDEV is not working in Windows

Please refer to the current ddev documentation Windows (traditional/legacy). If this does not solve your problem, please comment your issue.

DDEV in not working as expected in WSL

Make sure docker is available in your WSL Distribution

Run docker --version in your WSL distribution. It should output something like Docker version 20.10.14, build a224086.

In case you get the following, please make sure to enable the docker integration for your WSL distribution. Check out the Docker Desktop WSL 2 backend Documentation for additional information.

The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

For details about using Docker Desktop with WSL 2, visit:

https://docs.docker.com/go/wsl2/

Make sure ddev.exe is available in your WSL Distribution via Interop

Run ddev.exe --version in your WSL distribution. It should output something like ddev version v1.19.2.

In case you get a Command not found error, please make sure interop is enavled for your WSL distribution. Interop can be configured in /etc/wsl.conf in your WSL distribution and should be enabled by default. You can override your current configuration by adding the following lines to the configuration:

[interop]
enabled = true # enable launch of Windows binaries; default is true
appendWindowsPath = true # append Windows path to $PATH variable; default is true

Make sure ddev is available in your WSL Distribution

Run ddev --version in your WSL distribution. It should output something like ddev version v1.19.2.

In case you get a Command not found error, please make sure you have created an alias for ddev.exe. Refer to (Create an alias for ddev in WSL)[#create-an-alias-for-ddev-in-wsl]. Please note the suggested command is for bash only, if you are using any other shell, please check its documentation on how to create a permanent alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment