Can I run Docker Desktop on Windows without admin privileges?

54,850

Solution 1

I have not tested it, but this article seems to indicate that you can.

TLDR;

Problem

The reason for requiring an admin session is that the Docker client in the default configuration uses a named pipe to connect to the Docker engine and that named pipe can only be accessed by administrators

Solution

To avoid this, you can simple allow your user FullControl access to that named pipe

Original author also provides a powershell tool with sources to help perform this admin task.

Solution 2

As of Docker Desktop 2.4 (possibly earlier, I haven't tested) this is supported. From the Windows installation instructions:

If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.

Solution 3

The answer appears to be "no". I couldn't understand how everyone else at work had avoided this problem; but then learnt that they had asked for admin rights over their local machines and been granted them! I've only been here for two and a half years ... :|

Solution 4

I am able to run Docker Desktop from a non-administrator account on my Windows 10 machine. I can also issue docker commands from a non-elevated command prompt or PowerShell prompt. Note that my non-administrator account is a member of the local group docker-users.

Initially, I installed it from my administrator account, and things worked as expected, but only if I stayed logged in as administrator. If I wasn't logged in as administrator, I would get the named pipe error that aboellinger described in his answer.

Simply launching C:\Program Files\Docker\Docker\Docker Desktop.exe from my non-administrator account fixed the issue (after waiting a few seconds for the process to start). It didn't even ask to elevate permissions.

Solution 5

Latest version of Docker desktop allows this, but the user should be in docker-users group.

If you are using Windows 10 Home edition, then adding multiple groups to a normal users will be a pain, even you use 'netplwiz'.

To add a new group to user you can use the below command in Powershell.

Run the powershell as admin, then execute

net localgroup "docker-users" "<user_name>" /add

Share:
54,850

Related videos on Youtube

Ed Graham
Author by

Ed Graham

I have been self-employed since 2006, working as an independent developer of .NET web applications using C# and SQL Server technologies. I have concentrated primarily on server-side development but also have experience of client-side coding (JavaScript) and design (CSS) and have been involved in client meetings and giving presentations to users. I am looking for a part-time or temporary full-time contract development role using .NET technologies in or around Cambridge or London, either office-based or working remotely.

Updated on July 09, 2022

Comments

  • Ed Graham
    Ed Graham almost 2 years

    I know I need admin rights to install Docker Desktop; but do I have to be an admin to run it? The documentation doesn't say that I do, and Googling doesn't suggest that either; but if I try to run it as a non-privileged user, the process is killed instantly and I get an event-log entry saying "Process requires elevated rights to run."

    I'm running Windows 10 Enterprise in a corporate environment and we have non-privileged accounts. Is Docker Desktop not available in this situation or have I just installed it incorrectly somehow?

  • Ed Graham
    Ed Graham over 4 years
    Excellent - thank you! I have now become fully used to Admin rights over my machine, so am unlikely to try this: but if it does work it's clearly a better solution.
  • Kuba Šimonovský
    Kuba Šimonovský about 4 years
    Nope. You can't run Docker desktop.exe without admin privileges. At least I can't. And what I see on the internet, you shouldn't be able to run it by default
  • JamesQMurphy
    JamesQMurphy about 4 years
    @KubaŠimonovský What version are you on, and what error do you get when you run it? I also noticed that my user account, which is definitely not an admin account, is part of the docker-users account. I’ll remove my account from there and see what happens.
  • JamesQMurphy
    JamesQMurphy about 4 years
    @KubaŠimonovský When I removed my account from the docker-users group, I was unable to launch Docker desktop.exe, but the error was very specific: Docker Desktop - Access Denied You are not allowed to use Docker. You must be in the "docker-users" group. So I'm guessing that you have a different issue.
  • Kuba Šimonovský
    Kuba Šimonovský about 4 years
    ahh.. Unfortunately, I can't manipulate with groups and users because of company restrictions. So I can't try it... I have been using docker for a long time and I get used to it running it as admin
  • rbaleksandar
    rbaleksandar about 4 years
    The problem with admin rights is (beside the security issues of course) that every single application that you are using to work with a Docker container/image also needs to be with those rights. For example I had to start Visual Studio Code as admin and install all the stuff I needed (and had already installed but for a normal user) so that I can use it in any sane way with Docker.
  • Ed Graham
    Ed Graham about 4 years
    Interesting. My error (an event-log entry saying "Process requires elevated rights to run") was different to James's; I didn't get any indication at all about the docker-users group. Maybe they've added that error message to a newer version?
  • Peter Pesch
    Peter Pesch almost 4 years
    Thanks! It worked! (I basically used the (sourcecode of the) tool to give the docker-users group sufficient access to that named pipe)
  • Ed Graham
    Ed Graham over 3 years
    Thanks - that sounds like an even neater solution.
  • sjcaged
    sjcaged over 3 years
    Once you install it, you need to log out and log back in for your membership in the new .\docker-users group to be added to your login token.
  • Ed Graham
    Ed Graham over 3 years
    Thanks Doug - that's a useful tip.
  • Andrea Mattioli
    Andrea Mattioli about 3 years
    Right. You can enable Local User And Group Management in Windows 10 Home using lusrmgr.exe as I red here
  • zielot
    zielot about 2 years
    Note the last instruction from @Simon Brady: "Log out and log back in for the changes to take effect". I did and this worked as advertised.
  • Juan Vilar
    Juan Vilar about 2 years
    this worked properly.
  • TC Tarım Köy İşleri
    TC Tarım Köy İşleri almost 2 years
    You saved my career xd