1、下载镜像:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.1.2-ce.0.el7.x86_64.rpm
2、安装rpm包
rpm -ivh gitlab-ce-13.1.2-ce.0.el7.x86_64.rpm
3、打开系统防火墙HTTP和SSH访问
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
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
4、修改centos配置文件
#编辑配置文件
vim /etc/gitlab/gitlab.rb
#修改访问URL
#格式:external_url 'http://ip:端口'
external_url 'http://192.168.1.1:9080'
#配置时区
gitlab_rails['time_zone'] = 'Asia/Shanghai'
5、防火墙开放端口
# 开放9080端口
firewall-cmd --zone=public --add-port=9080/tcp --permanent
6、重启防火墙
firewall-cmd --reload
7、查看端口号是否开启
firewall-cmd --query-port=9080/tcp
8、重置Gitlab
gitlab-ctl reconfigure
9、启动Gitlab
gitlab-ctl restart
10、访问Gitlab页面