{"id":20122098,"url":"https://github.com/jiucheng-front/create-private-gitlab","last_synced_at":"2026-05-10T03:37:45.123Z","repository":{"id":126944308,"uuid":"223517017","full_name":"jiucheng-front/create-private-gitlab","owner":"jiucheng-front","description":":closed_lock_with_key:How to create private gitlab.","archived":false,"fork":false,"pushed_at":"2019-12-13T13:38:11.000Z","size":1143,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T07:28:47.000Z","etag":null,"topics":["centos7","gitlab","linux","vim","vmware"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiucheng-front.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-23T02:06:44.000Z","updated_at":"2023-03-04T05:41:01.000Z","dependencies_parsed_at":"2023-06-19T04:39:42.870Z","dependency_job_id":null,"html_url":"https://github.com/jiucheng-front/create-private-gitlab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiucheng-front%2Fcreate-private-gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiucheng-front%2Fcreate-private-gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiucheng-front%2Fcreate-private-gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiucheng-front%2Fcreate-private-gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiucheng-front","download_url":"https://codeload.github.com/jiucheng-front/create-private-gitlab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241565640,"owners_count":19983168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centos7","gitlab","linux","vim","vmware"],"created_at":"2024-11-13T19:34:58.477Z","updated_at":"2026-05-10T03:37:40.090Z","avatar_url":"https://github.com/jiucheng-front.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"### 如何创建私有Gitlab仓库，方面公司内部托管私有代码(MAC/Windows类式)\n\u003e 思考：如何在一台电脑上运行两个系统？买新电脑--成本大！！安装双系统--只能运行一个系统！！虚拟机：同一台电脑借助虚拟机可以运行不同的操作系统，gitlab搭建在linux上比较方面快捷\n\n\u003e 一、安装VMware(创建虚拟机桌面应用工具)和centos7(linux发布的版本之一)\n\n1. 下载VMware(外网相对较慢)，下载后进行安装，参考：[VMware](https://www.cnblogs.com/zhangycun/p/10932326.html)，[哔哩](https://www.bilibili.com/video/av24441039?p=56)。MAC安VMware装包百度网盘下载：链接:https://pan.baidu.com/s/18WbC5kzn_v22sDx-uEOeuw  密码:nft9\n\n```\nhttps://www.vmware.com/products/fusion/fusion-evaluation.html\n```\n\n2. Liunx系统镜像下载(CentOS 7): CentOS-7-x86_64-DVD-1908.iso ，下载后待备用,4个G太大(网盘有限制不然这里也提供了)自行下载(选择国内镜像地址下载也很快)\n\n```\nhttp://mirrors.aliyun.com/centos/7.7.1908/isos/x86_64/\n```\n\n3. 安装好VMware之后并允许信任软件，(Mac)将下载好的centos7---.iso拖至安装区域，进行安装,(Win)下选择创建虚拟机，把下载的Centos7路径导入(国内镜像地址：https://www.centos.org/download/mirrors/)，Win下示意图\n\n![](./img/vmware1.png)\n上图创建过程需要设定虚拟机内存(建议内存4G，2个处理器)，一路下一步，然后CD/DVD(IDE)自动检测指定镜像文件(即上面下载的CentOS-7-x86_64-DVD-1908.iso路径)\n![](./img/vmware2.png)\n确定之后开启此虚拟机，如下图，选择:install centos7，耐心等待\n![](./img/centos71.png)\n安装过程选择中文，软件选择记得勾选：GNOME-XWindows,等待检测后：开始安装，安装过程可以：创建root用户密码(记住)，安装完成之后：重启，同意许可一路前进\n![](./img/centos72.png)\n安装完成如图，接下来配置IP(可以访问外网，且局域网可以访问该虚拟机)，在虚拟机桌面右键打开终端继续第4步\n![](./img/centos73.png)\n\n4. 配置Centos7的IP，参考：[哔哩](https://www.bilibili.com/video/av24441039?p=56)。\n```\n// 进入目录\ncd /etc/sysconfig/network-scripts/\n// 查看目录\nll|less\n// 默认配置文件是：ifcfg-ens33文件\nifcfg-ens33\n// vim 打开编辑：主要是ip配置，保证虚拟机能正常联网\n: set nu // 进入编辑模式\n\n编辑完毕\n:wq //保存即可\n\n```\n\n\u003e 二、安装gitlab,官方教程：https://about.gitlab.com/install/#centos-7\n注意：gitlab-ee应该是商业版，gitlab-ce应该是社区版本，以下使用gitlab-ce\n\n\n1. 基础配置安装命令：centos7系统下的命令行执行\n\n```\nsudo yum install curl policycoreutils openssh-server openssh-clients\nsudo systemctl enable sshd\nsudo systemctl start sshd\nsudo yum install postfix\nsudo systemctl enable postfix\nsudo systemctl start postfix\n```\n\n2 添加gitlab镜像(wget不存在要先安装：yum -y install wget)，此版本：gitlab-ce(2019-10-07 21:47),可以自行在清华大学开源镜像社区(https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/)查找最新的版本.\n\n```\nsudo wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.1.14-ce.0.el7.x86_64.rpm\n```\n\n3. 安装gitlab，安装成功入下图\n```\nsudo rpm -i gitlab-ce-12.1.14-ce.0.el7.x86_64.rpm\n```\n\n![](./img/install-gitlab.jpg)\n\n4. 配置gitlab(下面命令执行时间断断续续较长，不停的在action run...耐心等待~),完成入下图\n```\nsudo gitlab-ctl reconfigure\n```\n\n![](./img/gitlab-config.png)\n\n5. 启动gitlab服务，如下图\n\n```\nsudo gitlab-ctl start\n```\n![](./img/gitlab-start.png)\n\n6. 内网浏览器访问：此时就可以IP地址(上面安装centos7配置的IP)访问，如我的，若不能IP正常访问请停止centos内防火墙(生产不推荐)~\n```\nservice firewalld stop\n```\n\n![](./img/ip-link.jpg)\n\n7. 后续操作，登录成功后(默认有个最开始root账号，也接受注册登录)的操作就和github界面差不多，就可以愉快的创建仓库管理私密代码了。如图\n![](./img/gitlab-logined.png)\n\n\n8. 停止gitlab服务\n```\nsudo gitlab-ctl stop\n```\n\n\u003e 参考文档：[Gitlab](https://about.gitlab.com/install/#centos-7)，[cnblogs](https://www.cnblogs.com/wtil/p/11664153.html)，[尚硅谷](https://www.bilibili.com/video/av24441039?p=56)\n\n\n\u003e 注意：默认安装VMware时候分配的虚拟机内存是1G，这样在安装完gitlab之后可能犹豫内存不足导致的卡顿！解决参考：[百度经验](https://jingyan.baidu.com/article/86fae3460f83d83c49121a1c.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiucheng-front%2Fcreate-private-gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiucheng-front%2Fcreate-private-gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiucheng-front%2Fcreate-private-gitlab/lists"}