What is GitLab
GitLab is a web-based DevOps tool that is a Git repository manager that provides wiki, issue tracking, continuous integration, and deployment pipeline features using an open source license developed by GitLab Inc.
Preparing the server for installation
First, let’s see if there are any updates for our OS, run the command below
apt update && apt upgrade -y
Install Gitlab package dependencies using the command
apt-get install -y curl openssh-server ca-certificates
Add the GitLab repository to the server using the command
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
How to Install GitLab
Now that everything is prepared on the server for installing GitLab, you can continue with the installation
To install GitLab itself, you need to run one command, as shown below:
apt install gitlab-ce -y
We look in the terminal and wait for the installation to complete.

After installation we will see the following result in the terminal
Thank you for installing GitLab! GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting `external_url` configuration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md Help us improve the installation experience, let us know how we did with a 1 minute survey: https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=17-11 Processing triggers for libc-bin (2.39-0ubuntu8.4) ... root@firstbyte:~#
Setting up GitLab on a domain and install SSL
Now we need to specify the URL for our GitLab, this means that we need to specify the IP address of the server in the domain or subdomain, and then change the config file to specify the domain/subdomain and install SSL.
To change the configuration file, we execute the command below
nano /etc/gitlab/gitlab.rb
Edit these lines below to point to your domain name and SSL certificate from Let’s Encrypt
external_url 'https://your.domain' letsencrypt['enable'] = true letsencrypt['contact_emails'] = ['[email protected]'] letsencrypt['auto_renew'] = true letsencrypt['auto_renew_hour'] = 3 letsencrypt['auto_renew_day_of_month'] = "*/7"

Let’s Encrypt settings should look exactly like this

You need to save the file using the CTRL+X command, press Y and then Enter.Now you need to confirm the configuration changes using the command
gitlab-ctl reconfigure
After some time, when everything is ready and when the process itself is completed, you can go to the domain/subdomain.To enter GitLab itself, we need to find out the temporary password, and this can be done by running the command
cat /etc/gitlab/initial_root_password

Here you can see the password and a message that this file will be deleted immediately after 24 hours when the reconfiguration is done.We go to our GitLab page, enter the root login and password and log into the account.

Here we can see that SSL is installed correctly and that it works.
After logging in we will see our account and it should look like the screenshot

As it is necessary and desirable to change the password immediately, click on the icon of our user, then on Edit Profile

After this, our user settings will open and we must click on Password to change the current password.

After clicking on the Password button, a page will open where you need to specify the current password, the new password twice and click on the Save password button

Immediately after the password has changed, you need to log in to GitLab again as the system deletes the user’s session.

At the top it says that the password has been successfully changed, please log in again. Now you can log back into GitLab and start working, creating new projects or importing existing ones. Thank you for reading the GitLab installation guide to the end! If you have any questions, please contact us at any time and we will try to help you with pleasure!