---
title: "Gitlab服务器配置"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/gitlab-server-setup/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/03-软件工程与质量保障/CI-CD与质量保障/CI-CD工具链/Gitlab服务器配置.md"
content_hash: be177eef7fc53e032dd4fb65c38265282b1b9db782d2cf8d171ac9cebd50e00b
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# Gitlab服务器配置

﻿# Gitlab服务器配置

> 创建时间：2021/4/27 14:53

## 配置流程

安装依赖包：
sudo apt-get install curl openssh-server ca-certificates postfix

执行完成后，出现邮件配置，选择Internet那一项（不带Smarthost的）

利用清华大学的镜像来进行主程序的安装，按照链接中的步骤做就可以：
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

配置GitLab IP地址和端口号：
sudo -e /etc/gitlab/gitlab.rb
external_url "http://192.168.1.xxx:8085"

> 根据自己的需求设置端口号，不要跟其他程序冲突就可以。

如果开启额防火墙，需要把相应的端口放开，例如使用 firewalld 防火墙，则输入以下命令
firewall-cmd --zone=public --add-port=8085/tcp --permanent

应用配置：
gitlab-ctl reconfigure

重启：
其他内网的任意一台计算机上使用浏览器访问：
http://192.168.1.xxx:8085

> 注意：由于使用的是http协议，在网页上不输入http，会默认使用https，报错：
>  This site can’t provide a secure connection

## ref

https://www.jianshu.com/p/8079a9a81ef3
