温馨提示×

centos gitlab啥端口

小樊
43
2026-09-06 00:08:24
栏目: 智能运维

CentOS 上部署 GitLab(通常指 Omnibus 包安装的 GitLab)时,常见端口如下:

1. 默认端口(HTTP / HTTPS)

  • 80 → GitLab Web 页面(HTTP)
  • 443 → GitLab Web 页面(HTTPS,启用 SSL 后)

2. SSH 端口(代码拉取/推送)

  • 22 → GitLab SSH(默认)

⚠️ 如果 CentOS 本身已用 22 做 SSH 登录,GitLab 可改端口(如 2222)

3. 其他内部服务端口(一般不用对外开放)

  • 8080 → Unicorn / Puma(GitLab 后端服务)
  • 8168 → Prometheus(监控)
  • 9090 → Prometheus 访问端口
  • 9121 / 9187 → 各种 exporter
  • 6379 → Redis
  • 5432 → PostgreSQL

常见修改示例(/etc/gitlab/gitlab.rb)

external_url 'http://gitlab.example.com'

# 修改 SSH 端口
gitlab_rails['gitlab_shell_ssh_port'] = 2222

# 修改 Nginx 端口
nginx['listen_port'] = 8081

修改后执行:

gitlab-ctl reconfigure

如果你是用 Docker 版 GitLab源码安装,端口会不一样,可以告诉我你用的是哪种方式。

0