Home  >  Article  >  Development Tools  >  How to install GitLab on CentOS

How to install GitLab on CentOS

PHPz
PHPzOriginal
2023-03-31 16:19:572055browse

GitLab is an open source platform for code management and collaboration. It provides a series of functions such as source code management, issue tracking, CI/CD, etc., to make team collaboration more efficient. The latest version is GitLab 13.x. This article will introduce how to install GitLab on CentOS.

Prerequisites for installing GitLab:

1. You need a server running CentOS (CentOS 7 or higher, 64-bit is recommended)

2. Make sure the server has curl installed

3. Make sure the necessary packages and dependencies to run GitLab are installed on the server

Here are the steps to install GitLab on CentOS:

  1. Install the necessary dependencies and packages

Run the following command to install the necessary dependencies and packages on your CentOS server:

sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
  1. Install the gitlab repository

Use the following command to download and install the GitLab repository:

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  1. Install GitLab CE

Run the following command to install GitLab CE :

sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

*Note: Please note to replace http://gitlab.example.com with the actual URL

  1. Start GitLab CE

Installation successful After that, start GitLab using the following command:

sudo gitlab-ctl reconfigure
  1. Set root password

You will be asked to set the root password on the GitLab page, and you can access GitLab through the following address:

http://Your_Server_IP_or_Hostname

  1. Install Docker (if necessary)

If your GitLab needs to use the Docker function, you can execute the following commands in order to install docker :

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker

7. Complete

At this point, you have successfully installed GitLab on CentOS. Code management and collaboration can now be carried out through GitLab, improving team efficiency.

The above is the detailed content of How to install GitLab on CentOS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn