Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Nov 10, 2026

Environment variable limits

Review the quantity and size restrictions for environment variables that you set with the Forge CLI variables commands. The following limits apply to each environment of your app:

ResourceLimitDescription
Plain variables50Maximum number of unencrypted variables in an environment.
Encrypted variables (secrets)10Maximum number of variables set with the --encrypt option in an environment.
Variable value size3 KBMaximum size of a single variable value in bytes (3 KB). This limit applies to both plain and encrypted variables, and is measured on the value before it's encrypted.
Variable key length128Maximum number of characters in a variable key.

Plain variables and encrypted variables are counted separately. For example, an environment can have 50 plain variables and 10 encrypted variables at the same time.

Each environment (development, staging, and production) has its own set of variables, so these limits apply to each environment independently.

What happens when you exceed a limit

The limits are checked when you run the forge variables set command and when you run the forge deploy command.

When you set a variable

The limits are checked when you set a variable using the forge variables set command. If the new variable or value would exceed a limit, the command fails with an error, and the variable isn't saved. Errors are returned in the following cases:

  • The key is longer than 128 characters.
  • The value is larger than 3,072 bytes.
  • Adding the variable would exceed the maximum number of plain variables or encrypted variables in the environment.

Updating the value of an existing variable doesn't increase the variable count, but the new value must still be within the size limit. To make room for a new variable, remove one you no longer need with forge variables unset.

When you deploy

When you run forge deploy, the variables already stored for the environment you're deploying to are checked against the same limits. This means that variables you set before the limits were introduced are checked the next time you deploy. If any limit is exceeded, the deployment fails with an error that lists each limit that was breached, for example:

  • The number of plain variables or encrypted variables is over the maximum.
  • The keys of variables whose values are over the maximum size.
  • The keys of variables whose names are over the maximum length.

To fix the error, remove or shorten the listed variables using forge variables unset and forge variables set, then deploy again. Your variables aren't changed or removed automatically.

If your app needs higher limits, see Exceeding limits and suspended apps.

Storing larger values

Environment variables are intended for small configuration values and credentials. If you need to store larger payloads, use Forge storage instead.

Rate this page: