Leif160519的blog Leif160519的blog

——————

目录
Ubuntu 18.04搭建专署的gitlab服务器:安装gitlab
/    

Ubuntu 18.04搭建专署的gitlab服务器:安装gitlab

Ubuntu 18.04搭建GitLab服务器的官方操作指南地址:

https://about.gitlab.com/downloads/#ubuntu1804。

1.安装依赖包,运行如下命令

sudo apt-get install curl openssh-server ca-certificates postfix

执行完成后,邮件配置时候选择Internet即可。

2、如果按照官方操作,直接

运行

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce

安装估计需要三个小时才能完成,主要是下载太慢。

所以建议使用清华大学的镜像文件服务器进行安装,几分钟就能下载完毕。

镜像地址:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

首先信任 GitLab 的 GPG 公钥:

curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

修改root密码:

sudo passwd root

然后用root账户,打开vi:

su root
vi /etc/apt/sources.list.d/gitlab-ce.list

deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

粘贴至文本中,按Esc键,键入:,最后输入wq保存并退出。

安装 gitlab-ce:

sudo apt-get update
sudo apt-get install gitlab-ce

下载还是挺快的,只花了45秒的时间,用官方原址下载,几十K的速度的确很焦人。

安装.png

安装完成之后启动gitlab.

sudo gitlab-ctl reconfigure

打开 sshd 和 postfix 服务

service sshd start
service postfix start

最后,可通过输入下面的命令,检查GitLab是否安装成功并正常运行。

sudo gitlab-ctl status

在浏览器中打开:http://127.0.0.1

首次使用时,GitLab会提示设置密码,设置后就可以正常使用了。


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Ubuntu 18.04搭建专署的gitlab服务器:安装gitlab
作  者Leif160519
出  处https://github.icu/articles/2019/08/29/1567057824854.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!