Docker CLI on Windows says the client must be run with elevated privileges
docker: error during connectShort answer
The docker client reached for the Windows daemon pipe and was refused or found nothing. The two documented fixes: add your account to the docker-users group and sign out and in again, or start Docker Desktop, which does not start by itself after install. Check which engine, Linux or Windows, the CLI talks to.
Fix it fast
1Find out which cause you have
Run docker version in a normal PowerShell. If the Client block prints but the Server block does not, the CLI is fine and the daemon is the problem.
docker version whoami /groups | findstr /i docker-users2Match what you see, then jump to its fix
- 1
Works in an Administrator terminal, fails in a normal one, and findstr prints nothingYour account is not in the docker-users groupFix - 2
docker version shows the Client block, then an error where the Server block should beDocker Desktop is not runningFix - 3
The error appears only after you used the Switch to Windows containers menu itemThe CLI is pointed at the Windows engine, which is not runningFix
- 1
What does the error look like?
docker: error during connectthe docker client must be run with elevated privileges to connectdocker commands work in an Administrator PowerShell but not in a normal one
Cause 1 of 3
Your account is not in the docker-users group
1Check
Docker Desktop adds the installing user to docker-users. Other users must be added by hand, and the group is needed for features such as Windows containers and Hyper-V.
whoami /groups | findstr /i docker-users2Fix
Add the user from an administrator terminal, then sign out of Windows and sign in again so the new group applies.
net localgroup docker-users "YOUR-USER" /add3Verify
Open a normal PowerShell after signing back in.
docker versionConfirmed by docs.docker.com
Cause 2 of 3
Docker Desktop is not running
1Check
Docker Desktop does not start automatically after installation. Without it there is no daemon to answer the CLI. On first launch it also needs the subscription agreement accepted.
Get-Process "Docker Desktop" -ErrorAction SilentlyContinue2Fix
Start Docker Desktop by searching for it in the Start menu, accept the agreement if asked, and wait until it reports that the engine is running.
# Start menu > Docker Desktop3Verify
The Server block appears.
docker versionConfirmed by docs.docker.com
Cause 3 of 3
The CLI is pointed at the Windows engine, which is not running
1Check
The Docker Desktop menu switches which daemon, Linux or Windows, the CLI talks to. Windows containers need the all-users install and a Pro or Enterprise edition.
docker version2Fix
Switch back to Linux containers from the Docker Desktop tray menu, unless you really need Windows containers.
# Tray icon > Switch to Linux containers...3Verify
docker version shows a Server block again.
docker versionConfirmed by docs.docker.com
How do I stop it coming back?
- Add every developer account that needs Docker to docker-users when you set up a shared PC.
- Start Docker Desktop before you open a terminal to run docker; it does not start by itself after install.
- Leave Linux containers as the default engine unless a project needs Windows containers.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
AH00558: Apache in Docker cannot reliably determine its fully qualified domain name
Set the 'ServerName' directive globally to suppress this message
AH00558 is a warning, not a crash.
2 causes, each with a fixServers
Apache in a Docker container logs AH01114 when it proxies to a backend
AH01114: HTTP: failed to make connection to backend: api
Apache's proxy worker could not open a connection to the address in ProxyPass.
5 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fix