OCC Command for adding user to a group

I am searching the OCC Command for adding a user to a group. Can antone help me with that?


Hello icodes,

the command should be:

sudo -u www-data php occ group:adduser groupname username

More details can be found here:



Oh thanks!!!
You helped me so much.
I am running a Docker Nextcloud instance in Unraid. My Cloud instance is connected to my SSO Auth0. My normal user account is no admin. But my account on Nextcloud self is admin. But for some reason it will stay loading when i entered my credentials in Nextcloud. Now that is no problem since i am now administrator on my SSO account.