How to prevent group creation in GitLab

For an Omnibus install, the correct place is:

   /etc/gitlab/gitlab.rb
      gitlab_rails['gitlab_default_can_create_group'] = false

Then you'll need to execute sudo gitlab-ctl reconfigure and sudo gitlab-ctl restart to apply the changes.


  1. Enter the Admin control panel
  2. Select 'Users'
  3. Select the user(s) in question and click 'Edit'
  4. Scroll down to 'Access' and un-tick 'Can Create Group'

If you want to disable group creation for new users, at the moment you will have to edit the gitlab.yml, specifically the setting default_can_create_group, and set it to false.

See gitlab.yml#L63@712d1768.


And for old users, use something like (in rails console):

irb(main):012:0> @users.each do |u|
irb(main):013:1*  u.can_create_group= false
irb(main):014:1> u.save
irb(main):015:1> end

Tags:

Gitlab