Error when trying to run Windows containers: docker client must be run with elevated privileges

I was trying many ways. Reinstall many time. But I am not able to run docker windows container.
I use windows 11
Docker version : 4.20.1
In my machine linux container works. But when I switch to windows one it give me following error when I run docker version command.

error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get “http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version”: open //./pipe/docker_engine: The system cannot find the file specified.
Client:
Cloud integration: v1.0.33
Version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:53:15 2023
OS/Arch: windows/amd64
Context: default

Are you trying this with an admin account?

  1. If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.

I know you wrote Linux containers work, but maybe that doesn’t require an admin account because in case of the WSL backend. I am guessing, because I rarely work on Windows.

1 Like

Thanks for reply.
I can not able to see any user group in computer management. And also I use only one user which one is admin.

Then I’m sorry, but I don’t know why you get the error message. Maybe an antivirus blocked some Docker services. It happened before. You could try to temporarily disable your antivirus preferrably without connecting to the internet during that time.

I was getting the same issue solved it by simple steps


Just open docker desktop–>settings–>general–>tick the field expose daemon on tcp–>apply&restart

That’s it now run your command in terminal most probably it will word.

1 Like

It is worth noting that it makes Docker available to any user on the machine, but if it really listens on localhost only, the risk is minimal.

1 Like

Thanks ashish it solved my issue .