Create users
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
You can create user accounts in GitLab in different ways:
- Direct users to create their own account.
- Create accounts for other users manually.
- Configure authentication integrations.
- Create users through the Rails console.
If you want to automate user creation, you should use the users API endpoint.
Create users on sign-in page
By default, any user visiting your GitLab instance can register for an account. If you have previously disabled this setting, you must turn it back on.
Users can create their own accounts by either:
- Selecting the Register now link on the sign-in page.
- Navigating to your GitLab instance’s sign-up link (for example:
https://gitlab.example.com/users/sign_up
).
Create users in Admin area
Prerequisites:
- You must have administrator access to the instance.
To create a user manually:
- On the left sidebar, at the bottom, select Admin.
- Select Overview > Users.
- Select New user.
- Complete the required fields, such as name, username, and email.
- Select Create user.
A reset link is sent to the user’s email, and they are required to set their password when they first sign in.
Set user password
To set a user’s password without relying on the email confirmation, after you create a user:
- Select the user.
- Select Edit.
- Complete the password and password confirmation fields.
- Select Save changes.
The user can now sign in with the new username and password, and they are required to change the password you set up for them.
Create users through authentication integrations
GitLab can automatically create user accounts through authentication integrations. Users are created when they:
- Sign in for the first time with:
- LDAP
- Group SAML
- An OmniAuth provider that has the setting
allow_single_sign_on
turned on
- Are provisioned through SCIM in the identity provider.
Create users through the Rails console
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
To create a user through the Rails console:
- Start a Rails console session.
- Run the command according to your GitLab version:
u = User.new(username: 'test_user', email: 'test@example.com', name: 'Test User', password: 'password', password_confirmation: 'password')
# u.assign_personal_namespace
u.skip_confirmation! # Use only if you want the user to be automatically confirmed. If you do not use this, the user receives a confirmation email.
u.save!
u = User.new(username: 'test_user', email: 'test@example.com', name: 'Test User', password: 'password', password_confirmation: 'password')
u.assign_personal_namespace(Organizations::Organization.default_organization)
u.skip_confirmation! # Use only if you want the user to be automatically confirmed. If you do not use this, the user receives a confirmation email.
u.save!
u = Users::CreateService.new(nil,
username: 'test_user',
email: 'test@example.com',
name: 'Test User',
password: '123password',
password_confirmation: '123password',
organization_id: Organizations::Organization.first.id,
skip_confirmation: true
).execute
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support