在ubuntu上使用apt方式安装gitlab

1. 添加apt源

bash 复制代码
curl https://packages.gitlab.com/gpg.key | sudo apt-key add -
sudo apt-add-repository "deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $(lsb_release -cs) main"

2. 安装

bash 复制代码
sudo apt-get update
sudo apt-get install gitlab-ce

3. 修改配置

编辑/etc/gitlab/gitlab.rb文件

  1. 修改访问路径。
    修改external_url 为 http://<ip>:<port> ip为当前服务器得ip,port任选一个空闲端口
  2. 修改时区
    gitlab_rails'time_zone' = 'Asia/Shanghai'
  3. 为了节约资源,可以做如下修改
    puma'worker_processes' = 2
    sidekiq'concurrency' = 8
    postgresql'shared_buffers' = "128MB"
    postgresql'max_worker_processes' = 4
    prometheus_monitoring'enable' = false

4. 更新配置并重启

bash 复制代码
gitlab-ctl reconfigure
gitlab-ctl restart

5. 查看默认密码

bash 复制代码
cat /etc/gitlab/initial_root_password

6. 登录

访问路径为上次配置的external_url http://<ip>:<port>

默认用户名为 root

密码为 /etc/gitlab/initial_root_password 保存的值

7. 修改系统配置

  1. 登录后修改默认密码 > 右上角头像 > Perferences > Password
  2. 关闭头像服务:点击> Admin
    Settings > General > Account and limit > 取消 Gravatar enabled > Save changes
  3. 关闭用户注册功能 Admin->Settings > General > New user account restrictions > 取消 Allow new user accounts > Save changes
  4. 开启 webhook 外部访问 Admin->Settings > Network > Outbound requests > Allow requests to the local network from web hooks and services 勾选 > Save changes
  5. 设置当前用户语言为中文 右上角用户头像 > Preferences > Localization > Language > 选择简体中文 > Save changes
相关推荐
琥珀.3 小时前
mysql中json数组转列表查询
linux·运维·服务器
dawnsky.liu4 小时前
在 RHEL 中使用 goose 实现远程主机管理
linux·运维·ai
Linux运维技术栈6 小时前
CVE-2026-91403 高危漏洞修复:Rocky Linux 9 多版本 JDK 环境清理实操
java·linux·运维
hhhjhl7 小时前
Undici 跨端三方库仓颉适配全流程
java·开发语言·ubuntu
slongzhang_7 小时前
linux 递归删除源码文件|递归删除目录下 *.js,但排除 *.min.js
linux·开发语言·javascript
叼烟扛炮7 小时前
Linux 学习笔记(三十三):线程互斥——互斥锁(Mutex)与死锁
linux·运维·服务器·笔记·学习·1024程序员节
无足鸟ICT8 小时前
【RHCA+】who命令(查看已登陆用户)
linux·运维·服务器
Escalating_xu8 小时前
【Linux 网络编程】应用层协议 HTTP(下):Header、连接管理与 C++ HTTP 服务器
linux·服务器·网络
GeW10 小时前
新质生产力路线图落地,Linux运维与数据库架构师的机会清单
linux
Brilliantwxx10 小时前
【Linux】 文件访问与路径解析:目录、文件名、dentry、路径缓冲与 dcache 全解析
linux·运维·服务器·开发语言·spring