CentOS

How to install Gitlab on CentOS 8

Gitlab is an application tool that is used for source code management. Users can use this tool as an alternative to Github and they can simply install the GitLab CE server and enjoy the full advantages of its useful features including code reviews, wikis, issue tracking, and activity feeds. GitLab is an online git repository manager on which different team members can communicate on testing, coding, and application deployment. We will install Gitlab In this article on CentOS 8 through the command line.

Prerequisites

Execute all commands must under the root privileges.

Installation of GitLab on CentOS 8

Follow the below-given steps to install Gitlab on your system Centos:

Step 1: Install Required Packages repository 

First, you need to install the prerequisites including the OpenSSH and Postfix packages on your system that are required to install GitLab. Open the terminal from the left side bar of the activities menu which is also shown in the following image:

So, install all packages dependencies for the GitLab CE by using the following dnf command:

$ sudo dnf -y install curl policycoreutils openssh-server openssh-clients postfix

Once the installation is completed, by using the following commands enable and start the services of postfix and SSH.

$ systemctl start sshd

$ systemctl start postfix

After that, enable or add both services on system boot.

$ systemctl enable sshd

$ systemctl enable postfix

Now, services are enabled. Check the running status of each service by executing the following command:

$ systemctl status sshd

$ systemctl status postfix

Step 2: Add Repository and Install GitLab

To install GitLab CE, add the official GitLab repository on your CentOS 8 system. Add the GitLab repository to your system by using the following script:

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

After running the above script, the following results display on the terminal window:

Step 3: Install GitLab CE on CentOS 8

Now, run the below-mentioned command to install the GitLab CE packages on your system:

$ sudo dnf install gitlab-ce –y

Once the installation of all packages is completed, the following result will notify the installation of GitLab on your system:

Now, the GitLab community edition is installed on your CentOS 8 system.

Step 4: configure the GitLab CE on CentOS 8

Open the following configuration file in any text editor as follows:

$ sudo nano /etc/gitlab/gitlab.rb

Paste your desire external URL in it as follows:

external_url ‘https://gitlab.example.com

Save changes and then run the below-given command to reconfigure the GitLab CE:

$ sudo gitlab-ctl reconfigure

Change the firewall configuration by running the following commands:

$ sudo firewall-cmd --permanent --add-service={ssh,http,https} --permanent

$ sudo firewall-cmd --reload

Now, open the GitLab web console and type the https://gitlab.example.com URL in the address bar as follows:

Once you successfully login to the GitLab, visit the GitLab tutorial and start work on it.

Conclusion

We have installed and configured GitLab CE on CentOS 8 in this article. Finally, GitLab is installed on your CentOS 8 system now.

Similar Posts