How to install Docker on Windows 11 with non-administrator access

How to Allow docker to run without administrator privileges and How to install Docker on Windows 11 and setup non-administrator access

How to install Docker on Windows 11 with non-administrator access
Photo by Ashkan Forouzani / Unsplash

NOTICE

You MUST have administrator to install Docker initially... After installing you can then allow users to access docker without administrator

Step 1 | Setup WSL2 backend

  1. Open PowerShell as Administrator and run
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart  
    
    This will enable WSL for Windows 11
  2. In the same terminal write
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all  
    
    This will enable the Virtual Machine Platform (a prerequisite for WSL2)
  3. Restart your computer
  4. Install the WSL2 Kernel update package from here
  5. Open PowerShell as Administrator and run
    wsl --set-default-version 2  
    

Step 2 | Install Docker Desktop

  1. Download and install Docker Desktop from here
    (Click the big blue button that says Docker Desktop for Windows)
  2. Open the installer and follow the instructions
  3. When prompted verify that Use WSL 2 instead of Hyper-V is selected
    (If you don't see the option it's either because your system doesn't support hyper-v
    or because you messed up step 1)
  4. Follow the instructions on the wizard and wait for Docker Desktop to finish installing
  5. After the installation is complete. Restart your computer
  6. Open Docker Desktop and verify that it's running

Step 2.5 | (Optional) Allow docker to run without administrator privileges

let's say you need Docker Desktop, but you do not have administrator privileges on your computer. You can still use Docker Desktop by following these steps:

  1. Get your system administrator to follow Step 1 and Step 2
  2. Open a terminal as an administrator and run
    docker run hello-world  
    
    If all is well, you should see a hello-world message.
  3. Open Computer Management as an administrator (type compmgmt.msc in the start menu and hit CTRL+SHIFT+ENTER)
  4. Navigate to Local Users and Groups > Groups > docker-users and add your user to the group.
  5. Restart your computer and open Docker Desktop. It should now work without administrator privileges.