In this tutorial, we will explain How to install GitLab on CentOS.

GitLab is a web-based DevOps lifecycle tool that provides a Git-repository manager providing a wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc. It follows an open-core development model where the core functionality is released under an open source (MIT) license while the additional functionality is under a proprietary license.

Prerequisites

You will need:

  • VPS running CentOS
  • Recommend at least 4GB of free memory

Step 1 – Prepare

To install GitLab you will need to Install and configure the necessary dependencies.

sudo yum install -y curl policycoreutils-python openssh-server

Now enable and start sshd:

sudo systemctl enable sshd
sudo systemctl start sshd

After, add HTTP service to the firewall and reload:

sudo firewall-cmd –permanent –add-service=http
sudo systemctl reload firewalld

If the firewall doesn’t exist in your system install and start by running commands:

sudo yum install firewalld

systemctl start firewalld

Next, install Postfix to send notification emails.

sudo yum install postfix

Enable and start it:

sudo systemctl enable postfix
sudo systemctl start postfix

Step 2 – Install GitLab

Now its time to install GitLab. So, add the Gitlab package repository to your system:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

And now install it. Change the EXTERNAL_URL to your server domain or IP Address.

sudo EXTERNAL_URL=”http://gitlab.example.com” yum install -y gitlab-ee

Step 3 – Login

To access Gitlab, open your browser and go to http://yourdomain.com.

Set your GitLab password. And click on Change your password button.

Now sign in GitLab by using default username root and the password you’ve sett.

You have successfully installed GitLab on CentOS.

Enjoy it.