How to Install GitLab on Rocky Linux 8

Install GitLab on Rocky Linux 8

In this article, we will have explained the necessary steps to install GitLab on Rocky Linux 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Gitlab is the source code management application tool. It is the best alternative to Github. It provides an option to users of the self-hosted version as well. GitLab provides various scratch features like Auto DevOps, Kubernetes integration, GitLab Container Registry, etc. GitLab has two versions, Community Edition(CE) and Enterprise Edition(EE). We will use the CE version. The GitLab CE is the open-source version that you can use on your own server that’s free to download and use.

Install GitLab on Rocky Linux 8

Step 1. First, before you start installing any package on your Rocky Linux server, we always recommend making sure that all system packages are updated.

sudo dnf update
sudo dnf upgrade

Step 2. Install required dependencies for Gitlab.

Run the following command below to install the required dependencies:

sudo dnf install curl openssh-server policycoreutils perl
sudo systemctl enable --now sshd
sudo dnf install postfix
sudo systemctl enable --now postfix
sudo dnf install chrony
sudo systemctl enable chronyd

Step 3. Install GitLab on Rocky Linux system.

Add the  package repository:

sudo tee /etc/yum.repos.d/gitlab_gitlab-ce.repo<<EOL
[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
EOL

After that, set the repository as enabled using the following command:

sudo dnf repolist enabled
sudo dnf config-manager --set-enabled gitlab_gitlab-ce

Finally, install GitLab on your system using the following command:

sudo EXTERNAL_URL="http://gitlab.linuxtips.us" dnf install -y gitlab-ce

Install GitLab on Rocky Linux 8

Step 4. Configure Firewall.

Use the below commands to allow ports in firewalld:

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

Step 5. Accessing the GitLab Web Interface.

Once complete setup, now that you have configured the GitLab URL you can start with the initial configuration through the GitLab web interface. Launch your web browser and navigate to:

http://gitlab.linuxtips.us

Install GitLab on Rocky Linux 8

After you configured the password for the Gitlab root account, navigate to the login screen. Now log in with the user “root” and the specified password.

That’s all you need to do to install GitLab on Rocky Linux 8. I hope you find this quick tip helpful. For further reading on GitLab, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.