Please check gitlab-tutorial

Skip to content

Upgrading Linux package instances

DETAILS: Tier: Free, Premium, Ultimate Offering: Self-managed

Upgrading Linux package instances to a later version of GitLab requires several steps, many specific to Linux package installations.

Downtime

  • For single node installations, GitLab is not available to users while an upgrade is in progress. The user's web browser shows a Deploy in progress message or a 502 error.
  • For multi-node installations, see how to perform zero-downtime upgrades.
  • Upgrades to multi-node installations can also be performed with downtime.

Earlier GitLab versions

For version-specific information for earlier GitLab versions, see the documentation archives. The versions of the documentation in the archives contain version-specific information for even earlier versions of GitLab.

For example, the documentation for GitLab 15.11 contains information on versions back to GitLab 11.

Skip automatic database backups

The GitLab database is backed up before installing a newer GitLab version. You may skip this automatic database backup by creating an empty file at /etc/gitlab/skip-auto-backup:

sudo touch /etc/gitlab/skip-auto-backup

Nevertheless, you should maintain a full up-to-date backup on your own.

Upgrade a Linux package instance

To upgrade a Linux package instance:

  1. Complete the initial steps in the main GitLab upgrade documentation.
  2. If you are upgrading from a non-package installation to a GitLab package installation, follow the steps in Upgrading from a non-package installation to a GitLab package installation.
  3. Continue the upgrade by following the sections below.

Required services

You can perform upgrades with the GitLab instance online. When you execute the upgrade command, PostgreSQL, Redis, and Gitaly must be running.

By using the official repositories (recommended)

All GitLab packages are posted to the GitLab package server. Six repositories are maintained:

If you have installed GitLab Community Edition or Enterprise Edition, then the official GitLab repository should have already been set up for you.

Upgrade to the latest version

If you upgrade GitLab regularly (for example, every month), you can upgrade to the latest version by using the package manager for your Linux distribution.

To upgrade to the latest GitLab version:

# Ubuntu/Debian
sudo apt update && sudo apt install gitlab-ee

# RHEL/CentOS 7 and Amazon Linux 2
sudo yum install gitlab-ee

# RHEL/Almalinux 8/9 and Amazon Linux 2023
sudo dnf install gitlab-ee

# SUSE
sudo zypper install gitlab-ee

NOTE: For the GitLab Community Edition, replace gitlab-ee with gitlab-ce.

Upgrade to a specific version

Linux package managers default to installing the latest available version of a package for installation and upgrades. Upgrading directly to the latest major version can be problematic for older GitLab versions that require a multi-stage upgrade path. An upgrade path can span multiple versions, so you must specify the specific GitLab package with each upgrade.

To specify the intended GitLab version number in your package manager's install or upgrade command:

  1. Identify the version number of the installed package:

    # Ubuntu/Debian
    sudo apt-cache madison gitlab-ee
    
    # RHEL/CentOS 7 and Amazon Linux 2
    yum --showduplicates list gitlab-ee
    
    # RHEL/Almalinux 8/9 and Amazon Linux 2023
    dnf --showduplicates list gitlab-ee
    
    # SUSE
    zypper search -s gitlab-ee
  2. Install the specific gitlab-ee package by using one of the following commands and replacing <version> with the next supported version you would like to install (make sure to review the upgrade path to confirm the version you're installing is part of a supported path):

    # Ubuntu/Debian
    sudo apt install gitlab-ee=<version>-ee.0
    
    # RHEL/CentOS 7 and Amazon Linux 2
    sudo yum install gitlab-ee-<version>-ee.0.el7
    
    # RHEL/Almalinux 8/9
    sudo dnf install gitlab-ee-<version>-ee.0.el8
    
    # Amazon Linux 2023
    sudo dnf install gitlab-ee-<version>-ee.0.amazon2023
    
    # OpenSUSE Leap 15.5
    sudo zypper install gitlab-ee=<version>-ee.sles15
    
    # SUSE Enterprise Server 12.2/12.5
    sudo zypper install gitlab-ee=<version>-ee.0.sles12

NOTE: For the GitLab Community Edition, replace ee with ce.

By using a downloaded package

If you don't want to use the official repositories, you can download the package and install it manually. This method can be used to either install GitLab for the first time or upgrade it.

To download and install or upgrade GitLab:

  1. Go to the official repository of your package.

  2. Filter the list by searching for the version you want to install. For example, 14.1.8. Multiple packages might exist for a single version, one for each supported distribution and architecture. Next to the filename is a label indicating the distribution, as the filenames may be the same.

  3. Find the package version you wish to install, and select the filename from the list.

  4. In the upper-right corner, select Download.

  5. After the package is downloaded, install it by using one of the following commands and replacing <package_name> with the package name you downloaded:

    # Debian/Ubuntu
    dpkg -i <package_name>
    
    # RHEL/CentOS 7 and Amazon Linux 2
    rpm -Uvh <package_name>
    
    # RHEL/Almalinux 8/9 and Amazon Linux 2023
    dnf install <package_name>
    
    # SUSE
    zypper install <package_name>

NOTE: For the GitLab Community Edition, replace gitlab-ee with gitlab-ce.

Upgrade the product documentation (optional)

If you installed the product documentation, see how to upgrade to a later version.

Troubleshooting

See troubleshooting for more information.