GitLab Installation

How Can We Help?

GitLab Installation

You are here:
< Back to the Wiki

This article will explain how to install GitLab (16.1.2) on a Debian-based system. GitLab is a Git server, with DevOps capabilities. It will help you plan, create, build, deploy, and manage code.

Prerequisites

According to the GitLab documentation (docs.gitlab.com), GitLab requires the following resources:

  • 4 CPUs
  • 4 GB of Memory
  • 2,5 GB of Storage, additionally, it requires storage for the repositories you will create

For future notice, the GitLab changelog can be found at gitlab.com.

In case you are undertaking a migration have a look at docs.gitlab.com or at wiki.mphslaats.com for a reference or a migration path.

Installation

Take note that this installation is for GitLab Community Edition (gitlab-ce), in case you want to install GitLab Enterprise Edition (gitlab-ee), change gitlab-ce for gitlab-ee!

Before we start, make sure that your system is up-to-date (minimum: apt-get update), for a smooth installation. Before installing GitLab install the necessary packages as follows:

apt-get install -y curl openssh-server ca-certificates perl postfix

Now add the GitLab package repository using the following command:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash

To install GitLab run apt-get install gitlab-ce.

Since we did not specify an external URL for GitLab, the installation will fail. This is done intentionally since we want to configure GitLab before it configures itself.

GitLab failed to install due to a missing URL

To configure GitLab open /etc/gitlab/gitlab.rb.
In this file modify external_url 'http://gitlab.example.com' to your website URL.
Additionally, if you install this in a virtualized environment it is recommended to add the following line to disable kernel changes:

package['modify_kernel_parameters'] = false

In case you modified the URL to HTTPS, make sure you have your firewall opened to the GitLab server so it will be able to fetch the SSL certificate.

Now reconfigure GitLab by running gitlab-ctl reconfigure. Optionally, if you want to run reconfigure and log the output to a file run gitlab-ctl reconfigure 2>&1 | tee gitlab-ctl_reconfigure.log.

Once GitLab is configured you can visit your new site at your given URL. The username is root and the password can be found in /etc/gitlab/initial_root_password. Take note that this is a temporary file and after 24 hours the file is gone. Additionally, it is recommended to change your password once logged in.

Sources

2 Responses

  1. Lynwood says:

    Appreciate you sharing this informative post. Your ideas were very helpful and I learned a lot from it.

  2. Luann says:

    The article provides valuable insights and practical tips that can be used in real life situations. Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents