Home > Development Tools > git > How to install GitLab on CentOS 7

How to install GitLab on CentOS 7

PHPz
Release: 2023-03-31 09:40:17
Original
807 people have browsed it

GitLab is an open source code warehouse management tool based on the Git warehouse management system. Its design is inspired by GitHub, but its installation and deployment are simpler. In this article, we will show you how to install GitLab on CentOS 7.

  1. Install required dependencies

GitLab requires some prerequisites during installation. You can use the following command to install these necessary packages:

sudo yum update
sudo yum install -y curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
Copy after login
  1. Install Postfix

GitLab requires a mail server to send notification emails, so you need to install Postfix and install it Set to start automatically at boot. On CentOS, you can install Postfix using the following command:

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
Copy after login
  1. Install GitLab

Before installing GitLab, you need to add GitLab's RPM repository. Here we will add the GitLab Community Edition RPM repository.

First, import GitLab’s GPG key:

curl https://packages.gitlab.com/gpg.key | sudo apt-key add -
Copy after login

Then, add GitLab’s RPM repository:

sudo curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
Copy after login

Now you can use the following command to install GitLab on your system :

sudo yum install -y gitlab-ce
Copy after login

This process takes a while to install and configure GitLab. During this process, you will need to provide some necessary configuration information, such as your site name and administrator account information.

  1. Access GitLab

After the GitLab installation is complete, you can access the default GitLab URL (which can be queried with the command below):

sudo gitlab-ctl status
Copy after login

The output should be Similar to the following:

run: gitlab-workhorse: ... pid ...; ...
run: logrotate: ... pid ...; ...
run: nginx: ... pid ...; ...
run: postgresql: ... pid ...; ...
run: redis: ... pid ...; ...
run: sidekiq: ... pid ...; ...
run: unicorn: ... pid ...; ...
Copy after login

By default, GitLab is served over port 80 using the HTTP protocol. If you have allowed HTTP in the CentOS firewall, you can access GitLab via the server's IP address or domain name.

When you access GitLab’s URL, you will be directed to GitLab’s login interface. Enter the administrator account you created when installing GitLab. In this way, you have completed the installation and deployment of GitLab.

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template