Overview
Gitea is configured through theapp.ini file located in custom/conf/app.ini. You can also use environment variables to override configuration values.
Configuration File Location
The configuration file path is determined by the following hierarchy:--configflag passed to the binary- Built-in value set at build time
- Default:
{CustomPath}/conf/app.ini
General Settings
Application Settings
string
default:"Gitea: Git with a cup of tea"
Application name shown in page titles
string
default:"git"
Operating system user that runs Gitea. Automatically detected if not set.
string
default:"prod"
Application run mode:
dev or prod. Dev mode provides easier debugging.string
Working directory for Gitea. Defaults to the directory containing the binary.
Server Configuration
All server settings are configured in the[server] section.
Protocol and Domain
string
default:"http"
Protocol the server listens on:
http, https, http+unix, fcgi, or fcgi+unixstring
default:"localhost"
Domain name of the server
string
Public URL of the Gitea instance. Defaults to
{PROTOCOL}://{DOMAIN}:{HTTP_PORT}/string
default:"0.0.0.0"
HTTP listen address. Can be an IPv4/IPv6 address or Unix socket path.
string
default:"3000"
HTTP listen port
SSH Configuration
boolean
default:"false"
Disable SSH feature when not available
boolean
default:"false"
Use built-in SSH server instead of system SSH
string
Domain name exposed in clone URLs. Defaults to DOMAIN or ROOT_URL domain.
number
default:"22"
SSH port exposed in clone URLs
number
Port the built-in SSH server listens on. Defaults to SSH_PORT.
TLS Configuration
boolean
default:"false"
Enable automatic TLS certificate generation via ACME (Let’s Encrypt)
string
default:"https/cert.pem"
Path to TLS certificate file (manual TLS only)
string
default:"https/key.pem"
Path to TLS key file (manual TLS only)
Storage Configuration
string
default:"data"
Default path for storing application data
string
Root directory containing templates and static files
LFS Configuration
boolean
default:"false"
Enable Git LFS support
string
LFS authentication secret. Change this to a random value.
duration
default:"24h"
LFS authentication validity period
number
default:"0"
Maximum allowed LFS file size in bytes (0 = no limit)
Security Configuration
All security settings are in the[security] section.
boolean
default:"false"
Disable the web installer. Set to true after installation.
string
Global secret key for encryption. CRITICAL: Do not lose this key.
string
Secret for internal API communication between Gitea components
string
default:"pbkdf2"
Password hashing algorithm:
pbkdf2, argon2, scrypt, bcryptAdmin Settings
Configure admin-specific behavior in the[admin] section.
boolean
default:"false"
Prevent non-admin users from creating organizations
string
default:"enabled"
Default email notification preference for new users
string
Comma-separated list of disabled features for all users:
deletion- Account deletionmanage_ssh_keys- SSH key managementmanage_gpg_keys- GPG key managementmanage_mfa- Multi-factor authenticationmanage_credentials- Access token managementchange_username- Username changeschange_full_name- Full name changes
string
Additional disabled features for external authentication users (LDAP, OAuth2, etc.)
Environment Variables
You can override any configuration value using environment variables with the format:Examples
Viewing Configuration
To view the current configuration, use:Configuration Validation
After modifyingapp.ini, validate your configuration:
Best Practices
1
Use Version Control
Keep your
app.ini in version control (excluding secrets)2
Externalize Secrets
Use
*_URI options to store secrets in external files:3
Minimal Configuration
Only set values that differ from defaults. Smaller config files are easier to maintain.
4
Test Changes
Always test configuration changes in a non-production environment first