Have you forgotten your GitLab password? What about your GitLab root user password? Not to worry, I'm going to show you exactly how to do a GitLab reset password operation.

And as this is from the command line, you won't need to have email set up, or remember the email address you registered with.

GitLab Default Password

First up, if you were naughty and didn't change your GitLab default password then try these:

  • Username: root
  • Password: 5iveL!fe

If that works, make changing the root password your immediate next task.

GitLab Password Reset

If you have email set up on your GitLab server, the password reset link should see you right.

If you haven't got email set up, or you forgot your root password, then these steps should get you back in:

Start by connecting to your GitLab server via ssh.

Then:

sudo gitlab-rails console production
u = User.where(id:1).first
u.password = 'your_new_password'
u.password_confirmation = 'your_new_password'
u.save!

You must update both the password and password_confirmation fields.

Probably the most important part is getting that exclamation mark in at the end, or this won't work.

After that, you should be good to log back in.

None Root User GitLab Password Reset

If you know your email address, you can instead change the procedure to:

sudo gitlab-rails console production
u = User.find_by(email: 'you@your.email')
u.password = 'your_new_password'
u.password_confirmation = 'your_new_password'
u.save!

And you should be good to go.


Share This Episode

If you have found this video helpful, please consider sharing. I really appreciate it.


Episodes in this series

# Title Duration
1 Zero To GitLab in 5 Minutes 05:02
2 Continuously Integrate All The Things 05:10
3 GitLab CI Runner Tutorial 03:04
4 GitLab Reset Password 01:42
5 Updating GitLab and GitLab CI 04:52
6 GitLab Backup 15:55
7 GitLab CI Backup 04:20
8 PHP Continuous Integration with GitLab CI 08:08
9 How To Use VirtualBox as a GitLab CI Test Runner 06:02
10 Running Selenium with Docker During VirtualBox Test Runs 09:02