Version control/source control can be defined as tracking and managing the changes in software code. Version control systems, therefore, help one to track and manage these changes over time. This really helps in development as it allows the DevOps team to work smarter and faster, reducing the development time and increasing productivity. The most popular Version Control Software (VCS) are TFS, Mercurial, ClearCase, SVN, Git, Helix Core (Perforce) e.t.c

Git was first released in 2005 with the intention to help teams use the branches and merge to build a project. The Git version control feature allows multiple developers to work on the same project independently. It enables individuals to add changes separately while keeping track and logs. Git is so distinct from other version control systems in that, it doesn’t rely on a centrally stored database, but instead, uses a distributed system.

GitLab is an open-source web-based tool that provides a distributed version control platform. This tool supports software development using the Continuous Delivery(CD) and Continuous Integration(CI) processes and is therefore preferred by developers and companies to host Git repositories.

The features associated with GitLab are:

  • Easy integration with Jenkins, Docker, Slack, Kubernetes, JIRA, LDAP e.t.c
  • Integration with IDEs like Eclipse, Visual Studio, Koding, and IntelliJ
  • On-premise or cloud-based installations
  • Performance monitoring
  • Repository mirroring and high availability (HA)
  • Hosting static websites (GitLab Pages)
  • Development Analytics
  • Service Desk (ticketing system)
  • ChatOp tool (Mattermost)
  • Code Quality (Code Climate)
  • Code Review functionality and Review Apps tool
  • Issue management, bug tracking, and boards

GitLab offers two main editions:

  • GitLab Community Edition (CE): this is a free edition
  • GitLab Enterprise Edition (EE): requires a License to use. It builds on top of Git with advanced features that include LDAP group sync, multiple roles, and audit logs. It also provides authorization integration with deeper authentication.

This guide offers a detailed illustration of how to install and configure GitLab on Rocky Linux 9 / AlmaLinux 9

Setup Requirements

For this guide, you will require:

  • 1GB or more of available RAM on the host
  • A fully Qualified Domain name(For SSL certificates)
  • User with sudo privileges

#1: Install Required Packages

We will begin by updating the available packages to their latest available versions:

sudo dnf -y update

Install the required package dependencies;

sudo dnf -y install curl vim policycoreutils python3-policycoreutils git

#2: Add the GitLab CE Repository on Rocky Linux 9 / AlmaLinux 9

GitLab is not provided on the default Rocky Linux 9 / AlmaLinux 9 repositories. To be able to install it, we need to add the official repository to our system.

To add the GitLab CE Repository on Rocky Linux 9 / AlmaLinux 9 use the command:

sudo vim /etc/yum.repos.d/gitlab_gitlab-ce.repo

Add the below lines to the file:

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ce-source]
name=gitlab_gitlab-ce-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Verify if the repository has been added: