GitLab Self-Managed
Store GitLab’s CI artifacts, LFS objects, uploads and packages, and the GitLab Runner cache, in XNS storage.
Overview
GitLab self-managed (Community or Enterprise Edition) keeps large files outside its database: CI job artifacts, Git LFS objects, issue and comment attachments (uploads), package registry files and more. Its consolidated object storage setting sends all of them to S3-compatible buckets, one bucket per type. With XNS, those buckets live on your Relayer. GitLab Runner can keep its job cache in a Relayer bucket as well.
Tested with GitLab CE 19.5.0 (Linux package, in Docker) and GitLab Runner 19.5.0 on 2026-10-18 against Relayer build 59a37e64.
The run pushed three Git LFS objects (20 to 42 MB) and checked them in a fresh clone, ran CI jobs that each uploaded a 32 MiB artifact and downloaded it back both as a single file and as the archive, attached a file through the uploads API, published and downloaded a generic package, and ran the Runner cache from a miss to a hit. Every file read back matched its SHA-256. The run used HTTP on port 9000, then repeated the LFS, artifact, upload and package checks over HTTPS on port 9443 with a trusted certificate.
Connect to XNS
Every S3 tool connects to your Relayer with the same settings. Enter them exactly as shown; the notes below the table cover the two that most tools get wrong by default.
| Setting | Value |
|---|---|
| Endpoint (HTTP) | http://<relayer-host>:9000, where <relayer-host> is the address of the machine running your Relayer. Always available. |
| Endpoint (HTTPS) | https://<relayer-host>:9443, available only after a certificate is installed on the Relayer. Port 9000 never serves HTTPS. |
| Region | us-east-1 |
| Addressing | Path-style. In tools that ask, turn on force path style or path-style access, and turn off virtual-hosted style. |
| Signature | Signature Version 4 (V4). Version 2 is refused. |
| Access key and secret key | For a tool, create a scoped key: IAM → Create IAM User in the Relayer UI. The secret is shown once, so copy it then. The install’s root pair is on Configure → Credentials; keep it for administration. |
| Bucket | Create it first: Files → Create Bucket in the Relayer UI, or let the tool create it. Names are 3-63 characters of lowercase letters, digits, hyphens and periods. |
HTTPS and certificates. The Relayer UI offers two certificates for port 9443: Let’s Encrypt, which needs a domain managed in Cloudflare and a Cloudflare API token, or self-signed. Most tools refuse a self-signed certificate unless certificate verification is turned off in the tool. On a private network, plain HTTP on port 9000 avoids the question.
Path-style. A tool left on virtual-hosted style (often labeled Amazon S3 or AWS) sends the bucket name in the hostname, and the Relayer cannot find the bucket. Choose the tool’s S3 compatible or generic S3 option and set path-style.
Not supported: server-side encryption with customer-provided keys (SSE-C) or KMS keys (SSE-KMS), bucket website hosting and bucket replication. Server-side encryption with AES256 is accepted. See Encryption at the Gateway, Identity and Access and Configure.
Prerequisites
- GitLab self-managed installed from the Linux package (Omnibus) or the Docker image. Helm chart installs take the same connection values in a secret; that form was not tested.
- One bucket per object type you move to XNS, created before you reconfigure GitLab, and a scoped key on your Relayer (see the table above).
- Network access to
<relayer-host>from the GitLab server, from every runner, and from users’ machines (see Downloads go straight to the Relayer below).
Step 1: Create the buckets
For example gitlab-artifacts, gitlab-lfs, gitlab-uploads and gitlab-packages. Use a separate bucket for each type; GitLab expects that.
Step 2: Configure consolidated object storage
Add this to /etc/gitlab/gitlab.rb. These are the settings from the tested run, with the keys replaced by placeholders.
gitlab_rails['object_store']['enabled'] = true
gitlab_rails['object_store']['proxy_download'] = false
gitlab_rails['object_store']['connection'] = {
'provider' => 'AWS',
'region' => 'us-east-1',
'endpoint' => 'http://<relayer-host>:9000',
'path_style' => true,
'aws_access_key_id' => '<access key>',
'aws_secret_access_key' => '<secret key>'
}
gitlab_rails['object_store']['objects']['artifacts']['bucket'] = 'gitlab-artifacts'
gitlab_rails['object_store']['objects']['lfs']['bucket'] = 'gitlab-lfs'
gitlab_rails['object_store']['objects']['uploads']['bucket'] = 'gitlab-uploads'
gitlab_rails['object_store']['objects']['packages']['bucket'] = 'gitlab-packages'
# Types not moved to XNS must be turned off, or reconfigure warns that they have no bucket:
gitlab_rails['object_store']['objects']['external_diffs']['enabled'] = false
gitlab_rails['object_store']['objects']['dependency_proxy']['enabled'] = false
gitlab_rails['object_store']['objects']['terraform_state']['enabled'] = false
gitlab_rails['object_store']['objects']['ci_secure_files']['enabled'] = false
gitlab_rails['object_store']['objects']['pages']['enabled'] = false
gitlab_rails['object_store']['objects']['agent_plan_content']['enabled'] = false
gitlab_rails['object_store']['objects']['ci_catalog_bundles']['enabled'] = falseThen run sudo gitlab-ctl reconfigure. GitLab 19.5 has eleven object types; the list in your version’s /opt/gitlab/etc/gitlab.rb.template is the one to follow. Give each type either a bucket or enabled = false.
| Setting | Value |
|---|---|
provider | AWS (the S3 client GitLab uses for every S3-compatible store) |
region | us-east-1 |
endpoint | http://<relayer-host>:9000, or https://<relayer-host>:9443 once a certificate is installed |
path_style | true. Required: without it GitLab puts the bucket name in the hostname. |
aws_signature_version | Leave it out (the default is 4). Version 2 is refused by the Relayer. |
Step 3: Point GitLab Runner’s cache at XNS (optional)
In the runner’s config.toml, under the [[runners]] entry:
[runners.cache]
Type = "s3"
Shared = true
[runners.cache.s3]
ServerAddress = "<relayer-host>:9000"
AccessKey = "<access key>"
SecretKey = "<secret key>"
BucketName = "gitlab-runner-cache"
BucketLocation = "us-east-1"
Insecure = true
PathStyle = trueServerAddress is host and port with no scheme. Insecure = true means plain HTTP, which port 9000 needs; for port 9443 use <relayer-host>:9443 and Insecure = false (the HTTPS cache was not tested). In the tested run the second job’s log showed Successfully extracted cache.
Step 4: Check it
- Push a repository with a Git LFS file, then clone it on another machine: the LFS file arrives intact.
- Run a pipeline whose job keeps an artifact; the job log ends with Uploading artifacts as “archive” to coordinator… 201 Created, and the artifact downloads from the job page.
- List the buckets with any S3 tool: the artifact, LFS and upload buckets now hold objects.
Downloads go straight to the Relayer
With proxy_download = false (the default), GitLab answers a download of an artifact, an LFS object or an upload with a redirect to a presigned URL on <relayer-host>. Uploads still go through GitLab. So every browser, Git client and runner that downloads these files must resolve and reach the Relayer at the address in endpoint. In the tested run a runner that could not resolve the Relayer’s name failed its job at the LFS fetch with no such host. If your users or runners cannot reach the Relayer directly, set proxy_download = true so GitLab streams the files itself; that mode was not tested.
Known limits
- Deleting a project does not empty every bucket at once. In the tested run, permanently removing the project deleted its uploads right away. Artifacts were removed by GitLab’s background artifact cleanup, and LFS objects only by
sudo gitlab-rake gitlab:cleanup:orphan_lfs_files. Generic package files stayed in the packages bucket after the project was gone and had to be removed by hand. - GitLab never removes Runner cache objects. Add a lifecycle rule to the cache bucket to expire old entries.
- Buckets are not created by GitLab. Create them on the Relayer first. A scoped key can empty a bucket but not delete it.
- HTTPS needs port 9443 and an installed certificate. A self-signed certificate must be trusted by the GitLab server, the runners and every client that follows the download redirect; that case was not tested.
- Not tested: Pages, Terraform state, the dependency proxy, external diffs, CI secure files, and the Helm chart form of these settings.
- Not supported by the Relayer: SSE-C and SSE-KMS (
aws:kms) server-side encryption and bucket replication. Server-side encryption withAES256is accepted.
