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
762 Views
Brandon Lee
Posts: 395
Admin
Topic starter
(@brandon-lee)
Member
Joined: 14 years ago

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