centos7 安装gitlab

本文详细介绍如何在CentOS上安装GitLab,包括依赖安装、GitLab包安装、配置及启动过程。通过此教程,您可以顺利搭建自己的GitLab服务器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

第一步 yum安装依赖

sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

# 根据环境运行
# sudo firewall-cmd --permanent --add-service=http
# sudo systemctl reload firewalld

PS: 我在安装的时候发现,缺少firewalld服务, 为了与官方的要求一致,我又通过yum安装了 firewalld服务

sudo yum install firewalld
sudo systemctl start firewalld
firewall-cmd --permanent --add-service
sudo systemctl reload firewalld

第二步 下载安装gitlab package

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

如果脚本无法运行, 可以直接下载下来

curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-0.el7.x86_64.rpm/download
rpm -i gitlab-ce-XXX.rpm

第三步 配置gitlab

sudo gitlab-ctl reconfigure

第四步 启动

sudo gitlab-ctl start

PS: centos7 防火墙 允许80端口

sudo firewall-cmd --permanent --zone=public --add-port=80/tcp

访问:http://xxx.xxx.xxx.xxx
会提示你管理员账号密码重置
管理员用户名默认为 root


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值