GitLab installation on CentOS 7/RHEL 7

GitLab is a very useful open source code repository for developers. If you’ve ever used, you know what GitLab is. It’s essentially your own, off-line GitHub.

Technically speaking it’s a git server with a nice GUI, which will work just as well for standalone developers as for small companies.

First off, install a minimal installation of either CentOS 7 or Red Hat Enterprise Linux 7 (for example using this installation guide).

Once you have a working OS, let’s install all dependencies:

sudo yum install curl policycoreutils openssh-server openssh-clients

Now let’s start sshd and add it to autostart:

sudo systemctl enable sshd
sudo systemctl start sshd

We will need postfix, so GitLab can send out e-mails (registration confirmation and notifications)

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

We are setting up HTTP only here, so we have to punch a hole on firewall to allow incoming connections:

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

Remember to open HTTPS port if you choose to run https (hint: you should).

We’re ready! Now let’s add GitLab’s repository and start the installation. It’s done by this handy script:

curl -sS | sudo bash

Now all we have to do is start install:

sudo yum install gitlab-ce

Once GitLab has been installed, let’s configure it:

sudo gitlab-ctl reconfigure

You should be able to log in after this step:



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.