安装准备 📦
系统要求
- 建议使用 Ubuntu 20.04 或更高版本
- 需要 6GB以上内存 与 2核CPU
- 确保已安装 Docker 与 Docker Compose
获取安装包
点击下载GitLab Omnibus包
📁 选择对应系统的版本(Linux/Windows/macOS)
安装步骤 💻
解压文件
sudo tar -xzf gitlab-*.tar.gz -C /opt
📌 注意:路径中包含空格需替换为下划线(如
my folder
→my_folder
)配置文件修改
✏️ 打开配置文件/opt/gitlab/config/gitlab.rb
📌 示例配置项:external_url 'http://your-domain.com' git_data_dir '/home/git/data'
启动服务
🚀 执行命令:sudo /opt/gitlab/bin/gitlab-ctl reconfigure
📌 首次启动需等待几分钟完成初始化
常见问题排查 🔍
- 端口冲突:检查
80/443
端口是否被占用 - 证书错误:使用
certbot
配置HTTPS证书 - 存储问题:配置
gitlab_data_dir
为独立分区
扩展阅读 📚
如需了解更多关于GitLab的高级配置,请访问 /Community/Tutorials/GitLab_Configuration