This guide explains how to enable HTTPS support for DDEV on Windows using WSL2.
- Open PowerShell as Administrator
- Install mkcert using Chocolatey:
If mkcert is already installed, you can reinstall it with:
choco install mkcert
choco install mkcert --force - Install the root certificate:
mkcert -install
In PowerShell, run:
echo $env:LOCALAPPDATA\mkcertThis should return a path like:
C:\Users\your_username\AppData\Local\mkcert
- Open a WSL2 terminal
- Set
CAROOTto use Windows certificates:Replaceexport CAROOT=/mnt/c/Users/your_username/AppData/Local/mkcertyour_usernamewith your Windows username. - Make this configuration permanent:
echo 'export CAROOT=/mnt/c/Users/your_username/AppData/Local/mkcert' >> ~/.bashrc source ~/.bashrc
In WSL2, run:
mkcert -install- Stop all DDEV projects:
ddev poweroff
- Restart a project:
ddev start
Open your project in the browser using https:// and verify that the certificate is recognized.
If you encounter any errors, ensure that mkcert -install has been executed both on Windows and WSL2.
Thank you for this procedure, works like a charm