gitlab-ce的安裝方法有很多,這里放出官方的其中一個方法,https://www.gitlab.com.cn/installation/#centos-7 采用這個方法必須能保證網(wǎng)絡能訪問到鏡像.本文采用搭建國內(nèi)鏡像yum源的方式進行安裝.
1.安裝基礎軟件依賴包
yum install curl policycoreutils openssh-server openssh-clients
2.開啟sshd服務
systemctl enable sshd
systemctl start sshd
3.開放GitLab web的端口
firewall-cmd --permanent --add-port=80/tcp
4.新建yum源
新建一個 vim /etc/yum.repos.d/gitlab-ce.repo源,使用國內(nèi)的鏡像源.
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
5.執(zhí)行安裝
yum makecache
yum install gitlab-ce
6.啟動并初始化
gitlab-ctl start
gitlab-ctl reconfigure
初始化成功之后就可以查看狀態(tài)了,

gitlab-ce狀態(tài).jpg
如圖,服務已經(jīng)起來了.可以通過 http://ip 去訪問gitlab-ce了.

gitlab-ce登錄界面.jpg
這樣就可以成功安裝gitlab-ce服務了.
關于gitlab的配置給出git的官方文檔以供參考:
https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab