一、安装gitlab依赖环境
yum -y install vim wget epel-release
yum install curl policycoreutils openssh-server openssh-clients -y
systemctl enable sshd
systemctl start shhd
systemctl start sshd
yum install postfix -y
systemctl enable postfix
systemctl start postfix
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
二、下载安装gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.1-ce.0.el7.x86_64.rpm
chmod 755 gitlab-ce-9.5.1-ce.0.el7.x86_64.rpm
rpm -ivh gitlab-ce-9.5.1-ce.0.el7.x86_64.rpm
三、启动gitlab
gitlab-ctl reconfigure
vim /etc/gitlab/gitlab.rb
external_url 'http://本机ip地址'
gitlab-ctl reconfigure
补充说明:https://www.cnblogs.com/alex-note/p/7458848.html