1.安装依赖包
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
2. 邮件配置
选择Internet那一项,不带Smarthost的
sudo apt-get install -y postfix
3. 添加镜像
使用清华大学镜像 https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/123
免费版
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
企业版
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
4. 安装
sudo apt-get update
sudo apt-get install gitlab-ce或者sudo apt-get install gitlab-ee
5. 配置访问路径
sudo -e /etc/gitlab/gitlab.rb
修改下图中的路径
TIM图片20190212135449.png
6. 更新配置
sudo gitlab-ctl reconfigure
7. 重新启动gitlab
sudo gitlab-ctl restart
结果如下图
TIM图片20190212135903.png
8. 打开 sshd 和 postfix 服务
service sshd start
service postfix start
9. 查看gitlab服务器状态
sudo gitlab-ctl status
10. 结果
在浏览器中访问http://127.0.0.1