Ubuntu 24.04 上安装 GitLab 18.1

1. GitLab 在线安装

参考:https://about.gitlab.com/install/#ubuntu

安装和配置必要的依赖项:

$ sudo apt-get update
$ sudo apt-get install -y curl openssh-server ca-certificates tzdata perl

接下来,您需要添加GitLab软件包存储库。有一种简单的方法可以执行此操作,即通过运行以下命令:

//配置 repo

$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

[info]尽管在这种情况下它是无害的,但是警惕直接从Internet运行shell脚本。

现在,您将要设置 GitLab 对外提供服务的 URL 地址或 IP ,如果使用 https 方式,GitLab 将自动使用Let's Encrypt 请求一个证书,这需要一个有效的外部域名。

// 安装指定版本
#$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" apt-get install gitlab-ce=17.2.2-ce.0
// 锁定版本以限制自动更新:
#$ sudo apt-mark hold gitlab-ce
// 显示保留的包:
#$ sudo apt-mark showhold

$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" apt-get install gitlab-ce

如果没有域名,可以使用Ip的方式: http://192.168.3.211, 安装完成后,可以查看一下后面的输出日志,会告诉你,默认用户密码:

$ cat /etc/gitlab/initial_root_password
...
Password: 7jw56aJyF78ePVPVmN71m/3nPgP4Q3un1+XEnxhRrDE=
...

您可用使用 EXTERNAL_URL 地址访问 GitLab 并继续进行配置,默认用户名为 root ,请注意,它不是操作系统的 root。

2. 离线安装

下载地址:https://packages.gitlab.com/gitlab/gitlab-ce

// 选择下载的版本
在这里插入图片描述

// 下载
在这里插入图片描述

// 如果使用上面的方式下载,需要上传到安装的服务器上,或者使用下面的 wget 方式直接下载

$ wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/noble/gitlab-ce_18.1.0-ce.0_amd64.deb/download.deb
#$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" dpkg -i gitlab-ce_18.1.0-ce.0_amd64.deb
$ EXTERNAL_URL="http://192.168.3.211" dpkg -i gitlab-ce_18.1.0-ce.0_amd64.deb

[info]wget 的方式直接下载,可能速度会有点慢。

如果没有域名,可以使用Ip的方式: http://192.168.3.211

// 安装完成后,会显示默认密码位置

...
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
...

$ cat /etc/gitlab/initial_root_password
...
Password: bQCBr6FULdV1wzzwFiP8UmpjQmm98bGqL6RQCtIbU3k=
...

3. gitlab 首次配置

// web页面登录

在这里插入图片描述

// 更改密码:编辑属性

在这里插入图片描述

// 更改密码:输入新密码
在这里插入图片描述
// 更改语言

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维阿峰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值