Install Gitlab CE on CentOS 7 / Fedora 30/29/28

(: May 6, 2019)

In this guide, we will cover the installation of Gitlab on CentOS 7 / Fedora 30/29/28. Gitlab is Git-based fully featured platform for accelerated software development. It provides up to scratch features like integrated CI/CD, Auto DevOps, Kubernetes integration, GitLab Container Registry e.t.c.

Since this installation is for Gitlab Community Edition, more features can be unlocked by moving to subscription. check the GitLab subscriptions for details.

Install Gitlab on CentOS 7 / Fedora 30/29/28

The start of the actual installation of Gitlab on CentOS 7 / Fedora 30/29/28 is this section. Gitlab installation requires your server to have a minimum of 4GB ram and 2 CPU cores.{text-align:left} img{margin:0 auto 0 0}

If you do an installation on a system with lower hardware specifications, you may experience tortoise-like performance.

Step 1: Install necessary dependencies

Install Dependencies on CentOS 7

sudo yum -y update
sudo yum -y install epel-release curl vim policycoreutils-python

For Fedora:

sudo dnf -y install curl vim policycoreutils-python

If you want to install and use local Postfix server for sending notifications, then install Postfix:

# CentOS 7
sudo yum install postfix

# Fedora
sudo dnf install postfix

Start and enable Postfix service after the installation.

sudo systemctl enable postfix
sudo systemctl start postfix

For configuration of external email relay service after setting up Gitlab, check configure an external SMTP server .

Step 2: Add the Gitlab CE Repository

GitLab provides omnibus packages from a repository. These packages are compiled specifically for CentOS but can be installed on a Fedora system.

Create a new repository file for Gitlab:

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

Then add the following lines:


Save the file and update your RPM packages index.

sudo yum makecache

Step 3: Install Gitlab CE on CentOS 7 / Fedora 30/29/28

Install Gitlab CE by running the command:

sudo EXTERNAL_URL="" yum install -y gitlab-ce

Replace EXTERNAL_URL with your domain name for Gitlab.

Step 4: Configure Gitlab CE on CentOS 7 / Fedora

You need to set URL on which GitLab will be reachable from outside. This is done by editing Gitlab configuration file /etc/gitlab/gitlab.rb

sudo vim /etc/gitlab/gitlab.rb

URL can be set on:

external_url ''

There are many other GitLab CE Configuration Settings that you can set to fit your preference. Once done, save the file and run Gitlab reconfiguration script.

sudo gitlab-ctl reconfigure

This will start a Chef local execution to configure Gitlab. When it finishes, you should get a success message.

Running handlers:
Running handlers complete
Chef Client finished, 438/620 resources updated in 04 minutes 44 seconds
gitlab Reconfigured!

If you have an active firewall, allow http, https and ssh services.

sudo firewall-cmd --permanent --add-service={ssh,http,https} --permanent
sudo firewall-cmd --reload

Open your browser and go to URL 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“.

Login with the username root and password set above

You should be directed to the Gitlab administration dashboard. You can update your user profiles and add other Gitlab users & groups.

Step 5: Disable User Sign Up ( Recommended)

By default, GitLab allows new users to sign up, this is not usually the case as users are created manually by SysAdmin or user information pulled from external authentication systems such as LDAP.

You can disable this setting to have a secure access management. See:

How to disable GitLab User registration on Login page

Step 6: Secure GitLab with SSL Certificate (Recommended)

SSL is the de facto protocol for securely accessing services in the internet. You can make use of free SSL certificates such as Let’s Encrypt to secure your GitLab server. Refer to our previous guide below.

How to Secure GitLab server with SSL certificate

Step 7: Enable LDAP Authentication (Optional)

For those who use LDAP as a primary method of authentication, GitLab can be configured to use an LDAP server such as FreeIPA to authenticate users.

Configure GitLab FreeIPA LDAP Authentication

Visit GitLab Documentation page for more learning on GitLab administration.

Related articles:

How to Install the latest version of Git ( Git 2.x ) on CentOS 7

How to Install Gitea self-hosted Git service on CentOS 7 with Nginx Reverse Proxy

How to Install Gitea self-hosted Git service on Ubuntu

How to Install Gogs self-hosted Git service on Ubuntu{text-align:left} img{margin:0 auto 0 0}

Related Posts