Text of docs.gitlab.com › install › self_compiled as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Self-compiled installation | GitLab Docs

/ Self-compiled installation Tier : Free, Premium, Ultimate Offering : GitLab Self-Managed This is the official installation guide to set up a production GitLab server using the source files. It was created for and tested on Debian/Ubuntu operating systems. Read requirements.md for hardware and operating system requirements. If you want to install on RHEL/CentOS, you should use the Linux packages . For many other installation options, see the main installation page .

This guide is long because it covers many cases and includes all commands you need. The following steps have been known to work. Use caution when you deviate from this guide. Make sure you don’t violate any assumptions GitLab makes about its environment. For example, many people run into permission problems because they changed the location of directories or run services as the wrong user. If you find a bug/error in this guide, submit a merge request following the contributing guide .

Consider the Linux package installation Because a self-compiled installation is a lot of work and error prone, we strongly recommend the fast and reliable Linux package installation (deb/rpm). One reason the Linux package is more reliable is its use of runit to restart any of the GitLab processes in case one crashes. On heavily used GitLab instances the memory usage of the Sidekiq background worker grows over time. The Linux packages solve this by letting Sidekiq terminate gracefully if it uses too much memory.

After this termination runit detects Sidekiq is not running and starts it. Because self-compiled installations don’t use runit for process supervision, Sidekiq can’t be terminated and its memory usage grows over time. Select a version to install Make sure you view this installation guide from the branch (version) of GitLab you would like to install (for example, 16-0-stable ). You can select the branch in the version dropdown list in the upper-left corner of GitLab (below the menu bar).

If the highest-numbered stable branch is unclear, check the GitLab blog for installation guide links by version. Software requirements Software Minimum version Notes Ruby 3.3.13 From GitLab 16.7 to 17.4, Ruby 3.1 is required. From GitLab 17.5, Ruby 3.2 is required. In GitLab 19.0 and later, Ruby 3.3.13, 3.4.12, 4.0.9, or a later release in the same series is required, because earlier releases are affected by CVE-2026-97229 .

Ruby 3.4.10 and 3.4.11 are later than 3.3.13 but are not patched. You must use the standard MRI implementation of Ruby. We love JRuby and Rubinius , but GitLab needs several Gems that have native extensions. RubyGems 3.6.x A specific RubyGems version is not required, but you should update to benefit from some known performance improvements. Go 1.26.10 GitLab 19.5 requires Go 1.26.10 or later in the 1.26 series, or 1.27.3 or later in the 1.27 series.

Earlier toolchains still trust the compromised eMudhra certificate authority. Git 2.51.x GitLab 19.5 requires Git 2.51 or later. You should use the Git version provided by Gitaly . Node.js 22.23.x GitLab 19.5 requires Node.js 22.23 or later. PostgreSQL 17.x GitLab 19.5 requires PostgreSQL 17 or later. GitLab directory structure The following directories are created as you go through the installation steps: |-- home | |-- git | |-- .ssh | |-- gitlab | |-- gitlab-shell | |-- repositories /home/git/.ssh - Contains OpenSSH settings.

Specifically, the authorized_keys file managed by GitLab Shell. /home/git/gitlab - GitLab core software. /home/git/gitlab-shell - Core add-on component of GitLab. Maintains SSH cloning and other functionality. /home/git/repositories - Bare repositories for all projects organized by namespace. This directory is where the Git repositories which are pushed/pulled are maintained for all projects. This area contains critical data for projects.

Keep a backup . The default locations for repositories can be configured in config/gitlab.yml of GitLab and config.yml of GitLab Shell. It is not necessary to create these directories manually now, and doing so can cause errors later in the installation. Installation workflow The GitLab installation consists of setting up the following components: Packages and dependencies . Ruby . RubyGems . Go . Node . System users .

Database . Redis . GitLab . NGINX . 1. Packages and dependencies sudo sudo is not installed on Debian by default. Make sure your system is up-to-date and install it. shell # run as root! apt-get update -y apt-get upgrade -y apt-get install sudo -y Build dependencies Install the required packages (needed to compile Ruby and native extensions to Ruby gems): shell sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libre2-dev \ libreadline-dev libncurses5-dev libffi-dev curl openssh-server libxml2-dev libxslt-dev \ libcurl4-openssl-dev libicu-dev libkrb5-dev logrotate rsync python3-docutils pkg-config cmake \ runit-systemd GitLab requires OpenSSL version 1.1.

If your Linux distribution includes a different version of OpenSSL, you might have to install 1.1 manually. Git You should use the Git version provided by Gitaly that: Is always at the version required by GitLab. May contain custom patches required for proper operation. Install the needed dependencies: shell sudo apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev libpcre2-dev build-essential git-core Clone the Gitaly repository and compile Git.

Replace <X-Y-stable> with the stable branch that matches the GitLab version you want to install. For example, if you want to install GitLab 19.2, use the branch name 19-2-stable : shell git clone https://gitlab.com/gitlab-org/gitaly.git -b <X-Y-stable> /tmp/gitaly cd /tmp/gitaly sudo make git GIT_PREFIX = /usr/local Optionally, you can remove the system Git and its dependencies: shell sudo apt remove -y git-core sudo apt autoremove When editing config/gitlab.yml later , remember to change the Git path: From: yaml git : bin_path : /usr/bin/git To: yaml git : bin_path : /usr/local/bin/git GraphicsMagick For the Custom Favicon to work, GraphicsMagick must be installed. shell sudo apt-get install -y graphicsmagick Mail server To receive mail notifications, make sure to install a mail server.

By default, Debian is shipped with exim4 but this has problems while Ubuntu does not ship with one. The recommended mail server is postfix and you can install it with: shell sudo apt-get install -y postfix Then select Internet Site and press Enter to confirm the hostname. ExifTool GitLab Workhorse requires exiftool to remove EXIF data from uploaded images. shell sudo apt-get install -y libimage-exiftool-perl 2. Ruby The Ruby interpreter is required to run GitLab.

See the requirements section for the minimum Ruby requirements. The fix for CVE-2026-97229 is in Ruby 3.3.13, 3.4.12, 4.0.9, and later releases in each series. A higher version number alone is not sufficient. For example, Ruby 3.4.10 and 3.4.11 are later than 3.3.13 but are not patched. Self-compiled installations use the system Ruby, so you must update Ruby separately from GitLab. Upgrading GitLab alone does not apply the fix.

Ruby version managers such as RVM, rbenv, or chruby can cause hard-to-diagnose problems with GitLab. You should instead install Ruby from the official source code. 3. RubyGems Sometimes, a newer version of RubyGems is required than the one bundled with Ruby. To update to a specific version: shell gem update --system 3.4.12 Or the latest version: shell gem update --system 4. Go GitLab has several daemons written in Go.

To install GitLab, you must install a Go compiler. The following instructions assume you use 64-bit Linux. You can find downloads for other platforms at the Go download page . Use Go 1.26.10 or later in the 1.26 series, or Go 1.27.3 or later in the 1.27 series, to build GitLab. These releases distrust the compromised eMudhra certificate authority ( CVE-2026-111943 ). A higher version number alone is not sufficient. For example, Go 1.27

The rest of this page is on the live site.