GitLab-CE download, install and use (Ubuntu as an example)
One, download and install
1. Installation instructions
The installation of Gitlab needs to be above 4Gb of RAM, otherwise it will be very stuck, or even a 502 error cannot be accessed.
Download gitlab download address gitlab-download
2. Modify the installation source
1) Modify the installation source
Use Tsinghua Yuan
-
First trust Gitlab's GPG public key:
$ curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
-
Modify the file /etc/apt/sources.list.d/gitlab-ce.list (Ubuntu 16.04LTS as an example)
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
Other linux versions visit Gitlab Community Edition mirror usage help
2) Install gitlab-ce
-
Update source
sudo apt-get update
-
Installation dependencies
$ sudo apt-get install -y curl openssh-server ca-certificates tzdata
-
Install SMTP sending mail software (optional)
$ sudo apt-get install -y postfix
-
Add GitLab package repository
$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
-
Install GitLab
sudo apt-get install gitlab-ce
successfully installed interface
-
Configure the /etc/gitlab/gitlab.rb file
EXTERNAL_URL="https://gitlab.example.com"
-
Reload the configuration file (wait a little longer)
$ gitlab-ctl reconfigure
configuration completion interface
If it gets stuck during the configuration process,
- Hold CTRL+C to force the end of the process
- run
$ systemctl restart gitlab-runsvdir
- Re-run
$ gitlab-ctl reconfigure
- Restart GItLab service
$ gitlab-ctl restart
- View GitLab status
gitlab-ctl status
- Check port 80
$ netstat -an | grep 80
- Browser enter the address https://gitlab.example.com to configure the username and password
3) Other (optional)
-
Modify clone http address
$ vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
Restart gitlab after setting the host & port in the figure below
$ gitlab-ctl restart
The installation is now complete.