Linux

Where Does Gitea Store Repositories and Data?

On Linux binary and package installs Gitea keeps configuration in /etc/gitea and working data under /var/lib/gitea. Repositories, attachments, LFS objects, and the SQLite database live under the data tree when SQLite is used.

Last updated

Gitea separates configuration from working data. The main config file defines the repository root, database connection, log paths, and storage locations. Defaults place working data under /var/lib/gitea.

Repository files are plain Git repositories on disk with extra Gitea metadata. The database location depends on the database type. SQLite uses a local file. MySQL and PostgreSQL store data outside the Gitea file tree.

Where Gitea stores this, by platform

Linux
/etc/gitea/app.ini

Main configuration file. Defines database settings under the database section, repository root under the repository section, and paths for logs and data. Permissions are commonly root:git with mode 640 after install. Check this file first to confirm custom WORK_PATH or database type.

Linux
/var/lib/gitea/data/gitea-repositories

Default repository root for binary installs. Each repository is a folder ending in .git with hooks, objects, and refs. Location can differ if repository ROOT is customized in app.ini. Confirm the configured value before backup.

Linux
/var/lib/gitea/data

Application data root. Holds the default SQLite database file gitea.db when SQLite is selected, plus attachments, avatars, LFS storage, sessions, and repo archives in subfolders. Custom templates live under /var/lib/gitea/custom and logs under /var/lib/gitea/log.

Frequently asked questions

How do I tell if Gitea uses SQLite or an external database?

Open /etc/gitea/app.ini and read the database section. DB_TYPE shows sqlite3, mysql, or postgres. Only sqlite3 keeps the main database as a file under the data folder.

What should I back up for a full Gitea restore?

Back up app.ini, the repository root, the data folder, and a database dump when MySQL or PostgreSQL is used. A file copy of a running SQLite database can be inconsistent, so stop Gitea or use the dump and backup commands first.

Notice an outdated path? Let us know.