Chapter 30Lesson 01~330 minutes

Self-Managed Administration: Configuration, Email, Object Storage, Backups, Restore, and Maintenance: Concepts, Architecture, and Mental Model

Build a precise Self-Managed GitLab operator mental model: service dependencies, installation-specific configuration, SMTP, object and repository storage, backup scope, secrets, restore compatibility, health, and maintenance.

Self-ManagedMental modelBackupsSecretsRecovery

Learning objectives

  • Separate GitLab.com, Dedicated, and Self-Managed operational responsibility.
  • Describe the main Self-Managed services and why configuration, data, and encryption secrets have different recovery lifecycles.
  • Distinguish Linux package, Docker, Helm chart, and self-compiled configuration/backup interfaces.
  • Explain SMTP, object storage, repository storage, health probes, background jobs, and maintenance as platform dependencies.
  • Define a restore as a verified recovery outcome rather than the existence of a backup archive.
Availability and safety baseline — verified 2026-08-22 against GitLab 19.3. Backup/restore, health checks, Rake administration, SMTP configuration, and object-storage administration are Self-Managed concerns and have Free-compatible paths where the installation method supports them. Maintenance Mode is Premium/Ultimate on Self-Managed. The mandatory chapter path uses local fixtures and a separate synthetic restore target, so it requires no paid tier, cloud account, production administrator access, or full GitLab installation. Any live commands are explicitly optional and only for an isolated disposable Self-Managed instance you own.

1. The practical problem: the Git repository is only one part of GitLab

When you operate GitLab Self-Managed, the platform itself becomes production software under your responsibility. A project can have a healthy Git repository while its database, uploads, CI artifacts, package files, encryption keys, mail delivery, registry, or background workers are unavailable. Conversely, a successful backup command can still leave you unable to restore if the target version, secrets, object storage, or repository-storage names do not match.

Operator rule: “backup completed” is not a recovery claim. A recovery claim requires a separate target, the correct configuration and secrets, restored data, and independent verification of representative resources.

2. Offering boundary: who owns the platform?

Offering Who operates core platform What this chapter means
GitLab.com GitLab operates the SaaS platform. You administer your namespaces/projects, not GitLab servers, PostgreSQL, Gitaly, or instance backups.
GitLab Dedicated GitLab operates a single-tenant managed environment with customer governance choices. Do not apply Self-Managed shell/Rake procedures as though you owned the hosts.
GitLab Self-Managed Your organization operates installation, services, storage, secrets, backup/restore, monitoring, and upgrades. Chapter 30 applies directly.

3. Mental model: application state, durable data, and secret material

GitLab Rails coordinates application state with PostgreSQL; Gitaly serves Git repository storage; Redis supports caching/queues; Sidekiq executes background work; Workhorse handles large transfers; the Container Registry has its own storage lifecycle; and many object types can live locally or in object storage. Installation topology changes where these services run, but not the need to recover them coherently.

Self-Managed state and recovery boundaries
flowchart LR
  U[Users and CI clients] --> W[GitLab web / API]
  W --> R[Rails + Workhorse]
  R --> DB[(PostgreSQL)]
  R --> REDIS[(Redis)]
  R --> G[Gitaly repositories]
  R --> O[Uploads / artifacts / packages / object storage]
  R --> REG[Container Registry]
  R --> S[Sidekiq background jobs]
  CFG[Install-method configuration] --> R
  SEC[Encryption secrets / TLS / SSH keys] --> R
  B[Application backup] --> DB
  B --> G
  B --> O
  C[Separate config + secrets backup] --> CFG
  C --> SEC

The key distinction is that application data and decryption material are deliberately not one backup object. On Linux package installations, for example, gitlab-backup does not include /etc/gitlab/gitlab.rb or /etc/gitlab/gitlab-secrets.json. Losing the encryption secrets can make database values such as protected CI/CD variables or 2FA secrets undecryptable.

4. Installation method changes the administrative interface

Method Primary configuration / admin interface Backup interface
Linux package /etc/gitlab/gitlab.rb, /etc/gitlab/gitlab-secrets.json, gitlab-ctl, gitlab-rake. sudo gitlab-backup create; configuration backed up separately (for example gitlab-ctl backup-etc).
Docker image Mounted configuration volume such as $GITLAB_HOME/config; package tools run inside container. docker exec ... gitlab-backup create; mounted config/secrets remain separate.
Helm chart Helm values plus Kubernetes Secrets/ConfigMaps; Toolbox for Rake/backup utilities. backup-utility in Toolbox; chart-specific object-storage/secrets procedures.
Self-compiled config/gitlab.yml, config/secrets.yml, service manager and Bundler Rake tasks. bundle exec rake gitlab:backup:create; config/secrets separately.

