Home/Config Files/netlify.toml
Config File Wiki

netlify.toml config guide

Netlify build settings, redirects, headers, plugins, and context-specific deploy config.

Field explanations

  • Top-level settings define the tool behavior
  • Environment-specific blocks override defaults
  • Paths are usually relative to the config file or project root
  • Secrets should be referenced, not committed

Minimal template

[build]
command = "npm run build"

[vars]
APP_ENV = "production"

Common usage patterns

  • Keep netlify.toml small and reviewable
  • Use comments only when the format supports them
  • Commit example files with placeholder values
  • Validate locally before deploying

Common errors

  • Publish directory wrong
  • Redirect syntax invalid
  • Env only set in one context
  • Plugin version conflict

Online validation

Validate syntax first, then compare behavior against your deploy target. For JSON-based configs, use the JSON formatter before debugging tool-specific behavior.

Related tools