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
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
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@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
AKIAIOSFODNN7EXAMPLE
AGENT_EVALS_S3_BUCKET
The Amazon S3 bucket for running agent evals.
Type | string |
Required | Optional |
Default | null |
Examples
retool-agent-evals
AGENT_EVALS_S3_REGION
The Amazon S3 region for running agent evals.
Type | string |
Required | Optional |
Default | null |
Examples
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
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
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
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
300
AZURE_REPOS_MAIN_BRANCH
The main branch for the Azure Repos repository.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
main
AZURE_REPOS_ORGANIZATION
The Azure DevOps organization name.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
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
mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
AZURE_REPOS_REPO
The Azure DevOps repository name.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
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
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
https://retool.example.com
BITBUCKET_APP_PASSWORD
The app password for the Bitbucket user.
Type | string |
Format | Password |
Required | Optional |
Default | null |
Examples
mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
BITBUCKET_MAIN_BRANCH
The main branch for the Bitbucket repository.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
main
BITBUCKET_REPO
The Bitbucket repository name.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
my-repo
Examples
retool
BITBUCKET_WORKSPACE
The Bitbucket workspace name.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
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
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
40M
8096K
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
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
AKIAIOSFODNN7EXAMPLE
CODE_COMMIT_AWS_DEFAULT_REGION
The AWS region for the CodeCommit repository.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
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
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
mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa
CODE_COMMIT_HTTPS_USERNAME
The username for HTTPS authentication with the CodeCommit repository.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
retool
CODE_COMMIT_MAIN_BRANCH
The main branch for the CodeCommit repository.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
main
CODE_COMMIT_REPOSITORY_NAME
The CodeCommit repository name.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
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.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
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.
Type | boolean |
Required | Optional |
Default | true |
Examples
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
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
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
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
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
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
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
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
true
CUSTOM_OAUTH2_SSO_USERINFO_URL
The endpoint for Retool to make an additional request for a fat token containing all available claims from your OpenID SSO provider.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
https://yourcompany.okta.com/oauth2/v1/userinfo
CUSTOM_RETOOL_SANDBOX_RESTRICTIONS
The JavaScript sandbox restrictions to allow. Specify space-separated values for multiple restrictions. Only configure custom sandbox restrictions if you are comfortable with the security implications.
Type | string |
Required | Optional |
Default | null |
Examples
allow-downloads
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 |
Required | Optional |
Default | 0 |
Examples
1000
DBCONNECTOR_NUM_WORKERS
The number of worker threads for the db-connector
container. The default value is Math.min(Math.max(1, numCPUs), 3)
, where numCPUs
is the number of logical CPU cores on the machine determined by Node.js.
Type | number |
Format | Integer |
Required | Optional |
Default | 0 |
Examples
4
DBCONNECTOR_POSTGRES_POOL_MAX_SIZE
The PostgreSQL connection pool maximum size.
Type | number |
Format | Integer |
Required | Optional |
Default | 10 |
Examples
20
DBCONNECTOR_QUERY_TIMEOUT_MS
The duration, in milliseconds, for queries to run before timing out. If your Retool deployment is behind a load balancer, increase the load balancer's timeout by a proportionate amount.
Type | number |
Required | Optional |
Default | 120000 |
Units | ms |
Examples
120000
DEBUG
Whether to enable verbose logging for debugging purposes.
Type | boolean |
Required | Optional |
Default | false |
Examples
true
DEFAULT_GROUP_FOR_DOMAINS
The default Retool user group for a Google SSO domain. Default groups only apply to new users who sign up using SSO, not existing users signing in.
Type | string |
Format | Plain Text |
Required | Optional |
Default | null |
Examples
example1.org -> admin, example2.com -> viewer
DISABLE_AUDIT_TRAILS_LOGGING
Whether to disable logging of audit trails.
Type | boolean |
Required | Optional |
Default | false |
Examples
true
DISABLE_FORWARDABLE_COOKIE_DECODING
Whether to disable decoding of forwardable cookies.
Type | boolean |
Required | Optional |
Default | false |
Examples
true
Examples
true
DISABLE_IMAGE_PROXY
Whether to disable the proxy used for publicly embedded apps.
Type | boolean |
Required | Optional |
Default | false |
Examples
true
DISABLE_INTERCOM
Disable Retool's support widget in the frontend. Refer to the Retool Support page to learn how to contact Retool.
Type | boolean |
Required | Optional |
Default | false |
Examples
true
DISABLE_IPTABLES_SECURITY_CONFIGURATION
Whether to disable the default security configuration for link-local address, which is done by running the following startup commands requiring elevated privileges. Set to true
if privileged access (e.g NET_ADMIN) cannot be given to the container running Code executor service.
Type | boolean |
Required | Optional |
Default | false |
Examples
false
DISABLE_MEMORY_AND_CPU_USAGE_LOGGING
Whether to disable logging of memory and CPU usage.
Type | boolean |
Required | Optional |
Default | false |
Examples
true