一、确保你的linux服务器安装了sshd和ssh-client,而且sshd须要启动linux
基本都已经安装,若是没有装执行下面的命令git
yum install openssh-server openssh-clients
systemctl start sshd
注:centos7之前的版本用:web
service sshd start
二、安装curl和policycoreutils
centos
yum install curl policycoreutils
三、放开端口提供web访问以及git clone(若是是云主机设置安全组放开端口便可;个人服务器上80端口被占用了,这里使用了8001端口)安全
firewall-cmd --permanent --add-port=8001/tcp
四、执行gitlab官方的安装准备脚本bash
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
五、使用yum直接安装gitlab-ce服务器
yum -y install gitlab-ce
注:个人服务器网络不是很好,yum下载gitlab-ce安装包的时候总是中断,不过最后也下载成功了。
若是你也有这种状况,建议你直接下载安装包,再拷贝到linux服务器上;下载地址https://packages.gitlab.com/gitlab/gitlab-ce/网络
六、安装完成后须要修改配置文件,例如web访问和git clone使用的urlssh
vi /etc/gitlab/gitlab.rb
在文件中找到对应配置并修改(填写你的url)curl
external_url 'http://gitlab.xyztest.com:8001'
七、从新加载配置
gitlab-ctl reconfigure
八、启动
gitlab-ctl start