Vhtforums
AI Assistant
Windows Server Dock...
 
Notifications
Clear all

Windows Server Docker Access Denied or Daemon is not running for non admin

1 Posts
1 Users
0 Reactions
3,776 Views
Brandon Lee
Posts: 677
Admin
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@brandon-lee)
Member
Joined: 16 years ago
[#142]

There are a lot of threads out there troubleshooting permissions errors with Docker Desktop in Windows client operating systems. However, if you run into the error "Access Denied" or "Docker daemon is not running" in Windows Server, how do you fix it when Docker Desktop is not installed?

The error

Generally, you may see this error if you have installed Docker on a Windows Server, using Microsoft's installation script as an administrator user (which is typical installation steps). Then you try to run Docker as a "normal" user that is not an administrator.

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1

Then, run this command:

.\install-docker-ce.ps1

What does the error look like when you run Docker as a non-admin user?

The error

The solution

The solution involves:

1) Create a new local group called docker-users and add users to that group

2) Create a special file called daemon.json in the C:\ProgramData\docker\config directory

3) Restart the Docker engine

4) Test using your non-admin user

 

1) Create a new local group called docker-users and add users to that group

Begin by creating a new local group called docker-users

Creating the Docker users group

2) Create a special file called daemon.json in the C:\ProgramData\docker\config directory

Create the daemon.json file

Add the following contents to the file:

{
    "group": "docker-users"
}

3) Restart the Docker engine

Login as an administrator. Navigate to services.msc, find the Docker Engine, right-click, and Restart.

Restart the Docker Engine

4) Test using your non-admin user

Now we can log in as the non-admin user. Launch PowerShell or command prompt without admin privileges and we can now successfully run Docker commands.

Docker commands are now successful