GitLab-CE download, install and use

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

  1. First trust Gitlab's GPG public key:
    $ curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

  2. 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

  1. Update source
    sudo apt-get update

  2. Installation dependencies
    $ sudo apt-get install -y curl openssh-server ca-certificates tzdata

  3. Install SMTP sending mail software (optional)
    $ sudo apt-get install -y postfix

  4. Add GitLab package repository
    $ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

  5. Install GitLab
    sudo apt-get install gitlab-ce
    successfully installed interface
    Successful installation interface

  6. Configure the /etc/gitlab/gitlab.rb file
    EXTERNAL_URL="https://gitlab.example.com"

  7. Reload the configuration file (wait a little longer)
    $ gitlab-ctl reconfigure
    configuration completion interface
    Configuration complete interface

If it gets stuck during the configuration process,

  1. Hold CTRL+C to force the end of the process
  2. run $ systemctl restart gitlab-runsvdir
  3. Re-run $ gitlab-ctl reconfigure
  1. Restart GItLab service
    $ gitlab-ctl restart
  2. View GitLab status
    gitlab-ctl status
  3. Check port 80
    $ netstat -an | grep 80
  4. Browser enter the address https://gitlab.example.com to configure the username and password

3) Other (optional)

  1. 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

Modify the clone address

The installation is now complete.

Guess you like

Origin blog.csdn.net/weixin_44290157/article/details/109260835