I have recently installed an instance of GitLab CE using Docker. The application sits behind an Nginx proxy and I can access the login page without problems.
Unfortunately, I also cannot log into GitLab.
Apparently, some of the startup documentation for GitLab is out of date. Instead of a setup page that allows you to set the admin username and password (as some documentation describes), there is a login page that has a link to a registration page. The registration page does not accept registrations without an administrator’s approval, and there is no administrator to approve it.
Looking at the GitLab documentation, there are several references to a “default administrator” login and password. Unfortunately, those defaults are not provided.
Searches on the Internet have yielded several possible default admins, none of which work. The most common defaults named in several places are “root” (username) and “5iveL!fe” (password). This does not work, either.
I am hoping that someone can tell me how I can get into my GitLab application, because right now the system is completely unusable.
Can anyone help with this?
Hi @RobertBrown3, welcome to the GitLab Community Forum!
Since 14.0, GitLab Omnibus automatically generates a password for the initial administrator user account (root
) and stores it to /etc/gitlab/initial_root_password
( $GITLAB_HOME/config/initial_root_password
in terms of Docker volumes) for at least 24 hours.[1] For security reasons, after 24 hours, this file is automatically removed by the first gitlab-ctl reconfigure
.
If you don’t have the initial root password, you can reset it [2] by doing the following:
docker exec -it gitlab gitlab-rake "gitlab:password:reset[root]"
This command will guide you through resetting the root user password. It will take some time to load, as it starts up a rails console.
Fun fact: the “5iveL!fe” password you discovered is only default for GitLab Development Kit, which is a way for people to run GitLab on their local machine for development purposes.
1 Like
Thanks for the info.
I deleted the containers, the volumes, and the GitLab image in order to put in a pristine installation. I then spun up a new container using docker-compose.
There are two small problems I encountered:
-
After waiting long enough to be able to access the login page, I chevked for the initial_root_password file. It was not in the $GITLAB_HOME/config directory where it should be. I am seeing a number of key files and a json file. No initial_root_password file.
-
I then performed the exec coand you suggested. I got the following:
[factor3@Mymachine ~]$ docker exec -it gitlab_web_1 gitlab-rake "gitlab:password:reset[root]"
Unable to find user with username root.
There is something different about what I am running. Please note that the image I am using is: gitlab/gitlab-ce:latest so I presume that I am getting V14.0 or above…
Please advise. What is different about my installation that is causing these divergent behaviors?
1 Like
Hi Robert,
I have the same issue, it can’t find user with username root.
How did you solve it?
Thanks
It turns out I never really resolved it.
I did end up wiping out the installation, grabbing the latest Git Docker container, and changed the operating system from Almalinux to Ubuntu (I have been finding lately that the newest versions of Red Hat- derived Linux distributions apparently have difficulty running Docker properly).
Once I installed the latest Gitlab container, I ran the following command:
docker exec -it mygitlab grep 'Password:' /etc/gitlab/initial_root_password
This enabled me to set the root password. I had no problems with Gitlab root passwords since.