GitLab is an open-source application primarily used to host Git repositories, with additional development-related features like issue tracking. It is designed to be hosted using your own infrastructure and provides flexibility in deploying as an internal repository store for your development team, a public way to interface with users, or a means for contributors to host their own projects.
The GitLab project enables you to create a GitLab instance on your own hardware with a minimal installation mechanism. In this guide, you will learn how to install and configure GitLab Enterprise Edition on a Red hat Enterprise server.
GitLab Installation Procedure
Step 1: Update system and Install Dependencies
# sudo yum -y update
# sudo yum -y install curl vim policycoreutils python3-policycoreutils
If you want to install and use local mail server for sending notifications, then install Postfix:
# sudo yum -y install postfix
Start and enable Postfix service after the installation.
# sudo systemctl enable postfix && sudo systemctl start postfix
Step 2: Add the Gitlab EE Repository
GitLab provides omnibus packages from a repository. These packages are compiled specifically for RHEL. A script is provided for this purpose.
# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
Alternatively, you can download the GitLab-EE RPM file, transfer it to the server, and issue the installation command.
Step 3: Install GitLab EE on RHEL 8
Install GitLab CE by running the command:
# sudo yum install gitlab-ee
Step 4: Configure GitLab EE on RHEL 8
Our installation is done, we can then do the GitLab configuration that works for our environment. The main configuration file for GitLab is located under /etc/gitlab/gitlab.rb.
# sudo vi /etc/gitlab/gitlab.rb
e.g, Set URL on which GitLab will be reachable:
external_url ‘http://gitlab.example.com’
Don’t forget to replace gitlab.example.com with your actual domain or sub-domain for GitLab EE.
Scroll through the configuration file and make changes accordingly. Once done, save the file and run Gitlab reconfiguration script.
# sudo gitlab-ctl reconfigure
This will start a Chef local execution to configure GitLab. A successful reconfiguration shows an output like below.
Step 5: Access GitLab Web Console
Open your browser and go to URL http://gitlab.example.com to finish the installation of Gitlab.
You’re asked to create a new password for your account. Set a new password for root user then click “Change your password“.
You can then login with the root username and password set above. You should be redirected to the GitLab administration dashboard after logging in.