<commit_before>---
layout: post
title: "Getting started with GitLab and DigitalOcean"
date: 2016-04-27
author: <NAME>
author_twitter: _axil
categories: tutorials
tags: digitalocean, gitlab
image_title: '/images/blogimages/sharks-paper.jpg'
---

_This tutorial is adapted from the [How To Use the GitLab One-Click Install
Image to Manage Git Repositories][do-source] tutorial on DigitalOcean._

### Introduction

Collaborating on projects, keeping track of source changes, and maintaining a
clean code repository are some great reasons to use a version control system.
Version control is now considered an essential tool in software development.

Git is the most popular distributed version control system. GitLab is a Git
repository management server that can be used to host repositories and set up
control structures for git within a clean web interface. It is built on Ruby on
Rails.

[DigitalOcean] has created a GitLab application image that can be used to
instantly deploy GitLab Community Edition on a DigitalOcean Ubuntu 14.04 x86-64
droplet using the [Omnibus installer]. You can have your own repository system
up and running in minutes.

<!-- more -->

## Requirements

The [GitLab documentation recommends a minimum of 2GB of RAM and 2 CPU cores][req]
for optimum performance. If your projects are small (fewer than 100 users total),
1GB of RAM and 1 CPU core may be sufficient, but make sure you have at least 1GB
swap. You can follow the [How To Add Swap on Ubuntu 14.04][swap] tutorial.

Low memory may result in `500` server errors ("cannot allocate memory"), so make
sure you add enough RAM according to your needs.

## Step One – Create a GitLab Droplet

Before you begin using GitLab, you need to spin up a DigitalOcean droplet using
the provided image.

From the Control Panel, click on the "Create Droplet" button that is visible
from any page:

![Create Droplet](/images/blogimages/getting-started-with-gitlab-and-digitalocean/create-droplet-shadow.png)

Under the "Choose an image" section, select the "One-click Apps" tab and click
the "GitLab" image (the version might differ).

![Droplet app](/images/blogimages/getting-started-with-gitlab-and-digitalocean/select_gitlab_app-shadow.png)

The next step is to choose the droplet size and the region you would like to use.

![Hardware](/images/blogimages/getting-started-with-gitlab-and-digitalocean/hardware-shadow.png)

Add any SSH Keys, select any settings you'd like to use, and click "Create" at
the bottom.

![Finalize creation](/images/blogimages/getting-started-with-gitlab-and-digitalocean/finalize-shadow.png)

Your GitLab droplet will be created and available in a few minutes!

## Step Two – Configure Domain Names and Emails

We still need to configure just a few things first to utilize our environment.

Begin by setting up the domain name you would like to use for your GitLab
instance. Learn [how to set up domain names on DigitalOcean][do-domain] if you
want to use DigitalOcean's nameservers.

>**Note:**
If you don't have a domain name at your disposal, you can just use your
droplet's IP address, but GitLab will not be able to send emails.

Once your domain name is configured correctly, you need to adjust some values
on the actual VPS instance. Log into your droplet as root through SSH, and open
the GitLab configuration file with your text editor:

```
vim /etc/gitlab/gitlab.rb
```

Uncomment and adjust the `external_url` parameter to match your domain name:

```
external_url "http://your_domain.com/"
```

If you have [generated an SSL certificate][ssl] for your domain, you can
configure GitLab to use it in this file as well. The following settings set the
locations of the SSL certificates and instruct the NGINX web server to redirect
the HTTP traffic to HTTPS. Note that for HTTPS to work, you **must** set the URL<commit_msg>Clarify email note<commit_after>---
layout: post
title: "Getting started with GitLab and DigitalOcean"
date: 2016-04-27
author: <NAME>
author_twitter: _axil
categories: tutorials
tags: digitalocean, gitlab
image_title: '/images/blogimages/sharks-paper.jpg'
---

_This tutorial is adapted from the [How To Use the GitLab One-Click Install
Image to Manage Git Repositories][do-source] tutorial on DigitalOcean._

### Introduction

Collaborating on projects, keeping track of source changes, and maintaining a
clean code repository are some great reasons to use a version control system.
Version control is now considered an essential tool in software development.

Git is the most popular distributed version control system. GitLab is a Git
repository management server that can be used to host repositories and set up
control structures for git within a clean web interface. It is built on Ruby on
Rails.

[DigitalOcean] has created a GitLab application image that can be used to
instantly deploy GitLab Community Edition on a DigitalOcean Ubuntu 14.04 x86-64
droplet using the [Omnibus installer]. You can have your own repository system
up and running in minutes.

<!-- more -->

## Requirements

The [GitLab documentation recommends a minimum of 2GB of RAM and 2 CPU cores][req]
for optimum performance. If your projects are small (fewer than 100 users total),
1GB of RAM and 1 CPU core may be sufficient, but make sure you have at least 1GB
swap. You can follow the [How To Add Swap on Ubuntu 14.04][swap] tutorial.

Low memory may result in `500` server errors ("cannot allocate memory"), so make
sure you add enough RAM according to your needs.

## Step One – Create a GitLab Droplet

Before you begin using GitLab, you need to spin up a DigitalOcean droplet using
the provided image.

From the Control Panel, click on the "Create Droplet" button that is visible
from any page:

![Create Droplet](/images/blogimages/getting-started-with-gitlab-and-digitalocean/create-droplet-shadow.png)

Under the "Choose an image" section, select the "One-click Apps" tab and click
the "GitLab" image (the version might differ).

![Droplet app](/images/blogimages/getting-started-with-gitlab-and-digitalocean/select_gitlab_app-shadow.png)

The next step is to choose the droplet size and the region you would like to use.

![Hardware](/images/blogimages/getting-started-with-gitlab-and-digitalocean/hardware-shadow.png)

Add any SSH Keys, select any settings you'd like to use, and click "Create" at
the bottom.

![Finalize creation](/images/blogimages/getting-started-with-gitlab-and-digitalocean/finalize-shadow.png)

Your GitLab droplet will be created and available in a few minutes!

## Step Two – Configure Domain Names and Emails

We still need to configure just a few things first to utilize our environment.

Begin by setting up the domain name you would like to use for your GitLab
instance. Learn [how to set up domain names on DigitalOcean][do-domain] if you
want to use DigitalOcean's nameservers.

>**Note:**
If you don't have a domain name at your disposal, you can just use your
droplet's IP address, but GitLab will _not_ be able to send emails without
using an SMTP server.

Once your domain name is configured correctly, you need to adjust some values
on the actual VPS instance. Log into your droplet as root through SSH, and open
the GitLab configuration file with your text editor:

```
vim /etc/gitlab/gitlab.rb
```

Uncomment and adjust the `external_url` parameter to match your domain name:

```
external_url "http://your_domain.com/"
```

If you have [generated an SSL certificate][ssl] for your domain, you can
configure GitLab to use it in this file as well. The following settings set the
locations of the SSL certificates and instruct the NGINX web server to redirect
the HTTP traffic to HTTPS. Note that for HTTPS to work, you **must** set the URL
{'fraction_non_alphanumeric': 0.06412253374870197, 'fraction_numerical': 0.008047767393561786, 'mean_word_length': 4.5914368650217705, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3525687', 'n_tokens_mistral': 2240, 'n_tokens_neox': 2047, 'n_words': 1100}