Environment variables reference
Environment variables for self-hosted Retool deployments.
Environment variables control or override certain functions and characteristics of self-hosted Retool instances. Some Retool features require you to set environment variables, such as SSO or Source Control.
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.
You must restart your instance after setting any variables for them to take effect.
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
ADMIN_API_ACCESS_TOKEN
If non-empty, Retool creates an API access token with the provided string value. Requires ADMIN_USER_EMAIL to be set to a valid email address of an admin user.
| Type | string |
| Format | Authentication Key |
| Required | Optional |
| Default | null |
Examples
ADMIN_API_ACCESS_TOKEN=api-key
ADMIN_API_ACCESS_TOKEN_SCOPES
Comma-separated list of scopes to be assigned to the API access token created using ADMIN_API_ACCESS_TOKEN environment variable.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
ADMIN_API_ACCESS_TOKEN_SCOPES=source_control:read,source_control:write,groups:read,groups:write,spaces:read,spaces:write,folders:read,folders:write,permissions:all:read,permissions:all:write
ADMIN_USER_EMAIL
If non-empty, Retool creates an admin user with the provided email in the Admin Space.
| Type | string |
| Format | Email Address |
| Required | Optional |
| Default | null |
Examples
ADMIN_USER_EMAIL=admin@example.com
AGENT_EVALS_S3_ACCESS_KEY_ID
The Amazon S3 access key ID for running agent evals.
| Type | string |
| Required | Optional |
| Default | null |
Examples
AGENT_EVALS_S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
AGENT_EVALS_S3_BUCKET
The Amazon S3 bucket for running agent evals.
| Type | string |
| Required | Optional |
| Default | null |
Examples
AGENT_EVALS_S3_BUCKET=retool-agent-evals
AGENT_EVALS_S3_REGION
The Amazon S3 region for running agent evals.
| Type | string |
| Required | Optional |
| Default | null |
Examples
AGENT_EVALS_S3_REGION=us-west-2
AGENT_EVALS_S3_SECRET_ACCESS_KEY
The Amazon S3 secret access key for running agent evals.
| Type | string |
| Required | Optional |
| Default | null |
Examples
AGENT_EVALS_S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AGENT_SANDBOX_POSTGRES_POOL_MAX
Maximum number of PostgreSQL connections in the Agent Sandbox connection pool. Also accepted as AGENT_EXECUTOR_POSTGRES_POOL_MAX for backward compatibility.
| Type | string |
| Required | Optional |
| Default | 10 |
Examples
AGENT_SANDBOX_POSTGRES_POOL_MAX=10
AGENT_SANDBOX_POSTGRES_SCHEMA
PostgreSQL schema used by the Agent Sandbox state store. Also accepted as AGENT_EXECUTOR_POSTGRES_SCHEMA for backward compatibility.
| Type | string |
| Required | Optional |
| Default | agent_executor |
Examples
AGENT_SANDBOX_POSTGRES_SCHEMA=agent_executor
AGENT_SANDBOX_POSTGRES_URL
PostgreSQL connection URL for Agent Sandbox state storage. Set STATE_BACKEND=postgres on the controller and proxy to use Postgres instead of the default Redis backend. Also accepted as AGENT_EXECUTOR_POSTGRES_URL for backward compatibility.
| Type | string |
| Required | Optional |
| Default | null |
Examples
AGENT_SANDBOX_POSTGRES_URL=postgresql://user:password@host:5432/dbname
ALLOW_SAME_ORIGIN_OPTION
Whether to use allow-same-origin for iframes and custom components. If this is not true, custom components are heavily restricted in their behavior. Refer to the configure same-origin and sandbox guide to learn more.
| Type | boolean |
| Format | True/False |
| Required | Optional |
| Default | false |
Examples
ALLOW_SAME_ORIGIN_OPTION=false
API_CALLS_PER_MINUTE
Retool API uses a point system for rate limiting where endpoint requests cost a certain number of points. The default is 300 points in a 60 second window. If you exceed this, Retool blocks any subsequent API calls for 60 seconds. You can increase the number of points with the API_CALLS_PER_MIN environment variable.
| Type | number |
| Format | Integer |
| Required | Optional |
| Default | 300 |
Examples
API_CALLS_PER_MINUTE=300
AZURE_REPOS_MAIN_BRANCH
The main branch for the Azure Repos repository.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
AZURE_REPOS_MAIN_BRANCH=main
AZURE_REPOS_ORGANIZATION
The Azure DevOps organization name.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
AZURE_REPOS_ORGANIZATION=my-organization
AZURE_REPOS_PERSONAL_ACCESS_TOKEN
The personal access token for the Azure DevOps organization user.
| Type | string |
| Format | Authentication Key |
| Required | Optional |
| Default | null |
Examples
AZURE_REPOS_PERSONAL_ACCESS_TOKEN=mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
AZURE_REPOS_REPO
The Azure DevOps repository name.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
AZURE_REPOS_REPO=my-repo
AZURE_REPOS_USER
The username or service account for the for Azure DevOps organization.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
AZURE_REPOS_USER=retool
BASE_DOMAIN
The full URL of your Retool deployment for user invitations and password resets. This also needs to be set if you dynamically set callback URLs on protected resources.
| Type | string |
| Format | URL |
| Required | Required |
| Default | null |
Examples
BASE_DOMAIN=https://retool.example.com
BITBUCKET_APP_PASSWORD
The app password for the Bitbucket user.
| Type | string |
| Format | Password |
| Required | Optional |
| Default | null |
Examples
BITBUCKET_APP_PASSWORD=mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
BITBUCKET_MAIN_BRANCH
The main branch for the Bitbucket repository.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
BITBUCKET_MAIN_BRANCH=main
BITBUCKET_REPO
The Bitbucket repository name.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
BITBUCKET_REPO=my-repo
Examples
BITBUCKET_USER=retool
BITBUCKET_WORKSPACE
The Bitbucket workspace name.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
BITBUCKET_WORKSPACE=my-workspace
CLIENT_ID
A Google OAuth client app ID for OAuth-based authentication with Google (e.g., Google SSO with OIDC or using a Google Sheets resource).
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CLIENT_ID=123456789012-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com
CLIENT_MAX_BODY_SIZE
On the https-portal container, specify the maximum request body size, in bytes, megabytes (M), or kilobytes (K). Any upload that exceeds this limit results in a 413 HTTP error. Set to 0 to allow bodies of any size.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CLIENT_MAX_BODY_SIZE=40M
CLIENT_MAX_BODY_SIZE=8096K
CLIENT_MAX_BODY_SIZE=1048576
CLIENT_SECRET
A Google OAuth client app secret for OAuth-based authentication with Google (e.g., Google SSO with OIDC or using a Google Sheets resource).
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CLIENT_SECRET=abcdefghijklmnopqrstuvwxyz
CODE_COMMIT_AWS_ACCESS_KEY_ID
The AWS access key ID for the IAM user.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
CODE_COMMIT_AWS_DEFAULT_REGION
The AWS region for the CodeCommit repository.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_AWS_DEFAULT_REGION=us-west-2
CODE_COMMIT_AWS_SECRET_ACCESS_KEY
The AWS secret access key for the IAM user.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
CODE_COMMIT_HTTPS_PASSWORD
The password for HTTPS authentication with the CodeCommit repository.
| Type | string |
| Format | Password |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_HTTPS_PASSWORD=mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
CODE_COMMIT_HTTPS_USERNAME
The username for HTTPS authentication with the CodeCommit repository.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_HTTPS_USERNAME=retool
CODE_COMMIT_MAIN_BRANCH
The main branch for the CodeCommit repository.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_MAIN_BRANCH=main
CODE_COMMIT_REPOSITORY_NAME
The CodeCommit repository name.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_COMMIT_REPOSITORY_NAME=my-repo
CODE_EXECUTOR_INGRESS_DOMAIN
The domain for the code-executor service that executes arbitrary user-defined JavaScript and Python code with installed custom libraries. The value depends on your deployment configuration, but must include a protocol (http:// or https://).
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CODE_EXECUTOR_INGRESS_DOMAIN=code-executor.example.com
CONTAINER_UNPRIVILEGED_MODE
Whether to run the code-executor service in an unprivileged mode and remove any sandboxing of user code.
| Type | boolean |
| Required | Optional |
| Default | false |
Examples
CONTAINER_UNPRIVILEGED_MODE=false
COOKIE_INSECURE
Whether to send authentication requests using insecure cookies. Enable this if your Retool deployment uses a non-HTTPS URL or IP address. This is typically used when a Retool deployment is not yet configured with a custom domain. Do not enable this on SAML deployments — SP-initiated SAML logins require HTTPS and will fail when this is set to true.
| Type | boolean |
| Required | Optional |
| Default | true |
Examples
COOKIE_INSECURE=true
CREATE_FIRST_ORG
If set to true, Retool automatically creates the first organization on the instance. This is useful for automated provisioning of Retool instances.
| Type | boolean |
| Required | Optional |
| Default | false |
Examples
CREATE_FIRST_ORG=true
CUSTOM_API_KEY
An API key to authenticate workflow webhook requests. Add to the request as an x-api-key header to trigger workflows.
| Type | string |
| Required | Optional |
| Default | null |
Examples
CUSTOM_API_KEY=retool_wk_2ed0cfe975474f4091fbe603d975d7b7
CUSTOM_LOGOUT_REDIRECT
A URL that users are redirected to after logging out of Retool.
| Type | string |
| Format | URL |
| Required | Optional |
| Default | null |
Examples
CUSTOM_LOGOUT_REDIRECT=https://example.com/logout/success
CUSTOM_OAUTH2_SSO_ACCESS_TOKEN_LIFESPAN_MINUTES
The lifespan, in minutes, of custom OpenID provider tokens.
| Type | number |
| Format | Integer |
| Required | Optional |
| Default | 120 |
Examples
CUSTOM_OAUTH2_SSO_ACCESS_TOKEN_LIFESPAN_MINUTES=60
CUSTOM_OAUTH2_SSO_AUDIENCE
An identifier for a resource to which users should have access upon completion of an OpenID authorization process.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CUSTOM_OAUTH2_SSO_AUDIENCE=https://retool.auth0.com/api/v2
CUSTOM_OAUTH2_SSO_JWT_ROLES_KEY
Returns an array of strings where each string represents an OpenID group name. This setting is used with CUSTOM_OAUTH2_SSO_ROLE_MAPPING to map groups to Retool permission groups.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CUSTOM_OAUTH2_SSO_JWT_ROLES_KEY=idToken.groups
CUSTOM_OAUTH2_SSO_ROLE_MAPPING
The mapping of roles from your OpenID provider to Retool permission groups.
| Type | string |
| Format | Plain Text |
| Required | Optional |
| Default | null |
Examples
CUSTOM_OAUTH2_SSO_ROLE_MAPPING=devops -> admin, support -> viewer
CUSTOM_OAUTH2_SSO_ROLE_MAPPING_DISABLED
Disables the mapping of roles from your OpenID provider to Retool permission groups. Set this variable to true to disable passing roles from JWTs.
| Type | boolean |
| Required | Optional |
| Default | null |
Examples
CUSTOM_OAUTH2_SSO_ROLE_MAPPING_DISABLED=true