Ubuntu22.04使用dpkg离线安装Gitlab-ce

Ubuntu22.04使用dpkg离线安装Gitlab-ce

0.环境说明

操作系统版本:Ubuntu 20.04.6 LTS
Gitlab-ce 版本:13.10.3

1.下载并安装Gitlab-ce

下载并安装 Gitlab-ce,命令如下:

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/focal/main/g/gitlab-ce/gitlab-ce_13.10.3-ce.0_amd64.deb
dpkg -i gitlab-ce_13.10.3-ce.0_amd64.deb

2.编辑配置文件

1.修改 Gitlab 配置文件
命令如下

vim /etc/gitlab/gitlab.rbsed -i "s|external_url 'http://gitlab.example.com'|external_url 'http://192.168.109.71'|g" /etc/gitlab/gitlab.rb

2.查看配置文件修改情况
命令如下:

grep external_url /etc/gitlab/gitlab.rb|grep -v "#"

3.重载配置文件并启动服务

重载配置文件(会自动启动 Gitlab 服务),命令如下:

gitlab-ctl reconfigure

gitlab其他常用命令:

  • gitlab-ctl start:启动gitlab 在执行gitlab-ctl reconfigure 服务默认已经启动
  • gitlab-ctl status:看目前gitlab所有服务运维状态
  • gitlab-ctl stop:停止gitlab服务
  • gitlab-ctl stop nginx:单独停止某个服务
  • gitlab-ctl tail:查看所有服务的日志

4.登录Gitlab

1.查看默认密码
命令如下:

cat /etc/gitlab/initial_root_password

2.使用用户名密码登录(用户为 root)
在浏览器输入如下地址:

http://SERVER_IP
posted @ 2025-06-06 21:03  己难寻  阅读(99)  评论(0)    收藏  举报