smhk

Installing Docker Desktop using local admin

TL;DR: If you installed Docker Desktop with a local admin account, you must manually add your (non-admin) user account to the docker-users group. This is mentioned in the official docs, but is easy to miss.

Problem §

I have used local admin to install Docker Desktop. The installation worked fine, but docker commands do not work. When everything is working, you should be able to run docker run hello-world and a container will run that prints Hello from Docker!. However, I get these errors:

  • “The system cannot find the file specified”1:

    docker: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Head "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: The system cannot find the file specified.
    See 'docker run --help'.
  • “Access is denied”1:

    docker: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Head "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: Access is denied.
    See 'docker run --help'.

Additionally, I noticed that the Docker Desktop service was not running. This would normally be indicated by the presence of Docker icon in the system tray. I tried running the Docker Desktop app, but nothing happened.

Fix §

The fix is mentioned in the official docs2:

If your administrator account is different to your user account, you must add the user to the docker-users group:

  • Run Computer Management as an administrator.
  • Navigate to Local Users and Groups > Groups > docker-users.
  • Right-click to add the user to the group.
  • Sign out and sign back in for the changes to take effect.

I followed those steps, and then after logging back in again, I was able to launch the Docker Desktop app. Then I was able to log in to Docker Desktop (which authenticates via the browser) and use containers as normal.

Verify §

Now if we run docker run hello-world it works as expected:

C:\>docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

All good!


  1. Although both error messages say “the docker client must be run with elevated privileges to connect”, it is not helpful to run Docker Desktop as admin to try and fix this. While I found doing so enabled the Docker Desktop app to run (presumably since it was using the local admin account and so was part of the docker-users group), I was unable to login to Docker Desktop. My hypothesis is that, because the login goes via the browser, and the browser is run as a regular (non-admin) user account, it cannot tell the Docker Desktop app that the login was successful. ↩︎ ↩︎

  2. More suggestions can be found here↩︎