KisukeJav
KisukeJav

Reputation: 1

Docker error when installing DDEV on WSL2 "Could not connect to a Docker provider."

I have followed the following guide for installing DDEV using WSL2 with Docker inside: https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#windows.

In step 2, when running the installation script, the following error appears:

 * Starting Docker: docker                                                                                       [ OK ]
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker does not seem to be working inside the WSL2 distro yet.
En línea: 63 Carácter: 5
+     throw "docker does not seem to be working inside the WSL2 distro  ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (docker does not...L2 distro yet. :String) [], RuntimeException
    + FullyQualifiedErrorId : docker does not seem to be working inside the WSL2 distro yet.

DDEV seems to have been installed, but Docker is not working.

PS C:\WINDOWS\system32> ddev -v
ddev version v1.24.2


PS C:\WINDOWS\system32> ddev version
time="2025-02-18T11:07:31+01:00" level=fatal msg="\x1b[31mUnable to get Docker context: unable to run 'docker context inspect' - please make sure Docker client is in path and up-to-date: exec: \"docker\": executable file not found in %PATH%\x1b[0m"


PS C:\WINDOWS\system32> docker -v
docker : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or executable program.
Check if you typed the name correctly, or if you included a path, verify that the path is correct and try again.
At line: 1 Character: 1
+ docker -v
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (docker:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

when trying to execute any DDEV command in the WSL terminal (ddev start, ddev config, ect), the following error appears:

Could not connect to a Docker provider. Please start or install a Docker provider.
For install help go to: https://ddev.readthedocs.io/en/stable/users/install/docker-installation/

But in the WSL terminal, it indicates that they are installed:

$ docker -v
Docker version 27.5.1, build 9f9e405

$ ddev -v
ddev version v1.24.2

He tried to find solutions to the error but couldn't find anything.

I have used DDEV on another PC without any issues, but here I can't get it to work. Can anyone help me?

Edit: Clarification: I would like to install it without using Docker Desktop, and by using Docker inside WSL. This is the recommended method according to the DDEV documentation.

Upvotes: 0

Views: 71

Answers (1)

KalEl
KalEl

Reputation: 1

did you install Docker Desktop and do you have WSL Integration Enabled? Since you're using WSL2, you should have Docker Desktop for Windows installed. If it's not installed, install it For the WSL integration, Open Docker Desktop, Go to Settings → Resources → WSL Integration. Ensure Enable integration with my default WSL distro is checked.

Upvotes: 0

Related Questions