Skip to main content
Grafana uses INI-formatted configuration files to define settings. The configuration system provides sensible defaults and allows you to override only the settings you need to change.

Configuration Files

defaults.ini

Location: conf/defaults.ini This file contains all default Grafana settings with documentation. Do not modify this file as it will be overwritten during upgrades.

custom.ini

Location: conf/custom.ini This is your custom configuration file where you override default settings. This file is preserved during upgrades.

Custom Configuration Path

You can specify a custom configuration file path using the --config flag:

INI File Format

Sections

Configuration is organized into sections denoted by [section_name]:

Nested Sections

Some configuration uses nested sections with dot notation:

Comments

Comments start with # or ;:

Value Types

Strings:
Numbers:
Booleans:
Durations:
Supported units: ms (milliseconds), s (seconds), m (minutes), h (hours), d (days), w (weeks), M (months) Special Characters in Values: If your value contains # or ;, wrap it with triple quotes:

Variable Substitution

Grafana supports variable substitution using the ${VAR} syntax:
The %(key)s syntax references other values within the same section.

Key Configuration Sections

Server Configuration

Paths Configuration

Security Configuration

Logging Configuration

Users Configuration

Configuration Validation

Grafana validates configuration on startup. Common validation errors: Invalid INI syntax:
Invalid value type:
Missing required value:
Check the Grafana logs at startup for configuration errors.

Reloading Configuration

Most configuration changes require a Grafana restart:
Some settings (like provisioning) are reloaded automatically without restart.

Best Practices

  1. Start with defaults.ini - Review default settings before customizing
  2. Use comments - Document why you changed a setting
  3. Group related settings - Keep related configuration together
  4. Avoid duplicates - Only specify each setting once
  5. Quote special characters - Use triple quotes for passwords with special chars
  6. Version control custom.ini - Track configuration changes (excluding secrets)
  7. Use environment variables for secrets - Keep sensitive data out of config files

Example Complete Configuration