- Create users on sign-in page
- Create users in Admin area
- Create users through authentication integrations
- Create users through the Rails console
Create users
You can direct users to create their own account, create an accounts yourself, or configure authentication integrations.
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. For information, see Disable new sign ups.
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 forced to set their password on first sign in.
To set a user’s password without relying on the email confirmation, after you create a user following the previous steps:
- 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 asked to change the password you set up for them.
Create users through authentication integrations
Users are:
- Automatically created upon first sign in with the LDAP integration.
- Created when first signing in using an OmniAuth provider if
the
allow_single_sign_on
setting is present. - Created when first signing with Group SAML.
- Automatically created by SCIM when the user is created in the identity provider.
Create users through the Rails console
If you want to automate user creation, you should use the users API endpoint instead. This is because GitLab source code is subject to change at any time.
To create a user through the Rails console:
- Start a Rails console session.
-
The command you run to create a user differs depending on your version of GitLab.
For GitLab 16.10 and earlier, run:
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!
For GitLab 16.11 and later, run:
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!