Celeb Glow
updates | March 09, 2026

usermod equivalent for Alpine Linux

I'm building a Docker container, and I need to add my user to a group. usermod is not available in Alpine Linux by default. Apparently, you can add shadow from apk to install usermod, but I would prefer to not install additional packages.

Is there an alternative way to add a user to a group, or an equivalent tool to usermod available in Alpine?

4

1 Answer

You should be able to use the built-in addgroup command to add the user to a given group:

$ addgroup --help
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.
Usage: addgroup [-g GID] [-S] [USER] GROUP
Add a group or add a user to a group -g GID Group id -S Create a system group

So running addgroup ${USER} ${GROUP} should update /etc/groups without needing to edit the file directly.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy