website/src/content/docs/self-hosting/configuration.mdx
import EngineConfigSchema from "@/components/docs/EngineConfigSchemaClient.astro";
<Info> The full JSON Schema for the configuration is available at [/docs/engine-config-schema.json](/docs/engine-config-schema.json). </Info>Rivet supports JSON, JSON5, JSONC, YAML, YML, and environment variable configurations.
Environment Variables
Use the RIVET__ prefix with __ as separator to configure properties in the config. For example: set the RIVET__database__postgres__url environment variable for database.postgres.url.
Configuration Paths
Configuration files are automatically discovered in platform-specific directories:
/etc/rivet/config.json/Library/Application Support/rivet/config.jsonC:\ProgramData\rivet\config.jsonMultiple Files
Multiple configuration files in the same directory are loaded and merged together. For example: /etc/rivet/config.json and /etc/rivet/database.json will be merged together.
Override Configuration Path
You can override the default configuration path using the --config flag:
# Load from a specific file
rivet-engine --config /path/to/config.json
# Load from a directory
rivet-engine --config /etc/rivet
# Load multiple paths (merged in order)
rivet-engine --config /etc/rivet/base.json --config /etc/rivet/override.json