Set up a functional GitLab


Official Documentation

Recommendation: Install directly using the system's built-in package management tools, such as yum, dnf, apt, etc., instead of using containers or other methods.
Reason: Using containers will make GitLab management more complex. Deploying directly on the machine allows for disk expansion if space is insufficient and instance type changes if resources are insufficient.

Complex factors:

  1. Docker management
  2. Docker-compose configuration
  3. Disk mounting
  4. Port mapping (conflict between port 22 on the host machine and port 22 in the GitLab container)
  5. Domain configuration


Domain and SSL Configuration#

Official Documentation

Make changes to gitlab.rb according to the documentation.

external_url ''
// The # at the beginning of the following lines has been manually removed
letsencrypt['enable'] = false 
nginx['enable'] = true
nginx['redirect_http_to_https'] = true

These two items do not need to be modified. Just rename the SSL files to and and place them in /etc/gitlab/ssl. They will be automatically recognized.

Applying for SSL#

Several methods:

  1. If the domain is hosted by a cloud provider, you can apply directly.
  2. Use free SSL certificate services, such as letsencrypt

My approach:

  1. Register and verify with
  2. Add the domain
  3. Perform DNS verification
  4. Apply for the certificate using

Acme Certificate Automation


After completing the configuration, manually execute the following:

gitlab-ctl reconfigure // Reconfigure
gitlab-ctl start       // Start


cat /etc/gitlab/initial_root_password

User recommendation: After logging in as an administrator, configure a user with administrator privileges. Avoid using the root user.

Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.