Install Gitlab CentOS 7

From Tech Wiki
Jump to navigation Jump to search

Gitlab Installation


  • Newly launched CentOS 7 Server
  • Reasonable Disk Specifications
  • Internet Connection
  • Domain Name with DNS pointing to the IP of the server

Run Updates

It is good practice to update all of the software packages before we proceed. You can do this by running the following command:

yum upgrade -y
yum update -y

Set Server Hostname

To set the server hostname on CentOS 7 we can use the below commands:

hostnamectl set-hostname
hostnamectl set-hostname --static

It is then best practice to reboot the server with the following command:


Install Software Dependencies

First of all we need to run the following set of commands to install the correct dependencies:

sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

Setup Repository

To setup the Gitlab Repository run the following command:

curl -sS | sudo bash

Install Package

To install the package run the following command:

sudo yum install gitlab-ce

Configure Gitlab

To run the Gitlab Configuration run the following command:

sudo gitlab-ctl reconfigure

Browse to Site and Login For First Time

On your first visit, you'll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you'll be redirected back to the login screen.

The default account's username is root. Provide the password you created earlier and login. After login you can change the username if you wish.