Storage database environment variables
Reference documentation of environment variables for the postgres service and database.
Storage database environment variables available for use with self-hosted Retool deployments.
Only configure environment variables when needed. You can configure many environment variables from your organization's Settings rather than directly editing your deployment's configuration file.
Environment variables take effect only once the change is applied to your deployment, and where you set them depends on how Retool was deployed.
- Terraform blueprints. Set the variable in
retool_helm_extra_valuesinmain.tf, then runterraform apply. Editing Helm values directly on a blueprint-managed instance is overwritten by the next apply. - Helm. Set the variable in your
values.yaml, then runhelm upgrade. That command restarts the affected pods as part of applying the new values, so restarting pods without re-running it doesn't pick up the change. - Docker Compose. Set the variable in
docker.env, then runsudo docker compose up -d.
DATABASE_MIGRATIONS_TIMEOUT_SECONDS
The timeout, in seconds, for database migrations. If the migration takes longer than this time, the migration fails. Consider setting a higher value if you're upgrading to another major version of Self-hosted Retool or the upgrade includes changes from multiple minor versions.
| Type | number |
| Format | Integer |
| Configurability | Update the deployment's configuration file. |
| Required | Optional |
| Default | 0 |
Examples
DATABASE_MIGRATIONS_TIMEOUT_SECONDS=1000
ENCRYPTION_KEY
The encryption key used to encrypt data stored in the PostgreSQL database (e.g., database credentials, SSH keys, etc). Must contain only ASCII characters (required from version 3.332.4). If your key contains non-ASCII characters, rotate it before upgrading. If you change this key without rotating, you will lose access to all resources created before the change.
| Type | string |
| Format | Plain Text |
| Configurability | Update the deployment's configuration file. |
| Required | Optional |
| Default | null |
Examples
ENCRYPTION_KEY=key