Configuration
Rivet Engine can be configured through environment variables or configuration files.
Configuration
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:
- Linux:
/etc/rivet/config.json - macOS:
/Library/Application Support/rivet/config.json - Windows:
C:\ProgramData\rivet\config.json
Multiple 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:
Definition
PostgreSQL Configuration
Managed Postgres Compatibility
Some hosted PostgreSQL platforms require additional configuration due to platform-specific restrictions.
Use direct connection (not connection pooler).
For better performance, set deadlock_timeout = 10ms in the PlanetScale dashboard at Clusters → Parameters → Query Tuning.
SSL/TLS Support
To enable SSL for Postgres, add sslmode=require to your PostgreSQL connection URL:
The sslmode parameter controls TLS usage:
disable: Do not use TLSprefer: Use TLS if available, otherwise connect without TLS (default)require: Require TLS connection (fails if TLS is not available)
To verify the server certificate against a CA or verify the hostname, use custom SSL certificates (see below).
Custom SSL Certificates
For databases using custom certificate authorities (e.g., Supabase) or requiring client certificate authentication, you can specify certificate paths in the configuration:
| Parameter | Description | PostgreSQL Equivalent |
|---|---|---|
root_cert_path | Path to the root certificate file for verifying the server's certificate | sslrootcert |
client_cert_path | Path to the client certificate file for client certificate authentication | sslcert |
client_key_path | Path to the client private key file for client certificate authentication | sslkey |
All SSL paths are optional. If not specified, Rivet uses the default system root certificates from Mozilla's root certificate store.
Do Not Use Connection Poolers
Rivet requires direct PostgreSQL connections for session-level features and does not support connection poolers.
Do not use:
- PgBouncer
- Supavisor
- AWS RDS Proxy
Troubleshooting
Permission Denied Errors
If you see errors like:
Add unstable_disable_lock_customization: true to your configuration:
This disables Rivet's attempt to set lock_timeout = 0 and deadlock_timeout = 10ms. Since lock_timeout defaults to 0 in PostgreSQL, skipping these settings is safe. Deadlock detection will use the default 1s timeout instead of 10ms.