How To Install and Configure GitLab CE on CentOS 73 min read

Devops Engineer
Sorry! The Author has not filled his profile.
follow me

In this article,we will look ho to install and configure for Gitlab CE.GitLab is a web-based open source Git repository manager.It enables developers to build, deploy and run their applications. GitLab provides several features, including wikis, issue tracking, code reviews, and activity feeds.

GitLab have 4 products:

Gitlab CE (Community Edition) – self-hosted and free
Gitlab EE (Enterprise Edition) – self-hosted and paid – SaaS and free. – Private GitLab instance managed by GitLab Inc.

Step-by-step installation of GitLab CE (Community Edition) on CentOS 7 Server.

Install the required packages and dependencies

We will be using curl to download the repository installer, policycoreutils for SELinux manager, OpenSSH, and postfix as local SMTP server.

sudo yum install curl policycoreutils-python openssh-server openssh-clients postfix

start the ssh and postfix services and enable it

systemctl start sshd
systemctl start postfix

systemctl enable sshd
systemctl enable postfix
Install Gitlab

Download the package with curl and run the script to add Gitlab CE repository.

curl -sS | sudo bash


Now install Gitlab through below command.

yum -y install gitlab-ce

When the installation complete, you will get the result as shown below.

Thank you for installing GitLab!

With this, GitLab CE is now installed on the CentOS 7 server.

Now configure Gitlab URL

Configuration file of Gitlab in /etc/gitlab/gitlab.rb

vim /etc/gitlab/gitlab.rb

Change the external_url line with the domain name ''

external_url ''

Now save the changes.
Enbale Nginx and HTTPS

Hope you have your SSL certificate files already generated.Now we will enable HTTPS and enable HTTP to the HTTPS connection.

vim /etc/gitlab/gitlab.rb

Change HTTP to HTTPS on external_url line

exsternal_url ''

Now add the following lines

nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/techrunnr/ssl/techrunnr.crt"
nginx['ssl_certificate_key'] = "/etc/techrunnr/ssl/techrunnr.key"

Now save and apply the configuration.

gitlab-ctl reconfigure

And when all is complete, we will get the below result.

Gitlab Reconfigured !
Now access the GitLab URL through web








Now need to set the password for admin account.

Once password is rest,we will redirected to login page


Now Gitlab has been installed and configured on centos 7,now you can edit your profile settings,change username,add ssh key,create project and start using th Gitlab.


© 2019, Techrunnr. All rights reserved.

Questions Answered
Articles Written
Overall Points

Related posts

Leave a Reply