Home > Article > Development Tools > How to install GitLab on CentOS 7
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.
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
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
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 -
Then, add GitLab’s RPM repository:
sudo curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
Now you can use the following command to install GitLab on your system :
sudo yum install -y gitlab-ce
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.
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
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 ...; ...
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!