1. 下载依赖
apt install curl openssh-server ca-certificates postfix
安装postfix会有如下提示,选择local only
2. 信任gitlab公钥
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
更换国内镜像下载
echo "deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu bionic main" >> /etc/apt/sources.list.d/gitlab-ce.list
3. 下载
apt-get update
apt install gitlab-ce
如果步骤2执行之后还行,GPG的密钥错误,在如下下载:
dpkg -i gitlab-ce_14.9.0-ce.0_amd64.deb
4. 配置
vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.3.55'
gitlab_rails['gitlab_email_enabled'] = true
##! If your SMTP server does not like the default 'From: gitlab@gitlab.example.com'
##! can change the 'From' with this setting.
gitlab_rails['gitlab_email_from'] = 'c@163.com'
gitlab_rails['gitlab_email_display_name'] = 'c'
gitlab_rails['gitlab_email_reply_to'] = 'c@163.com'
git_data_dirs({
"default" => {
"path" => "/data/git-data"
}
})
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.server"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "smtp user"
gitlab_rails['smtp_password'] = "smtp password"
gitlab_rails['smtp_domain'] = "example.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_pool'] = false
修改完成后
gitlab-ctl reconfigure
http://192.168.3.55:11111/users/sign_in