在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
相关推荐
ShineWinsu9 小时前
对于Git:基础操作的超详细保姆级解析
linux·c++·git·面试·备份·管理·版本控制器
菜鸟学编程o9 小时前
Linux常见指令
linux·运维·服务器
linan10111 小时前
android调用C++通用方式
linux·架构·智能硬件
imaol111 小时前
网络通信-网络编程
linux·udp
道尔柯南12 小时前
【Linux】线程概念与控制
linux
wuminyu12 小时前
Markword在紧凑对象头上的实现原理剖析
java·linux·c语言·jvm·c++
酸菜。12 小时前
DW_apb_wdt总结
linux
虚无的纽扣12 小时前
【Linux】一篇文章带你吃透进程控制:fork、wait、exit到底在做什么
linux·ubuntu
raindayinrain12 小时前
Linux 网络编程--套接字选项
linux·网络·套接字选项
金士顿13 小时前
ASP.NET Core BackgroundService 深度解析:设备后台任务到底应该怎么设计
linux·嵌入式·asp.net core·arm64