Ubuntu安裝GitLab

1.安裝必要軟件包

sudo apt update
sudo apt upgrade
sudo apt install build-essential curl file git ca-certificates

2.下載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
sudo dpkg -i gitlab-ce_14.1.2-ce.0_amd64.deb

3.啟動GitLab實例

sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
sudo gitlab-ctl status

4.配置防火墻

sudo ufw allow https
sudo ufw allow http
sudo ufw allow ssh
sudo ufw enable
sudo ufw status

5.訪問GitLab Web界面

打開Web瀏覽器,訪問http://Your-IP-address

6.查看GitLab默認root初始密碼(盡快修改root密碼)

sudo cat /etc/gitlab/initial_root_password

7.GitLab項目域名或IP設(shè)置及修改

7.1 編輯gitlab.yml配置文件,修改host
sudo vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
1 ## GitLab settings
2   gitlab:
3     ## Web server settings (note: host is the FQDN, do not include http://)
4     host: 127.0.0.1
5     port: 80
6     https: false
7.2 編輯gitlab.rb文件,修改external_url
sudo vim /etc/gitlab/gitlab.rb
1 ## Url on which GitLab will be reachable.
2 ## For more details on configuring external_url see:
3 ## https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/configuration.md#configuring-the-external-url-for-gitlab
4 external_url 'http://127.0.0.1'
7.3 重啟GitLab服務(wù)
sudo gitlab-ctl restart

8.設(shè)置GitLab開機自啟

systemctl enable gitlab-runsvdir.service

9.設(shè)置GitLab Web界面中文顯示

bc57be4f0fa746379bcf1d061a4329b.jpg
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容