---
title: "Install Gitlab CentOS 7"
canonical: "https://techwiki.co.uk/linux/install-gitlab-centos-7"
author: "Adam Birds"
article_type: "documentation"
published: "2026-08-10T23:29:27.798Z"
updated: "2026-08-10T23:29:27.799Z"
categories: ["Linux"]
tags: []
---# Gitlab Installation
## Prerequisites
*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 gitlab.example.com
hostnamectl set-hostname gitlab.example.com --static

```

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

```

reboot

```

## 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 https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | 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.
