Docker Community Forums

Share and learn in the Docker community.

Creation of docker group in Mac OS

sudo gpasswd -a ${USER} docker is not working in the Mac machine. Could anyone please tell me what is the equivalent command of the aforementioned Linux command?

My first MacOS is really new but after a quick search I would rather ask this: Is it possible to set a group password on MacOS?

Why do you need it?

Unfortunately, Apple did not see any use to include gpasswd or alternatives for command line use. You can add it or one of the equivalents like the group commands using homebrew or MacPorts.

Alternatively, there is a way to create a new group using via Apple’s GUI.
The procedure is:

  1. Open System Preferences → Users & Groups
  2. Authenticate as an administrator
  3. Click Login Options
  4. For Network Account Server click Join (doesn’t matter if you don’t have one)
  5. In the dialog that pops up, click Open Directory Utility
  6. In Directory Utility, authenticate
  7. Click Directory Editor
  8. Change the Viewing popup from Users to Groups
  9. Click the + in the lower left hand corner to add a new group
    The rest is pretty much obvious as a group just has a name and group number.

It’s usually a good idea to assign a high group number to your new group to prevent it from having default privileges.

1 Like