Environment Variables
Environment variables play a crucial role in configuring different aspects of your Appsmith instance, such as authentication, logging levels, email settings, and more. These variables are available in a configuration file located in your Appsmith installation directory. For example, if you’ve installed Appsmith using Docker, you’ll find the docker.env file under <Appsmith_Installation_Directory>/stacks/configuration. This page provides a detailed description of each environment variable, along with its purpose and usage.
Settings configured using Environment Variables take precedence over those set through the Admin Settings UI.
Admin email
The following environment variable is used to set up instance administrator for your Appsmith instance.
APPSMITH_ADMIN_EMAILS
Specify the email addresses of users who will have Instance Administrator privileges. These administrators have full control over all instance settings. To assign more than one user as Instance Administrator, separate their email addresses with commas. For example: admin@techcorp.com, supportadmin@techcorp.com. This grants Instance Administrator access to both users. For more information about Instance Administrator permissions, see the Instance Administrator Role.
OIDC OAuth
The following environment variables help in configuring OAuth 2.0 authentication with your OIDC provider, enabling seamless login experiences and allowing Appsmith applications to authenticate users with their existing OIDC credentials. For provider-specific configuration instructions, see OpenID Connect SSO.
APPSMITH_OAUTH2_OIDC_CLIENT_ID
This variable represents your OIDC OAuth 2.0 Client ID used for authenticating users via the OIDC provider. It's a public identifier for your application. Get your OIDC OAuth 2.0 Client ID by registering your Appsmith instance with your provider and setting it as the variable's value.
APPSMITH_OAUTH2_OIDC_CLIENT_SECRET
This variable, in conjunction with the OIDC Client ID, holds the secret key provided by your OIDC provider to authenticate your application's requests securely. Set this variable with the Client Secret provided by your provider upon creating your OIDC application. Ensure that you store it securely and do not expose it publicly.
APPSMITH_OAUTH2_OIDC_AUTHORIZATION_URI
Specifies the endpoint where Appsmith redirects users to authenticate with your OIDC provider. Set this variable to the authorization_endpoint value from your provider's OIDC discovery document.
APPSMITH_OAUTH2_OIDC_TOKEN_URI
Specifies the endpoint Appsmith uses to exchange an authorization code for tokens. Set this variable to the token_endpoint value from your provider's OIDC discovery document.
APPSMITH_OAUTH2_OIDC_JWK_SET_URI
Specifies the endpoint that provides your OIDC provider's JSON Web Key Set (JWKS). Appsmith uses these public keys to verify ID token signatures. Set this variable to the jwks_uri value from your provider's OIDC discovery document.
APPSMITH_OAUTH2_OIDC_USER_INFO
Specifies the endpoint Appsmith uses to retrieve claims about the authenticated user. Set this variable to the userinfo_endpoint value from your provider's OIDC discovery document.
APPSMITH_OAUTH2_OIDC_USERNAME_ATTRIBUTE
Specifies the name of the claim that contains the user's email address. Set this variable to the claim exposed by your OIDC provider, typically email.
APPSMITH_OAUTH2_OIDC_SCOPE
Specifies the comma-separated list of OIDC scopes Appsmith requests during authentication. Include the required openid and email scopes. You can also include profile and other scopes supported by your provider. For example, openid,email,profile.
Google OAuth
The following environment variables help in configuring OAuth 2.0 authentication with Google, enabling seamless login experiences and allowing Appsmith applications to authenticate users with their existing Google credentials.
APPSMITH_OAUTH2_GOOGLE_CLIENT_ID
This variable stores the Client ID provided by Google during OAuth 2.0 configuration. It's unique to your application, identifying you during the authentication process with Google's servers. Set this variable to the Google OAuth 2.0 Client ID available in your Google Cloud Platform console under the credentials section for your project.
APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET
This variable holds the Client Secret provided by Google for OAuth 2.0. The secret is confidential and used in server-to-server communications. Assign this variable with the Google OAuth 2.0 Client Secret obtained from the Google Cloud Platform console where you configured your OAuth credentials.
GitHub OAuth
The following environment variables help in configuring OAuth 2.0 authentication with GitHub, enabling seamless login experiences and allowing Appsmith applications to authenticate users with their existing GitHub credentials.
APPSMITH_OAUTH2_GITHUB_CLIENT_ID
This variable represents the GitHub OAuth 2.0 Client ID used for authenticating users via GitHub. It's a public identifier for your application. Get your GitHub OAuth 2.0 Client ID by registering your Appsmith instance as a GitHub OAuth application and setting it as the variable's value.
APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET
This variable, in conjunction with the Client ID, holds the secret key provided by GitHub OAuth 2.0 to authenticate your application's requests securely. Set this variable with the Client Secret provided by GitHub upon creating your OAuth application. Ensure that you store it securely and do not expose it publicly.
SAML
The following environment variable selects how Appsmith signs users in with SAML. For setup instructions, see SAML SSO.
APPSMITH_SAML_ENGINE
Set this to native to sign users in with native SAML, built into the Appsmith server. Leave it unset, or set it to keycloak, to use the bundled Keycloak broker. Keycloak is the default. The value isn't case-sensitive, and any other value means Keycloak. Restart Appsmith after you change it.
Available from v2.7. For the steps, readiness checks, and rollback, see Native SAML migration.
APPSMITH_SAML_ENGINE=native
Signup
With Appsmith, you can manage and control who can create accounts on the platform.
APPSMITH_SIGNUP_DISABLED
Set to true to disable signup and prevent new user account creation. This is useful when you want to restrict access to your Appsmith instance, allowing only users who have been specifically invited to join. The signup page continues to show up but throws an error when a user tries to sign up. This environment variable's value does not affect the login behavior of existing users. When set:
- New, uninvited users cannot sign up using the signup form or the OAuth buttons. Both modes of signing up are not allowed.
- New, invited users can still signup using either the form or the OAuth buttons.
This configuration doesn't impact the sign-up of instance administrators, set using APPSMITH_ADMIN_EMAILS environment variables.
APPSMITH_SIGNUP_ALLOWED_DOMAINS
Set to restrict signups to emails belonging to only a specific set of domains. This field takes a comma-separated set of values. For example, setting appsmith.com,gmail.com in the variable allows users belonging to appsmith.com and gmail.com domains only to Sign up on Appsmith, restricting all other domains.
APPSMITH_SIGNUP_ALLOWED_DOMAINS=appsmith.com,gmail.com
This environment variable's value does not affect the login behavior of existing users. When set to one or more domains:
- New, uninvited users cannot sign up using the signup form or the OAuth buttons unless the email they use has a domain that's present in this environment variable.
- New, but invited users can still signup using the signup form or the OAuth buttons, even if their email does not have a domain in the environment variable.
This configuration doesn't impact the sign-up of instance administrators, set using APPSMITH_ADMIN_EMAILS environment variables.
Form Login
With Appsmith, you can manage user access and authentication methods in your instance. This helps streamline logins.
APPSMITH_FORM_LOGIN_DISABLED
Set to true to turn off the default username and password login when the instance is first configured. Useful for administrators who want to enforce Single Sign-On (SSO) or limit authentication methods for added security and control.
Changing this variable after that initial setup does not update form login behavior in a running instance. To change form login afterward, use appsmithctl enable-form-login (alias appsmithctl efl) or toggle Form Login under Admin Settings → User Management, as described in User Management.
Security
Configure security settings to protect your Appsmith instance against account takeover attacks and ensure secure authentication flows.
APPSMITH_BASE_URL
Specifies the base URL of your Appsmith instance. When configured, this variable enables Origin header validation for password reset and email verification requests, preventing account takeover attacks.
When APPSMITH_BASE_URL is set, the system validates that the Origin header in password reset and email verification requests matches the configured base URL. Requests with mismatched origins are rejected, preventing attackers from:
- Using arbitrary Origin headers to redirect reset links to malicious domains
- Exploiting the password reset flow to send tokens to attacker-controlled endpoints
- Performing account takeover attacks through email verification redirects
Configuration:
You can configure this variable either:
- Via Admin Settings UI: Navigate to Settings → Configuration → Appsmith Base URL
- Via environment variable: Set the
APPSMITH_BASE_URLenvironment variable in your configuration file
Example:
APPSMITH_BASE_URL=https://appsmith.yourdomain.com
Backward compatibility:
If APPSMITH_BASE_URL is not set, the system maintains backward compatibility by skipping validation, ensuring existing deployments continue to function without changes. However, it is strongly recommended to set this variable to enable protection against account takeover attempts.
Recommendation:
We strongly recommend setting APPSMITH_BASE_URL in your environment configuration to enable this protection. This ensures that sensitive authentication flows are restricted to your trusted domain, significantly reducing the attack surface for account takeover attempts.
APPSMITH_RATE_LIMIT
Defines the maximum number of requests each client can make to the Appsmith backend per second. The default value is 100, which helps guard the platform against abusive traffic while keeping normal usage unaffected. Set this variable to any positive integer to adjust the cap based on your infrastructure capacity, or set it to disabled to turn rate limiting off entirely.
# Increase the limit
APPSMITH_RATE_LIMIT=250
# Disable rate limiting
APPSMITH_RATE_LIMIT=disabled
Email server
Configure your email server in Appsmith to handle application emailing needs. The following environment variables enable you to set up and manage these email-related capabilities for your Appsmith instance.
APPSMITH_EMAIL_ENABLED
Controls whether Appsmith can send emails. Use true to enable email capabilities or false to disable it.
APPSMITH_EMAIL_SERVER_HOST
Specifies the host address of the email server that Appsmith will use to send emails. This is part of the SMTP server configuration necessary for email delivery. Set this variable to the fully qualified domain name or IP address of your email server.
APPSMITH_EMAIL_SERVER_PORT
Indicates the port number on which the email server is listening. Different services use different ports; for example, port 25 for non-encrypted transport, 587 for submission with StartTLS, and 465 for SMTPS (deprecated). Select the appropriate port that corresponds to your email server's setup and protocols.
APPSMITH_EMAIL_SERVER_USERNAME
Used to authenticate with the email server and allows logging into your SMTP server. Provide the username configured at your email server for sending emails.
APPSMITH_EMAIL_SERVER_PASSWORD
The password corresponds to the username for the SMTP server. You must protect the secret as it grants access to your email-sending capabilities. Enter the password associated with your APPSMITH_EMAIL_SERVER_USERNAME to authenticate with the email server.
APPSMITH_EMAIL_FROM_ADDRESS
This is the email address displayed in the From field of the emails sent through Appsmith, essentially representing who the email is from. Set this to a valid email address that recipients of your emails can recognize and associate with.
APPSMITH_EMAIL_REPLY_TO_ADDRESS
The ReplyTo address is the email displayed in the response field of Appsmith emails, indicating where replies will be sent. Set this to a valid email address that recipients can recognize and associate with the response destination.
APPSMITH_SMTP_AUTH_ENABLED
Defines to use of SMTP authentication when sending emails. Set it to true to authenticate your emails by the server, reducing the likelihood of them being marked as spam.
APPSMITH_MAIL_SMTP_TLS_ENABLED
Determines whether the email server connection uses Transport Layer Security (TLS) for enhanced security, protecting email contents and credentials. Set to true to enable TLS.
External Database
Appsmith can connect to external providers for MongoDB and Redis. The associated environment variables ensure that Appsmith establishes a connection to external hosting rather than using the embedded MongoDB or Redis servers.
APPSMITH_DB_URL
Appsmith uses this variable to connect to an external MongoDB instance. Set it to the full MongoDB URI supplied by the hosting service. This enables Appsmith to store data in your MongoDB database, ensuring control and ownership of the application data.
APPSMITH_DB_URL=mongodb+srv://<USERNAME>:<PASSWORD>@<MONGO.HOST.NAME>/<DATABASENAME>
If your password or username contains special characters, URL encode them. For example, the password Something@123 is URL encoded as Something%40123, as shown below:
APPSMITH_DB_URL=mongodb://appsmithadmin:Something%40123@1.3.4.5:27017/appsmith?retryWrites=true
For more information about how to URL encode your username and password, see Encode to URL-encoded format.
APPSMITH_ENCRYPTION_PASSWORD
The encryption password is critical for safeguarding your datasource credentials through encryption. Select a strong password that exhibits a good level of entropy to prevent easy decryption.
APPSMITH_ENCRYPTION_SALT
The encryption salt contributes to the security strategy by adding a layer of complexity during the encryption process. This long, unique string enhances encryption strength, making it more resistant to attacks such as brute-force attempts.
APPSMITH_KEYCLOAK_DB_URL
Specifies the URL for the external PostgreSQL database (for example, an RDS instance) used by Keycloak. The connection string must be in the format: postgres://<username>:<password>@<hostname>:<port>/<database_name>
APPSMITH_KEYCLOAK_DB_DRIVER
Defines which database Keycloak uses. Accepted values:
postgresql: the external PostgreSQL database inAPPSMITH_KEYCLOAK_DB_URL.h2: the embedded H2 database in/appsmith-stacks/data/keycloak.
When this variable is not set, Keycloak uses postgresql if APPSMITH_KEYCLOAK_DB_URL is set, and h2 otherwise.
Keycloak data does not move between the two databases. If your Keycloak data is in H2 and you set APPSMITH_KEYCLOAK_DB_URL, set this variable to h2 to keep using it. See SAML SSO login returns 502 after upgrading to v2.4 or later.
APPSMITH_REDIS_URL
Appsmith uses this variable to establish a link to an external Redis server, which Appsmith uses for session handling and caching operations. The connection string includes the Redis host, port number, and authentication credentials, for example redis://:<password>@<host>:<port>. Always include credentials for external or cloud-managed Redis, and use the rediss:// scheme when encryption in transit is enabled. See Enable authentication. MCP Server also uses this Redis instance to share MCP sessions across replicas. See Run MCP Server on more than one replica.
Custom domain
If you prefer to host your Appsmith instance on a personalized domain, you can do so by setting up a custom domain. Appsmith also provisions an SSL certificate through Let’s Encrypt, securing your application with HTTPS.
APPSMITH_CUSTOM_DOMAIN
Set this variable to your custom domain hostname only (for example, apps.example.com)—do not include http://, https://, a port, a path, or a trailing slash. If the value starts with http:// or https://, Appsmith ignores it and runs without a custom domain; see Custom domain is ignored or Save is disabled in Instance settings. For more information about how to set up Custom domain and SSL Certificate, see Custom Domain and SSL guide.
Telemetry
Monitoring the performance of your Appsmith instance is crucial for making informed decisions about feature improvements and resource allocation. For capacity planning guidance, see Infrastructure and capacity planning.
APPSMITH_DISABLE_TELEMETRY
Telemetry allows Appsmith to collect anonymous usage data to improve the product and provide a better user experience.
You can configure this environment variable to enable or disable anonymous usage data collection. By default, telemetry is enabled. To disable it, set this variable to true. For more details, see Appsmith Telemetry.
//To ENABLE telemetry (default behavior)
APPSMITH_DISABLE_TELEMETRY=false
//To DISABLE telemetry
APPSMITH_DISABLE_TELEMETRY=true
Embed Appsmith
Embedding your Appsmith apps on external websites can expose them to clickjacking attacks. To mitigate this, Appsmith uses the Content-Security-Policy header with the frame-ancestors directive. For more details, refer to the frame-ancestors documentation.
Starting from Appsmith v1.7.10, apps are restricted from being loaded in a frame or iframe on domains other than the app's own domain. For instance, if your Appsmith instance is hosted at http://mydomain.com, only pages on http://mydomain.com can embed its apps.
You can configure or customize this behavior by using below environment variable:
APPSMITH_ALLOWED_FRAME_ANCESTORS
This variable allows you to specify which domains can embed your Appsmith apps in a frame or iframe. Below are some examples:
-
Specific domain: To allow a specific domain, such as
http://trusted-other.com, use:APPSMITH_ALLOWED_FRAME_ANCESTORS="'self' http://trusted-other.com" -
Multiple domains: To allow multiple domains, separate them with spaces:
APPSMITH_ALLOWED_FRAME_ANCESTORS="'self' http://trusted-other.com http://another-trusted.com" -
Subdomains: To allow all subdomains under
trusted-other.com, use:APPSMITH_ALLOWED_FRAME_ANCESTORS="'self' http://*.trusted-other.com"
The value must be a list of CSP frame-ancestors sources separated by spaces. Each item must be one of the following:
'self': the Appsmith instance's own origin.*: any site.- A scheme source, such as
https:. - A host source, such as
trusted-other.comorhttps://trusted-other.com. A host source can start with a scheme, use a*.wildcard as its first label (https://*.trusted-other.com), and end with a port (:8443, or:*for any port) and a path (https://trusted-other.com/apps/).
To block embedding everywhere, set the value to 'none' with no other items. Leave the variable empty to allow only 'self'.
From Appsmith v2.7.1, Appsmith ignores a value in any other form and allows only 'self'. After a restart, the container log shows:
APPSMITH_ALLOWED_FRAME_ANCESTORS is not a list of CSP frame-ancestors sources. Using 'self'.
Commas, semicolons, tabs, line breaks, query strings, and non-ASCII characters all make the value invalid, and so does 'none' combined with other items. Rewrite such values as shown below, then restart Appsmith.
| Not accepted | Use instead |
|---|---|
https://trusted-other.com,https://another-trusted.com | https://trusted-other.com https://another-trusted.com |
https://trusted-other.com; https://another-trusted.com | https://trusted-other.com https://another-trusted.com |
https://trusted-other.com/?team=ops | https://trusted-other.com/ |
'none' https://trusted-other.com | 'none' or https://trusted-other.com |
For more information about embedding Appsmith, see the Embed Appsmith guide.
Git Local File Path
Appsmith clones Git repositories to the local file system, which is attached to the persistent volume within the Docker container. To ensure the repositories are maintained across restarts, you need to specify a file path that points to the volume within the Docker container. When using the in-memory Git feature, Appsmith instead uses a RAM-backed path for Git operations while still relying on this variable to determine where repositories are checked out.