CentOS7系统安装GitLab

📅 2026/7/11 10:42:48
CentOS7系统安装GitLab
1.清华大学开源软件镜像站中查找gitlab镜像选择gitlab-ce社区免费版本清华大学开源软件镜像站地址2.清华大学开源软件镜像站中查找gitlab镜像选择gitlab-ce社区免费版本3.选择CnetOS版本el74.选择gitlab版本进行下载gitlab-ce-16.5.1-ce.0.el7.x86_64.rpm5.rpm文件上传gitlab安装[rootlocalhost ~]# lsanaconda-ks.cfg gitlab-ce-16.5.1-ce.0.el7.x86_64.rpm[rootlocalhost ~]# yum install gitlab-ce-16.5.1-ce.0.el7.x86_64.rpm -y6.gitlab无法检测到实例的有效主机名Thank youforinstalling GitLab! GitLab was unable to detect a valid hostnameforyour instance.Please configure a URLforyour GitLab instance by setting external_url configuration in/etc/gitlab/gitlab.rb file.Then,you canstartyour GitLab instance by running the following command: sudo gitlab-ctl reconfigure7.为gitlab实例配置url访问地址设置为当前主机ip地址[rootlocalhost ~]# vim /etc/gitlab/gitlab.rbexternal_urlhttp://10.62.158.2008.启动gitlab实例安装完成gitlab是开机自启的不用设置[rootlocalhost ~]# gitlab-ctl reconfigureUsername: root Password: You didnt opt-in to print initial root password to STDOUT.Password stored to/etc/gitlab/initial_root_password.This file will be cleaned up in first reconfigure run after 24 hours.9.登录gitlab网站用户名为root初始化密码在 /etc/gitlab/initial_root_password 文件中网址 - http://10.62.158.200/users/sign_in[rootlocalhost ~]# cat /etc/gitlab/initial_root_password# WARNING: This value is valid only in the following conditions# 1. If provided manually (either via GITLAB_ROOT_PASSWORD environment variable or via gitlab_rails[initial_root_password] setting in gitlab.rb, it was provided before database was seeded for the first time (usually, the first reconfigure run).# 2. Password hasnt been changed manually, either via UI or via command line.## If the password shown here doesnt work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.Password: 4RsIjQr3oFuutObHhTbPgW3OGOsoIzuHFXyFOPjLn1Q# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.10.初始化密码会在登录后的24小时后自动删除需要重新配置登录密码及界面语言PreferencesLanguage选择简体中文然后点击Save changes保存配置刷新页面即可生效编辑个人资料密码修改密码后保存即可11.若要在服务器上进行git操作需要安装git客户端[rootlocalhost ~]# yum install git