5. Configuration is executable operational intent

Configuration defines the external URL and TLS boundary, repository storages, SMTP, object-storage endpoints/buckets, database and Redis connections, background jobs, Registry, and many feature settings. Treat configuration as reviewed infrastructure code, but never store raw production passwords or encryption keys in a public repository.

# Sanitized inventory fixture: never paste a real production gitlab.rb.
installation_method=linux-package
gitlab_version=19.3.x-ee
external_url=https://gitlab.example.invalid
repository_storages=default
object_store_mode=consolidated
smtp_mode=local-fake-relay
secrets_backup=separate-encrypted-location

6. SMTP, object storage, and repository storage are different failure domains

SMTP affects notifications, password resets, invitations, Service Desk/email features, and operational communication. Current Linux-package documentation supports encrypted settings for SMTP username/password so the cleartext credential does not need to live in gitlab.rb. Test with a local/fake relay in labs; production mail requires certificate verification and sender-domain controls.

Object storage can hold artifacts, uploads, LFS objects, packages, dependency-proxy content, Terraform state, Pages, Secure Files, and other supported objects. GitLab recommends the consolidated connection form for many object types. Repository data is still a separate Gitaly concern. A bucket name therefore does not identify a Git repository, and a Gitaly snapshot does not recover job artifacts.

7. What the application backup does—and does not—mean

The application backup can include PostgreSQL data, repositories, uploads, CI artifacts/logs, LFS, packages, Pages, Terraform state, Secure Files, and Registry data depending on installation/storage configuration. However, on Linux package, Docker, and self-compiled installations, object-storage contents are not captured by the normal backup command. Redis/queued Sidekiq work, global/file hooks, configuration files, TLS/SSH keys, and system files are also outside the application backup.

Restore compatibility is strict: GitLab documents that a backup can be restored only to the exact same GitLab version and type (CE or EE) that created it. The destination must already be a working installation. Repository storage names expected by the database must exist on the target.

8. Health, maintenance, and housekeeping are evidence—not rituals

Read-only health endpoints separate simple process liveness from dependency readiness. /-/health only confirms the application server is responding; /-/readiness?all=1 can include dependent services such as PostgreSQL, Redis, and Gitaly. The broader /health_check endpoint is useful for diagnostics but is not the right load-balancer signal.

Maintenance Mode reduces writes during maintenance but is Premium/Ultimate on Self-Managed. A Free operator can still design safe downtime by preventing writes and stopping relevant services according to the documented procedure. Maintenance Rake tasks such as gitlab:env:info and gitlab:check SANITIZE=true provide structured pre/post evidence.

9. Inspect before changing anything

# OPTIONAL: isolated Linux-package Self-Managed instance only.
sudo gitlab-ctl status
sudo gitlab-rake gitlab:env:info
sudo gitlab-rake gitlab:check SANITIZE=true
curl -fsS http://127.0.0.1/-/health
curl -fsS http://127.0.0.1/-/readiness?all=1

Do not post the complete command output to public issues without reviewing it. Even “sanitized” diagnostics can expose hostnames, topology, versions, or integration metadata.

Knowledge check

Why is a GitLab application backup not enough by itself?

Can a 19.3.1-ee backup be restored directly into 19.3.2-ee?

Does a successful /-/health prove PostgreSQL and Gitaly are healthy?

Is Maintenance Mode part of the mandatory Free path?

Why keep gitlab-secrets.json separate from the database backup?

10. Lesson summary and bridge

You now have the recovery mental model: platform topology, configuration, secrets, durable object classes, and transient services are separate boundaries. Lesson 2 turns that model into a disposable backup/restore workflow with read-before-write evidence.

Primary sources and version notes

These lessons were finalized against current official GitLab documentation on 2026-08-22 and GitLab 19.3. Self-Managed commands and file locations depend on installation method. Re-check the documentation for the exact version, topology, package/chart, and storage architecture before production administration or recovery.

Next lesson

Guided Hands-On Workflow and Core Operations

Inventory configuration and dependencies, create a complete synthetic backup set, restore separately, and verify exact identities.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.