最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

windows subsystem for linux - Docker error when installing DDEV on WSL2 "Could not connect to a Docker provider.&qu

programmeradmin3浏览0评论

I have followed the following guide for installing DDEV using WSL2 with Docker inside: .

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: /

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.

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.

Share Improve this question edited 2 days ago KisukeJav asked 2 days ago KisukeJavKisukeJav 11 bronze badge New contributor KisukeJav is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 8
  • PS C:\WINDOWS\system32> docker -v - it does not look like you're running the command within WSL after all, because you wouldn't use C:\WINDOWS in that, would you? Also, did you try to use Docker Desktop? Finally, if Docker itself is not running properly, are you sure this problem is in any way related to DDEV? – Nico Haase Commented 2 days ago
  • @nico-haase I have run docker -v both in Windows and in WSL, and in WSL it shows that it is installed as indicated in the post. Installing Docker Desktop will be an option if I can't resolve the issue.. – KisukeJav Commented 2 days ago
  • @KisukeJav, you need to start the docker service in WSL2 to make it work. docker -v is not an indicator that it works. service docker start or systemctl start docker and then run docker ps to check if it works or not. – stasadev Commented 2 days ago
  • Hi - DDEV Maintainer here. If you're going to use DDEV on traditional Windows (as you show here) you need to use Docker Desktop. The DDEV in WSL2 instructions show you how to use DDEV in WSL2. Please take another look at the docs, see ddev.readthedocs.io/en/stable/users/install/docker-installation/… – rfay Commented 2 days ago
  • @rfay, I read the link you shared. The section I'm interested in is "Docker CE Inside Windows WSL2," which leads me to another link—the guide I initially followed: ddev.readthedocs.io/en/stable/users/install/ddev-installation/…. In step 2, where it says to run the script in PowerShell, I get the error I mentioned at the beginning of the post. Am I doing something wrong? – KisukeJav Commented 2 days ago
 |  Show 3 more comments

1 Answer 1

Reset to default 0

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论