在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
相关推荐
光电的一只菜鸡5 小时前
ubuntu之坑(二十)——VMware虚拟机系统无法正常进入如何处理
linux·运维·ubuntu
你住过的屋檐7 小时前
【Nginx】linux上安装nginx
linux·运维·nginx
宵时待雨7 小时前
linux笔记归纳17:传输层协议UDP
linux·笔记·udp
SCandL1528 小时前
k8s service
linux·容器·kubernetes
会飞的土拨鼠呀9 小时前
Linux的存储使用率应该如何计算
linux·运维·服务器
weixin_5112552111 小时前
NGINX常用配置
linux·服务器·nginx
昌原的儿子LEO12 小时前
进程和线程(2)
linux·服务器·网络
会飞的土拨鼠呀12 小时前
Linux 真实内存使用率的核心计算标准
linux·运维·服务器
陈年老古董14 小时前
CentOS编译安装Python3.11完整教程
linux·笔记·学习·centos·python3.11
深念Y14 小时前
为什么选 Go:直观、可维护、AI 友好
linux·开发语言·人工智能·golang·agent·harness