PVE系列教程(二十)、ubuntu22.04安装gitlab服务器

PVE系列教程(二十)、ubuntu22.04安装gitlab服务器

为了更好的浏览体验,欢迎光顾勤奋的凯尔森同学个人博客http://www.huerpu.cc:7000

一、GitLab安装

服务器配置4C8G,Ubuntu22.04。

#切换到root用户
sudo su -

#更新
apt update
apt upgrade -y

#安装和配置必须的依赖项
apt install build-essential curl file git ca-certificates -y

#配置极狐GitLab 软件源镜像
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

#下载GitLab安装包
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/bionic/gitlab-ce_14.1.2-ce.0_amd64.deb/download.deb

#安装
dpkg -i gitlab-ce_14.1.2-ce.0_amd64.deb

二、配置Gitlab

#加载配置文件
gitlab-ctl reconfigure

#配置gitlab地址,修改external_url为'http://服务器ip地址:端口'
vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.31.20:2080'

#重新加载配置文件
gitlab-ctl reconfigure

# 重启服务
gitlab-ctl restart

#查看gitlab服务状态
gitlab-ctl status

三、放行gitlab服务端口

#放行gitlab服务https、http
ufw allow https
ufw allow http
#我这里配置的是2080端口
ufw allow 2080
#开启ufw
ufw enable
#查看ufw状态
ufw status

四、修改root密码

Gitlab默认账号用户名为root,密码使用下面命令获得:

登录账户:root

密码:QfYw3GVeAgQwx/2KW6bLJejwQIZTbBn2dPkfhPX2Pwo=

#查看第一次安装GitLab生成的默认密码
cat /etc/gitlab/initial_root_password
Password: QfYw3GVeAgQwx/2KW6bLJejwQIZTbBn2dPkfhPX2Pwo=

此时访问http://192.168.31.20:2080进行登录并修改密码。因为Gitlab很内存,貌似需要4G多,建议给8G,它启动也有点慢,如果出现502可以耐心等待一下就好啦。

WX20230415-182026@2x

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

勤奋的凯尔森同学

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值