Linux

Where Does Self-Hosted GitLab Store Repositories and Data?

GitLab /var/opt/gitlab data with repositories, uploads and config on Linux.

Last updated

Omnibus GitLab funnels state into /var/opt/gitlab with repositories, uploads, artifacts and the database beneath it, while behavior comes from gitlab.rb. Lose the data tree and every project goes with it.

Backups need the built-in rake task rather than raw copies for consistency. Copy gitlab.rb and gitlab-secrets.json alongside or restores cannot decrypt variables.

Where GitLab stores this, by platform

Linux
/var/opt/gitlab

Holds git-data with every repository plus uploads, artifacts, pages and the database. Config lives at /etc/gitlab/gitlab.rb with secrets in gitlab-secrets.json. Back up with gitlab-backup create and copy both config files; raw disk copies of the database corrupt.

Frequently asked questions

How do I back up self-hosted GitLab?

Run the built-in backup task, which archives repositories plus the database, then copy gitlab.rb and gitlab-secrets.json. Restore on a matching GitLab version only.

Where are GitLab repositories?

Bare repos under git-data/repositories inside the path above, hashed by project. Browse them through the UI, never by hand.

Notice an outdated path? Let us know.