在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_urlhttp://<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
相关推荐
m0_743697593 分钟前
磁盘管理的相关知识
linux
先知后行。15 分钟前
内核中的侵入式链表,slub对象池,CAS
linux
进击切图仔26 分钟前
GitLab 新用户创建与项目授权操作指南
gitlab
酷可达拉斯1 小时前
Linux操作系统-tcpdump抓包定位网络问题实战
linux·运维·服务器·网络·tcpdump
byte轻骑兵1 小时前
BlueZ 5.x 整体架构总览:用户态 + 内核态分层设计核心逻辑
linux·架构·bluez·电脑蓝牙·嵌入式蓝牙
ltl9 小时前
大多数「无锁」代码其实不是无锁的
linux
ltl9 小时前
Linux 内核的内存屏障:一个让我调了三天的 bug
linux
Lonely 净土11 小时前
Rocky Linux 安装教程
linux·运维·服务器
kyshipit15 小时前
Failed to take /etc/passwd lock: Invalid argument解决方案
ubuntu
李白你好15 小时前
Windows 离线 Linux 提权辅助查询工具
linux