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:
| Resource | Limit | Description |
|---|---|---|
| Plain variables | 50 | Maximum number of unencrypted variables in an environment. |
| Encrypted variables (secrets) | 10 | Maximum number of variables set with the --encrypt option in an environment. |
| Variable value size | 3 KB | Maximum 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 length | 128 | Maximum 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.
The limits are checked when you run the forge variables set command and when you run the forge deploy command.
If your app's variables are currently over any of these limits, update them by Tuesday, May 11, 2027. If your app needs a higher limit, contact Developer and Marketplace Support.
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:
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 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:
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: