[Go to site: main page, start]

Docs

Environment variables

Settings and secrets for an app, applied on its next deploy.

Add or change a variable

  1. 1

    Open the Environment tab

    Open the app and go to its Environment tab. Owners, admins and developers can change variables; spectators see the names only.
  2. 2

    Type the key and value

    Under Add or replace a variable, type the Key and the Value. Saving a key that already exists replaces its value.
  3. 3

    Mark secrets

    Tick Secret for passwords and tokens. A secret value is encrypted at rest and cannot be viewed again in the console.
  4. 4

    Save, then deploy

    Click Save. The change applies on the next deploy; click Redeploy now to apply it at once.

Remove a variable

Click Remove next to the variable and confirm. The app keeps the variable until its next deploy. A secret value cannot be viewed again, so keep a copy if you still need it.

Rules

  • Names use only letters, digits and _, and do not start with a digit.
  • A value can be up to 32,768 characters, and all values together up to 1 MB.
  • Some names are set by CloudPloy and cannot be changed: PORT, HOST, PRIMARY_DOMAIN, DEFAULT_SUBDOMAIN, REDIRECT_DEFAULT_TO_CUSTOM and names starting with COMPOSE_ or DOCKER_.
  • A variable marked Required must have a value before the app can deploy.
  • On an app from a template, the variables the template sets cannot be changed or removed.

Variables from databases

A linked database adds its own variables, such as DATABASE_URL or REDIS_URL. They show under From linked databases on the Environment tab, with the values hidden. See Databases.