在Ubuntu上安装GitLab的步骤如下:
打开终端,运行以下命令:
sudo apt update
sudo apt upgrade
sudo apt install curl openssh-server ca-certificates postfix
执行以下命令来添加GitLab存储库,并获取安装脚本:
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
接下来,在终端中运行以下命令来安装GitLab:
sudo apt install gitlab-ce
运行以下命令来重新配置GitLab:
sudo gitlab-ctl reconfigure
输入下面的命令:
sudo gitlab-ctl stop
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-ctl start
默认密码在 /etc/gitlab/initial_root_password
,复制root密码,登录,如下图:
cd /opt/gitlab/bin/
sudo gitlab-rails console -e production
查询用户账号信息并赋值给 u
:
User.where(id:1).first
设置该用户名的密码 u.password 'your_new_password'
确认密码 u.password_confirmation 'your_new_password'
保存信息 u.save!
注册后不能立即登陆,需管理员审批。登陆管理员账户 user:root
,Password: your_default_password
。登录后,点击配置GitLab,查看最新的用户,点击等待批准,然后批准该用户进入群组。
以上步骤为在Ubuntu上安装GitLab的基本流程,可能因版本不同而略有差异,请根据实际情况进行调整。