System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Install GitLab on CentOS 7

Last updated on:  2020-07-30

Authored by:  Rackspace Support


GitLab® Community Edition, or GitLab CE, is an open-source web-based Git repository featuring a wiki and issue tracking. This article describes how to install GitLab CE and configure Secure Sockets Layer (SSL) on a CentOS® 7 Cloud Server.

Prerequisites

  • A CentOS 7 server with at least 8 GB of RAM
  • A domain name pointed at your server

Install dependencies

There are a few dependencies that you must install before you install GitLab. CentOS 7 installs most, if not all, of these packages by default, but you should ensure that they are installed before you try to install GitLab. Install the packages with yum by using the following command:

sudo yum install -y curl policycoreutils-python openssh-server postfix

During the postfix installation, select Internet Site. On the next page, enter your domain name. Then, start and enable Postfix:

sudo systemctl enable postfix && sudo systemctl start postfix

Install GitLab CE

After you finish installing the dependencies, perform the following steps:

  1. Change directory to /tmp:

    cd /tmp
    
  2. Run the repository script from gitlab.com:

    wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh
    
  3. Install the repository:

    sudo bash script.rpm.sh
    
  4. Then, install GitLab CE:

    sudo yum install gitlab-ce
    

Configure GitLab

After you enter the command to install GitLab CE, you should see a warning about setting your domain name. While fixing that, go ahead and enable SSL with letsencrypt. Perform the following steps:

  1. Open the GitLab configuration file with a text editor. This example uses nano.

    sudo nano /etc/gitlab/gitlab.rb
    
  2. Find the external_url field and update it to match your domain name, changing HTTP to HTTPS. It should look similar to the following example:

    external_url 'https://example.com'
    
  3. Look for the letsencrypt[‘contact_emails’] field. If there is ever a problem with your SSL certificate, the system alerts the email addresses listed in this field. It should look similar to the following example:

    letsencrypt['contact_emails'] = ['bob@example.com']
    
  4. Save the file and exit.

  5. Reconfigure GitLab to have it read the new configuration file. This part may take a few minutes.

    sudo gitlab-ctl reconfigure
    

After the reconfiguration finishes, navigate to your domain name in your web browser to start using GitLab CE.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.