INSTALLATIONS

Install GitLab on CentOS 7 and Derivatives

install gitlab
install gitlab

Install GitLab on CentOS 7 and Derivatives

This post helps you to install GitLab on CentOS 7 (and RedHat/Oracle/Scientific Linux 7) server. Basically, GitLab is a web-based git repository. It’s a centralizes space for developers so that they can store, share and test their work and updates.

Install GitLab

GitLab started as an open-source project maintained by GitLab Inc. You can also install a self-maintained GitLab core. It’s available as open source. It requires atleast 4GB RAM and 4GB SWAP for flawless operation. This setup will support up to 100 users but it will be slow. You can see the complete requirement Here.

Also, please check this documentation if you need to add a swap partition on your server.

If you are not a fan of SELinux, I suggest to disable it. Then start the installation.

First, install the dependencies and the postfix server.

yum install -y epel-release
yum install -y curl policycoreutils-python openssh-server
yum -y install postfix
systemctl start postfix
systemctl enable postfix

Add Apache and Postfix services to the firewall

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=smtp
firewall-cmd --permanent --add-service=pop3
firewall-cmd --permanent --add-service=imap
firewall-cmd --permanent --add-service=smtps
firewall-cmd --permanent --add-service=pop3s
firewall-cmd --permanent --add-service=imaps
firewall-cmd --reload

Add the GitLab package repository:

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

Install GitLab Server:

Then install the GitLab package. You need to Replace “gitlab.grepitout.com” with your desired hostname. GitLab will automatically issue a certificate with Let’s Encrypt if you have a valid hostname.

EXTERNAL_URL="https://gitlab.grepitout.com" yum install -y gitlab-ee

Once the installation got completed, open a browser and call your URL, here: https://gitlab.grepitout.com. This page will redirect to a “Create Password” page, you can create a login password there. Then you can login to your GitLab server with the following details:

Username: root
Password: < Newly_Created_Password >

How to Reconfigure GitLab?

If you wish to change the hostname and its URL or you would like to change any other GitLab configuration you need to edit the file /etc/gitlab/gitlab.rb

vim /etc/gitlab/gitlab.rb

If you wish to change your hostname search for the directive “external_url” and add your new hostname there.

external_url 'http://gitlab.domain.com'

You need to run the following command once the changes are made.

gitlab-ctl reconfigure

That’s it!

Also Read:

If you like the post Understanding top Command and wish to receive more articles from us, please like our FB page: GrepItOut

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments. For more details on our services, please drop us an E-mail at info@grepitout.com

Topics