Reader small image

You're reading from  GitLab Quick Start Guide

Product typeBook
Published inNov 2018
PublisherPackt
ISBN-139781789534344
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Adam O'Grady
Adam O'Grady
author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady

Right arrow

Setting Up GitLab

As discussed in the previous chapter, GitLab can be used both as a self-managed or as a SaaS offering through GitLab.com. We also discussed the reasons for and against both methods regarding getting started with GitLab. We'll start this chapter by running through the requirements of GitLab, and in particular what you need in terms of hardware and software to run your own installation. The onnibus package and its installation on Ubuntu and CentOS will be investigated, as well as manual installations for people who can't install the omnibus package. We'll also look at a few ways of setting up an installation, as well as how to set up an account on your new installation or on GitLab.com. In particular, we'll cover the following topics:

  • Requirements
  • Omnibus installation on Ubuntu
  • Omnibus installation on CentOS
  • Manual installation on Ubuntu
  • Setting...

Requirements

Let's take a quick look at what operating system and hardware you will need to get GitLab up and running.

Hardware

In general, you'll want a minimum of two physical CPU cores to handle about 500 total users. This is feasible with one core, but you'll have the workers and background jobs running on the same core, which might slow things down. Above that, four cores will support about 2,000 users, and if you need any more than 40,000 users (which will run fine on 64 cores), you should probably look at running multiple application servers at once.

For memory, the recommendation is 2 GB of RAM, which will easily support 100 users with no issue. 1 GB of physical memory with 1 GB of swap space is probably...

Omnibus on Ubuntu/Debian

To install GitLab using the omnibus package on an Ubuntu or Debian system, make sure that you have a server with one of the following versions installed on it:

  • Ubuntu 14.04 LTS
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Debian 7
  • Debian 8
  • Debian 9

While the installation may work on other systems, it isn't guaranteed.

First, you'll need to connect to a Terminal session, update your package lists, and make sure that a few key packages are installed by running the following commands:

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates

Next, you'll need to decide whether you want to use Postfix to send notification emails or an external SMTP provider. While the latter is recommended, if you do plan to use Postfix, you'll need to install it like so:

sudo apt-get install -y postfix

During the installation of Postfix, a...

Omnibus on CentOS/RHEL/Scientific Linux/Oracle Linux

To install GitLab using the omnibus package on a CentOS, Red Hat Enterprise Linux (RHEL), Scientific Linux, or Oracle Linux system, make sure that you have a server with a base that's compatible with CentOS 7.

First, you'll need to connect to a Terminal session and make sure that a few key packages are installed by running the following commands:

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

Now, you'll need to allow HTTP and SSH traffic through the local device firewall. This can be done by running the following code lines:

sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

Next, you'll need to decide on whether you want to use Postfix to send notification emails or external SMTP provider. While the latter is...

Manual installation

There are some situations where you won't be able to use an omnibus package to install GitLab, potentially if you want to use your own existing hardware, existing server software, or your own database. In these cases, you can do a manual installation of GitLab, which we will run through in this section. Please be aware that it is a more complicated process, and using the omnibus installation package is recommended if possible.

Initial packages

There are some initial packages you'll need to install before you even think about language runtimes. Many might be available through your chosen operating system's package manager, otherwise you might need to source them from the net. The current list...

Setting up HTTPS

Security-conscious readers may have picked up that we're only using insecure HTTP, which might be fine for local installs or air-gapped networks, but if you're running on a cloud server, want to protect your server from man-in-the-middle attacks, or just want to follow best practices, I've outlined two ways that you can implement HTTPS. The first involves the free Let's Encrypt SSL provider and the second one is an option if you have your own certificates ready to go.

Let's Encrypt

GitLab comes with the ability to automatically fetch and renew certificates from Let's Encrypt for the primary domain and the container registry for you. To get this running, you just need to specify...

Creating accounts on GitLab

Whether you've decided to create your own instance of GitLab or sign up via GitLab.com, you'll need to create a personal account. This is super simple to do: you just need to browse to https://gitlab.com/users/sign_in (replacing gitlab.com with your own instance hostname) and select Register.

From here, you need to supply a name, username, email, and password, accept the terms and conditions, and then register. You'll be sent an email with a confirmation link that you can click on to finish activating your account.

Now, you should be ready to move on to the next chapter and explore the GitLab workflow.

Summary

In this chapter, we explored the requirements of GitLab and discovered what systems it can run on. We noted down the required RAM, CPU, storage space, operating system, and software components/frameworks.

We ran through installing and configuring GitLab. We looked at setting up the omnibus package, which is an all-in-one option for getting up and running with GitLab on Ubuntu, CentOS, and their related operating systems.

For people who aren't able to run the Omnibus package, we also ran through a manual installation.

Lastly, we explored creating an account on GitLab.com or a self-managed GitLab instance.

In the next chapter, we'll discover more about git and the workflow that's recommended for projects that are using it. We'll also go through the GitLab workflow, an alternative that was presented by GitLab as the preferred way to work with git projects...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
GitLab Quick Start Guide
Published in: Nov 2018Publisher: PacktISBN-13: 9781789534344
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady