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.啟動(dòng)GitLab實(shí)例
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默認(rèn)root初始密碼(盡快修改root密碼)
sudo cat /etc/gitlab/initial_root_password
7.GitLab項(xiàng)目域名或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開機(jī)自啟
systemctl enable gitlab-runsvdir.service
9.設(shè)置GitLab Web界面中文顯示
bc57be4f0fa746379bcf1d061a4329b.jpg