1、上传将gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm软件上传到/root文件夹中下载地址Index of /gitlab-ce/yum/el7/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirrorwget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm2、安装然后执行如下命令详情请参考gitlab安装记录yum -y install policycoreutils openssh-clients postfix systemctl enable sshd sudo systemctl start sshd systemctl enable postfix systemctl start postfix yum -y install policycoreutils-python rpm -i gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm3、修改配置文件vim /etc/gitlab/gitlab.rb修改默认的配置文件把这个external_url http://gitlab.example.com 改成服务器ip新建路径(作为数据存储路径此步骤可以不执行采用默认路径/var/opt/gitlab/git-data/)改为新路径/home/datas/gitlab-data/修改 /etc/gitlab/gitlab.rb配置文件 583行git_data_dirs({default {path /home/datas/gitlab-data}})4、使配置生效gitlab-ctl reconfigure5、启动gitlabgitlab-ctl restart6、验证netstat -tunlp7、修改端口号(可选)将默认80访问端口改成5023修改文件/etc/gitlab/gitlab.rb第1311行代码/var/opt/gitlab/nginx/conf/gitlab-http.conf35行listen *:80 改为listen *:5023重启gitlab-ctl restart