Documentation

Environment variables and secrets

Encrypted environment variables, shared env groups, secret files and generated values.

Environment variables configure your app without changing code. Values are encrypted at rest and only shown to team members with the developer role or above.

Set variables

In the dashboard: Service → Environment. Paste a whole .env file at once if you like.

From the CLI:

rebasable env set DATABASE_URL=postgres://... LOG_LEVEL=info
rebasable env import .env --deploy      # merge a .env file and deploy
rebasable env list --reveal
rebasable env unset OLD_FLAG
rebasable env export -o .env.production

Changes apply on the next deploy. Use Save and deploy (or --deploy) to roll them out right away.

Generated values

Need a random secret like SESSION_SECRET? Click Generate (or generateValue: true in a blueprint) to create a random 256-bit value.

Env groups

An env group is a named set of variables shared by many services, for example shared-stripe or observability. Link a group to a service and its variables are injected. If a service sets the same key, the service value wins. Groups linked earlier have lower priority than groups linked later.

rebasable env-groups create shared-stripe --from stripe.env
rebasable env-groups link shared-stripe my-api

Secret files

Some tools need files, not variables (TLS certificates, credentials.json, .npmrc). Upload them as secret files; they are mounted read-only at /etc/secrets/<name> in every instance, and are available during builds.

rebasable env files set gcp.json ./service-account.json

Build time vs runtime

Variables are available during the build (as build secrets with Docker) and at runtime. For static sites, only build time applies.

Platform variables

We set PORT, REBASABLE=true, REBASABLE_EXTERNAL_URL, REBASABLE_GIT_COMMIT and more. See the full list.