How to Install Gitlab on CentOS/RHEL 5/6/7

Share It!

GitLab is a web-based Git repository manager and issue tracking features. GitLab is similar to GitHub, but GitLab has an open source version, unlike GitHub. Git repository management, code reviews, issue tracking, activity feeds and wikis. It comes with GitLab CI for continuous integration and delivery.


This article will help you to install Gitlab on CentOS/RHEL using Omnibus install method. The Omnibus project is a full-stack platform-specific solution.

Step 1: Install and Configure the necessary dependencies

You need to configure mail service on our server. We can use any mail service like postfix, sendmail, exim etc. In this article I am using postfix email service.

# yum install postfix 
# service postfix start
# chkconfig postfix on
# lokkit -s http -s ssh

Step 2: Install other dependencies

Now you need to install other dependencies packages. You following command to install dependencies:

# yum install curl openssh-server cronie

Step 3: Install GitLab package on Server

Use following command to install GitLab packages on server.

# curl | # bash
# yum install gitlab-ce

If you are not comfortable installing the repository through a piped script, you can find the entire script here.

Step 4: Change External URl

If you want to change the external url the use follow below steps:

# vim /etc/gitlab/gitlab.rb
external_url ''

Step 5: Configure GitLab on Server

# gitlab-ctl reconfigure

Step 6: Acces and login GitLab

You can browse GitLab from your browser using server IP or hostname. Use below details to login in GitLab:
Username: root 
Password: 5iveL!fe



Note: If you do any changes in configuration file than you need to run reconfigure command to make the changes.Use following command to reconfigure:

# gitlab-ctl reconfigure

GitLab Detail:

Main Configuration File: /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
GitLab Document Root: /opt/gitlab
Default Repository Location: /var/opt/gitlab/git-data/repositories
Default Nginx Configuration File: /opt/gitlab/embedded/conf/nginx.conf
GitLab Nginx Configuration file Location: /var/opt/gitlab/nginx/conf
Postgresql data Directory: /var/opt/gitlab/postgresql/data

  1. 7 months ago
    • 7 months ago

Leave a Reply

Your email address will not be published.