在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
相关推荐
StarsGreen15 小时前
Linux 网络配置命令参考
linux
Eyfcom1 天前
〖物流 SaaS 实战 02〗SaaS 租户的计费与订阅模型:从“一锤子买卖”到“按需订阅”
linux·服务器·数据库·快递系统·物流saas实战
忆挽篱笙歌1 天前
systemV进程通信
linux·运维·服务器
无奈笑天下1 天前
银河麒麟桌面操作系统上磁盘无法自动挂载问题处理
linux·运维·服务器
木头左1 天前
【Linux运维】服务器磁盘清理与Docker日志治理实战:一次巡检释放70G空间
linux·docker·磁盘清理·日志治理
星恒随风2 天前
MySQL 从零入门(七):索引原理与 B+ 树详解——从磁盘 I/O 到 InnoDB 聚簇索引
linux·服务器·数据库·笔记·mysql
多弗朗皮卡丘2 天前
网络基础:数据链路层与其他协议或技术
linux·网络·tcp/ip
dingdingfish2 天前
TLPI 第52章 读书笔记:POSIX Message Queues
linux·mq·ipc·posix·message·tlpi