Skip to content

Instantly share code, notes, and snippets.

@Marc-MMA
Last active October 4, 2025 03:18
Show Gist options
  • Select an option

  • Save Marc-MMA/4bba9e383b65822cda3fa7ebe504733d to your computer and use it in GitHub Desktop.

Select an option

Save Marc-MMA/4bba9e383b65822cda3fa7ebe504733d to your computer and use it in GitHub Desktop.
DDEV HTTPS SSL WSL2

Enable HTTPS with DDEV on Windows + WSL2

This guide explains how to enable HTTPS support for DDEV on Windows using WSL2.

1. Install mkcert on Windows

  1. Open PowerShell as Administrator
  2. Install mkcert using Chocolatey:
    choco install mkcert
    If mkcert is already installed, you can reinstall it with:
    choco install mkcert --force
  3. Install the root certificate:
    mkcert -install

2. Verify the certificate location

In PowerShell, run:

echo $env:LOCALAPPDATA\mkcert

This should return a path like:

C:\Users\your_username\AppData\Local\mkcert

3. Configure mkcert in WSL2

  1. Open a WSL2 terminal
  2. Set CAROOT to use Windows certificates:
    export CAROOT=/mnt/c/Users/your_username/AppData/Local/mkcert
    Replace your_username with your Windows username.
  3. Make this configuration permanent:
    echo 'export CAROOT=/mnt/c/Users/your_username/AppData/Local/mkcert' >> ~/.bashrc
    source ~/.bashrc

4. Install certificates in WSL2

In WSL2, run:

mkcert -install

5. Restart DDEV

  1. Stop all DDEV projects:
    ddev poweroff
  2. Restart a project:
    ddev start

6. Test HTTPS

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.

@rfay
Copy link
Copy Markdown

rfay commented Mar 8, 2025

Jut a note that these things are exactly what the DDEV WSL2 Installation script(s) do for you, and you can run those any time, https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#ddev-installation-windows

@Marc-MMA
Copy link
Copy Markdown
Author

Marc-MMA commented Mar 8, 2025

Jut a note that these things are exactly what the DDEV WSL2 Installation script(s) do for you, and you can run those any time, https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#ddev-installation-windows

Okay! Thank you for your participation. This is something I looked for a lot but not being very good in English I had a lot of difficulty achieving it on my own with the documentation.

Thanks to you,

@hugo-fasone
Copy link
Copy Markdown

hugo-fasone commented Oct 3, 2025

Thank you for this procedure, works like a charm

@rfay
Copy link
Copy Markdown

rfay commented Oct 4, 2025

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