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.

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.

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.

Thanks ashish it solved my issue .

You are a life saver thank you!

Here is 2026 I still get this. How does one get to the docker desktop when one cannot get past the “For security reasons C:\ProgramData\DockerDesktop must be owned by an elevated account” error on installation?

Yes installing from an adminstrative powershell.

I answered this myself, but so as to leave breadcrumbs for the next dev:

  • Delete the C:\ProgramData\DockerDesktop directory
  • Open PowerShell as administrator
  • Change to the directory the installer is in
  • Start-Process ‘Docker Desktop Installer.exe’ -Wait install

Dudeeeee, this problem took me a day till I found yours comment. Really appreciate it!!!

You are the GOAT, thank you!!

Powershell is also giving me the Elevated Account Error

I deleted the directory and it gets recreated when I run the powershell and then the error arises

Just solved this for a user. You don’t need CMD or PowerShell.

1. Delete C:\ProgramData\DockerDesktop if present
2. Run Docker installer as administrator (right click on exe, “Run as administrator”)
3. Installer should work fine

The problems is that the installer is janky and doesn’t ask for elevation on it’s own like it should do.

So if you run it without elevation it creates the folder C:\ProgramData\DockerDesktop without admin privileges and THEN it complains the folder is not owned by an elevated account (DUH!)

And if you run it with elevation afterwards it will still fail because C:\ProgramData\DockerDesktop was created improperly. That’s why you have to make sure DockerDesktop doesn’t exist already and delete if it does.

Edit: gave the instructions to a second user and it worked for him too

Thank you guys. Deleting C:\ProgramData\DockerDesktop and running as administrator worked for me. One thing noticed is even if you deleted C:\ProgramData\DockerDesktop but forgot to run as administrator, it will recreate this folder again. So want to clear that again.

thanks for the help. i was having the same problem. i deleted the Docker Desktop and run as an administrator, and it went through

After several searches and dead ends, this worked. Thank you!

Thank you so much ! :folded_hands: :folded_hands:

this helped alot thanks dude

For future users, make sure you don’t have vanguard running.

Thank you so much, it saved my day! Hope this helps more people​:folded_hands::folded_hands: