Docker users group windows 10

After installing docker on my Windows 10 machine, When I tried to open the docker desktop application encountered with You are not allowed to use Docker . You must be in the “docker-users” group error.

To resolve this issue, You need to add your user to docker-users named group created under Computer Management/user and groups/groups

screenshot

Click on docker-users and add your username in the group.

docker

Apply the changes and then you need to restart your windows to let the changes come in effect

afterdocker

Note: You can refer “Docker Deep Dive” book if you want to understand the underlying concept of Docker. Very well designed for beginners and people who are looking to enhance their knowledge. It can also help you crack the interviews for DevOps with Docker concepts

Published by codenamebazinga

Just Another Geek!
View all posts by codenamebazinga

Published

I am getting the following error,

The current user is not in the ‘docker-users’ group. Add yourself to
the ‘docker-users’ group and then log out and back in to Windows.

How do I resolve this error on Windows?

TAbdiukov's user avatar

TAbdiukov

1,1833 gold badges12 silver badges25 bronze badges

asked Apr 30, 2020 at 19:02

coolblue2000's user avatar

coolblue2000coolblue2000

3,84810 gold badges42 silver badges64 bronze badges

2

Run this command from an administrator command window to add your user id to the docker-users group and log back into your user account for it to take effect.

net localgroup docker-users "your-user-id" /ADD

your-user-id is your local Windows user name. You can determine this by looking at the folder name under C:\Users\ .

Marco Faustinelli's user avatar

answered Aug 6, 2020 at 19:51

Pradyumna Revur's user avatar

Pradyumna RevurPradyumna Revur

1,6311 gold badge5 silver badges3 bronze badges

11

It might occur that the user-group «docker-users» not exist on your machine. In that case enter the following commands in the Powershell

New-LocalGroup -Name 'docker-users' -Description 'docker Users Group'

Add-LocalGroupMember -Group 'Administrators' -Member ('docker-users') –Verbose

Add-LocalGroupMember -Group 'docker-users' -Member ('Username','Administrators') –Verbose

answered Oct 10, 2020 at 12:18

Belekz's user avatar

1

Try restarting the system, that worked for me, as it pushed me to the group automatically.

answered Jun 3, 2022 at 7:46

Raw_Wish's user avatar

Raw_WishRaw_Wish

1631 silver badge6 bronze badges

If you are installing Docker Desktop from Chocolatey, you might only need a restart, as you are put in that group automatically.

answered Mar 18, 2022 at 9:11

cederlof's user avatar

cederlofcederlof

7,2164 gold badges45 silver badges63 bronze badges

In my case, I just uninstall and reinstall the docker. And it fine now.

answered Jun 10, 2022 at 7:47

Muhammad Awais's user avatar

Muhammad AwaisMuhammad Awais

4,2581 gold badge42 silver badges37 bronze badges

0

I just ran into this while trying to upgrade to 17.12.0-ce-win47. That’s what I get for clicking the nice pretty upgrade button. Now, my user is already in the docker-users group. Yet, I can’t delete the Docker folder.. quite maddening. Time to dig through Windows security BS to get this fixed.

Access to the path 'C:\Program Files\Docker\Docker\Bugsnag.dll' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at LightweightInstaller.UnpackArtifactsStep.<DoAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LightweightInstaller.InstallWorkflow.<HandleD4WPackage>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LightweightInstaller.InstallWorkflow.<ProcessAsync>d__18.MoveNext()

Docker is a platform for creating and deploying applications in self-sufficient containers. The installation of Docker is pretty easy in Linux, but this is usually not the case with Windows. In this post, I will show you how to install Docker in Windows 10 or Windows 11 in multiple ways. You’ll learn there is indeed a way that makes the Docker Desktop installation in Windows as simple as in Linux.

Contents

  1. Prerequisites
    • Docker with WSL2 backend
    • Docker with Hyper-V backend
  2. Install Docker using the GUI
  3. Install Docker using winget
  4. Install Docker using PowerShell
  • Author
  • Recent Posts

Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows servers, Active directory, PowerShell, web servers, networking, Linux, virtualization, and Kubernetes. He loves writing for his blog.

Prerequisites

You might already be aware that Docker relies on virtualization technology. On Windows, Docker can use either the Windows Subsystem for Linux (WSL) 2 or Hyper-V as a backend.

Docker with WSL2 backend

The current version of Docker Desktop only works on the 64-bit edition of Windows, whether you’re running Windows 10 or Windows 11. To run Docker with the WSL2 backend, your system must meet the following prerequisites:

  • Windows 10: Home/Pro 21H1 (build 19043) or higher, or Enterprise/Education 20H2 (build 19042) or higher
  • Windows 11: Home/Pro version 21H2 or higher, or Enterprise/Education version 21H2 or higher
  • WSL2 feature enabled
  • Linux kernel update package for WSL2
  • For WSL2, the following are the hardware requirements:
    • 64-bit CPU with second-level address translation (SLAT)
    • Hardware virtualization support, which must be enabled in BIOS/UEFI
    • 4 GB RAM

Docker with Hyper-V backend

To be able to run Docker with a Hyper-V backend and Windows containers, your system must meet the following prerequisites:

  • Windows 10: Pro 21H1 (build 19043) or higher, or Enterprise/Education 20H2 (build 19042) or higher
  • Windows 11: Pro/Enterprise/Education version 21H2 or higher
  • Optional Windows features for Hyper-V and Containers must be enabled

    Enable Hyper V and Containers windows features for Docker

    Enable Hyper V and Containers windows features for Docker

For Hyper-V, following are the hardware requirements:

  • 64-bit CPU with second-level address translation (SLAT)
  • Hardware virtualization support, which must be enabled in BIOS/UEFI
  • 4 GB RAM

In addition to the aforementioned requirements, if you want to run Docker in a Hyper-V guest VM, you need to enable nested virtualization by running this PowerShell command on the Hyper-V host:

Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $True

Enable nested virtualization for a VM on Hyper V host using PowerShell

Enable nested virtualization for a VM on Hyper V host using PowerShell

Make sure your VM is powered off before running this command. Without nested virtualization support, Docker will not work in a VM, and you will receive the error message shown below.

Docker desktop cannot start An unexpected error occurred

Docker desktop cannot start An unexpected error occurred

Install Docker using the GUI

To install Docker Desktop in Windows using the GUI, follow these steps:

Download Docker Desktop. You will see a configuration screen, as shown in the screenshot:

Docker desktop configuration Use WSL 2 instead of Hyper V recommended

Docker desktop configuration Use WSL 2 instead of Hyper V recommended

To use Docker with the WSL 2 backend, check the box that says Use WSL 2 instead of Hyper-V (recommended). If you want to use Hyper-V instead, uncheck this option and click OK.

When the installation is complete, click the Close and Restart button to restart your computer.

Close Docker installer and restart the computer to complete installation

Close Docker installer and restart the computer to complete installation

After restarting, you will be able to run Docker Desktop using either a shortcut or a command prompt. If you did not install WSL 2 before installing Docker, you will receive the WSL 2 installation is incomplete error when you try to start Docker.

Docker desktop error WSL 2 installation is incomplete

Docker desktop error WSL 2 installation is incomplete

To fix this error, run the wsl —update command in an elevated PowerShell console, and restart your computer.

Installing WSL2 kernel updates to fix the WSL 2 installation is incomplete error

Installing WSL2 kernel updates to fix the WSL 2 installation is incomplete error

Install Docker using winget

Winget is a command-line package manager for modern versions of Windows, which works just like apt or DNF in Linux. If you have a little experience with package installation in Linux, you probably know that you usually just have to type a command and the package is ready for use. Well, winget does the exact same thing in Windows. All you need is Windows 10 1809 (build 17763) or Windows 11. To install Docker in Windows using winget, follow these steps:

Launch an elevated command prompt or PowerShell console, and type the following command:

winget install --exact --id Docker.DockerDesktop --accept-source-agreements --accept-package-agreements

Installing docker desktop in windows using winget

Installing docker desktop in windows using winget

The —exact (or -e in short) parameter tells winget to find the package using an exact match. The installation can take a while, but it is pretty much automatic, so there is nothing you need to do but wait.

When the command is finished, open a new command prompt (or PowerShell console) and run the docker —version command.

If you try to run docker —version in the same command prompt, you will likely see The term ‘docker’ is not recognized as the name of a cmdlet, function, script file, or operable program error, as shown in the screenshot.

The term docker is not recognized as the name of a cmdlet function script file or operable program

The term docker is not recognized as the name of a cmdlet function script file or operable program

This error occurs because your current command session (cmd or PowerShell) is still using the old environment variables. To be able to recognize the newly added Docker variable, you must reload the environment variables. Launching a new command session is the easiest way to load new variables.

Install Docker using PowerShell

To install Docker Desktop using PowerShell, follow these steps:

Download Docker Desktop.

Once the installer package is downloaded, open an elevated PowerShell console or Windows Terminal, and type the following command to start Docker installation:

Start-Process "D:\Docker Desktop Installer.exe" -Wait -NoNewWindow "install --quiet --accept-license"

Installing Docker silently using PowerShell

Installing Docker silently using PowerShell

Make sure you adjust the installer path. The -Wait parameter causes the Start-Process cmdlet to wait for the new process to finish, and the -NoNewWindow parameter prevents the new process from opening in a new window. The —quiet switch is offered by Docker’s install command and suppresses the installation information. To see the information, skip this switch. Since we are using PowerShell, notice how —quiet and other flags are enclosed in quotes along with the install command—this is very important to avoid errors. By default, Docker will use the WSL 2 backend, but you could include the —backend=hyper-v flag to use the Hyper-V backend instead.

Once the above command is finished, you will see a shortcut for Docker Desktop on your desktop. Double-click the shortcut to launch Docker.

All of these installation methods are self-sufficient, so there is nothing additional you need to do. But you may still get an error message that says Docker Desktop – Access denied. You are not allowed to use Docker. You must be in the «docker-users» group.

Docker Desktop – Access denied. You are not allowed to use Docker. You must be in the docker users group

Docker Desktop – Access denied. You are not allowed to use Docker. You must be in the docker users group

If you get this error, run the following command in an elevated PowerShell console:

Add-LocalGroupMember -Group "docker-users" -Member $env:UserName -Verbose

Adding the current user to the docker users group using PowerShell

Adding the current user to the docker users group using PowerShell

Don’t forget to log off and log on again after running this command. If you want to delegate another user to run Docker Desktop, you can specify that username with the -Member parameter instead of $env:UserName.

Subscribe to 4sysops newsletter!

That was all for this guide. You just learned how to install Docker in Windows using the GUI, winget, and PowerShell. I am curious to know which method you prefer, and why.

It means that you are on Windows.

  • Search and open ‘Computer management‘:

  • Go to ‘Local users and groups‘:

  • In ‘Groups’, double-click ‘docker-users’:

  • If you are not in ‘docker-users’, go to ‘Users‘ on the left filter and add you in the ‘docker-users’ group by clicking on you and ‘Add…’:

  • Docker on ubuntu on windows
  • Docker desktop for windows requirements
  • Docker mount folder to container windows
  • Docker desktop for windows home
  • Docker install windows server 2016