Linux

Where Does GitLab Store Config and Repos?

GitLab Omnibus config lives in /etc/gitlab with secrets beside it, while repos and data sit under /var/opt/gitlab. Reconfigure after every edit.

Last updated

Omnibus GitLab splits config from data cleanly. The single gitlab.rb file plus secrets in /etc/gitlab drive everything, applied by reconfigure runs. Repositories, uploads, artifacts, and the database live under the gitlab data tree on the data disk.

Secrets are the sharp edge: losing gitlab-secrets.json orients a perfect repo backup into an unreadable one, since tokens and two-factor data decrypt only with it. Keep config and secrets together in every backup set. Small instances fit on one disk; large ones mount the data tree separately from day one.

Where GitLab Omnibus stores this, by platform

Linux
/etc/gitlab/gitlab.rb

Config plus secrets here; repos and uploads under the data tree. Always reconfigure after edits. Back up secrets with config or restores decrypt nothing.

Frequently asked questions

What must I back up for disaster recovery?

Copy /etc/gitlab plus the gitlab-secrets file to safety; without secrets, restores decrypt nothing. Repos follow under the git data path. Test restores on a spare machine yearly, since untested backups fail exactly when needed.

I edited gitlab.rb but nothing changed. Why?

Run gitlab-ctl reconfigure after each edit so Chef applies it. Edits without reconfigure sit inert, which confuses first-time admins. Check gitlab-ctl status afterward; a failed run names the offending setting.

Notice an outdated path? Let us know.