GitSwarm-EE 2017.2-1 Documentation


Installation

Pre-installation steps

Use the following steps to prepare your system for installation of GitLab:

  1. Check if your server meets the requirements.

  2. Acquire a license.

    GitLab requires a valid subscription license. Certain features, such as the ability to push to a repository, are not available without a valid license. To request licenses, please contact your Perforce sales representative or email .

  3. Adjust default firewall rules.

    By default, the CentOS/RHEL firewall rules block HTTP and SSH access.

    1. For CentOS/RHEL 6.6+:

      sudo lokkit -s http -s ssh
    2. For CentOS/RHEL 7:

      sudo firewall-cmd --permanent --add-service=http
      sudo firewall-cmd --permanent --add-service=ssh
      sudo systemctl reload firewalld

    If you intend to run GitLab on a non-standard port, you must adjust the firewall rules accordingly. For example, to allow GitLab to accept connections on port 12345:

    1. For CentOS/RHEL 6.6+:

      sudo lokkit -p 12345:tcp
    2. For CentOS/RHEL 7:

      sudo firewall-cmd --zone=public --add-port=12345/tcp --permanent
      sudo systemctl reload firewalld
  4. Optional: Ensure that your system is up-to-date.

    We advise installing GitLab on a fully up-to-date operating system:

    1. For Ubuntu (12.04 and 14.04):

      sudo apt-get update
      sudo apt-get upgrade
    2. For CentOS/RHEL 6.6+ and 7:

      sudo yum update
  5. Install a mail server and curl.

    GitLab requires a local mail server to facilitate delivery of notifications via email, and curl is used in the Quick install.

    Note: If you install Postfix, select Internet Site during setup. Do not use Exim to send email from GitLab.

    Then install your selected mail server. For example:

    1. For Ubuntu (12.04 and 14.04):

      sudo apt-get install postfix curl
    2. For CentOS/RHEL 6.6+:

      sudo yum install postfix curl
      sudo service postfix start
      sudo chkconfig postfix on
    3. For CentOS/RHEL 7:

      sudo yum install postfix curl
      sudo systemctl enable postfix
      sudo systemctl start postfix
  6. Ensure that GitLab's port is not in use.

    GitLab is a web application, which uses port 80 (for HTTP) or port 443 (for HTTPS) by default. GitLab cannot operate without exclusive access to its port, so make sure no other service is using its intended port. Learn how to discover which processes are listening on specific ports.

Quick install

curl -s https://package.perforce.com/bootstrap/gitswarm-ee.sh | sudo sh -

Perform the post-installation steps.

Pre-installation Checks

As of GitSwarm 2016.3-2, the GitLab package will check, prior to installation, if user['home'] is set to a reserved directory (/opt/gitswarm, /opt/gitlab, /opt/perforce or /opt/rh). If it is set to a reserved directory, the package installation will fail with an error like the following:

ERROR:
ERROR: "user['home']" set to reserved directory '/opt/gitswarm'.
ERROR: '/opt/gitswarm', /opt/gitlab', '/opt/perforce' and '/opt/rh' are reserved directories
ERROR: for GitLab and should not be used for "user['home']".
ERROR:
ERROR: Please edit:
ERROR:
ERROR:     /opt/perforce/package-control/helix-gitswarm.config-overrides
ERROR:
ERROR: update "user['home']" and ensure that it is not set to a reserved
ERROR: directory (as listed above).
ERROR: If you are upgrading your GitLab installation, please migrate
ERROR: your installation to the new setting for "user['home']" before
ERROR: attempting to upgrade your GitLab installation.  Detailed instructions
ERROR: on how to migrate your home directory can be found in our online
ERROR: documentation here:
ERROR:
ERROR:    https://www.perforce.com/perforce/doc.current/manuals/gitswarm/update/README.html#changing-gits-home-directory
ERROR:

If you encounter this error on a new installation of GitLab, please create/edit /opt/perforce/package-control/helix-gitswarm.config-overrides and add/edit the key

user['home']

setting it to a directory that is not reserved. After changing the path, please retry the installation of GitLab.

Manual install

If you prefer to manually perform, or review, the steps undertaken by the bootstrap script above, see the Manual installation steps.

Perform the post-installation steps.

Post-installation

  1. Verify the external URL for your GitLab instance:

    View /etc/gitlab/gitlab.rb, and verify that the following setting is set to the URL that your GitLab users should use:

    external_url "http://gitlab.example.com"

    Edit the setting if necessary.

    Note: It is possible to run GitLab on a non-standard port by specifying the port as part of the external_url:

    external_url "http://gitlab.example.com:12345"

    If you do use a non-standard port, see above for instructions on adjusting the firewall for CentOS/RHEL systems.

  2. Set the timezone for your GitLab instance:

    Edit /etc/gitlab/gitlab.rb, and edit the line:

    #gitlab_rails['time_zone'] = 'UTC'

    Replace UTC with an appropriate timezone, and uncomment the line.

  3. Check the 'home' directory for your GitLab instance:

    As of GitSwarm 2016.3-2, GitLab will check user['home'] during its configuration and fail with the following error if it's set to a reserved directory:

    Recipe: gitswarm::default
    * ruby_block[Checking home directory for 'git'] action run
    
    ================================================================================
    Error executing action `run` on resource 'ruby_block[Checking home directory for 'git']'
    ================================================================================
    
    RuntimeError
    ------------
    Cannot set home directory for 'git' to '/opt/gitlab'

    If this happens, please open /etc/gitlab/gitlab.rb and edit the line:

    user['home'] = ...

    replacing the path with a directory that is not reserved by GitLab (/opt/gitswarm, /opt/gitlab, /opt/perforce, /opt/rh).

  4. Configure GitLab.

    If you have made changes to /etc/gitlab/gitlab.rb, then you will want to run reconfigure for them to take effect.

    sudo gitlab-ctl reconfigure
  5. Browse to the hostname.

    As of GitSwarm 2016.3, the root user will be prompted to reset their password (previous releases used a standard password). Once you have specified a password, you can login.

  6. Tweet about it!

If you are interested, learn about the GitLab directory structure.

If you prefer to use HTTPS with GitLab, learn how to configure HTTPS.

To uninstall GitLab, follow the uninstall steps.

Additional Setup Options

Troubleshooting

Note: For additional troubleshooting and configuration options, please see the Omnibus GitLab readme.