DeployxaDocs Portal
CLI v1.0.4
Environment Variables & Secret Vault
Runtimes

Environment variables and secrets

Store configuration and credentials outside your code. Values are encrypted at rest and injected into your app.

Set variables from the CLI

shell
$ deployxa env set API_KEY sk_live_123
$ deployxa env list
$ deployxa env remove API_KEY
CommandWhat it does
env set KEY VALUECreates or updates one variable. "env add" is the same.
env listPrints every variable with its decrypted value. Careful on shared screens.
env pullWrites all variables to .env.local in the current folder (overwrites it).
env pushUploads each KEY=VALUE line from .env.local, or .env if there is no .env.local. Lines starting with # are skipped.
env remove KEYDeletes one variable.
secretsLists variable names only, without values.
Note: All env commands act on the linked project. To target another project without linking, use the positional form deployxa env <projectId> KEY VALUE.

Set variables in the dashboard

Open a project and its Environment tab. Table mode lets you add, reveal, copy and delete single values; bulk mode accepts a pasted .env file. The new-project wizard has the same editor, so you can add variables before the first build.

When changes take effect

Treat a variable change as needing a new deployment. After changing values, run:

shell
$ deployxa redeploy

Frameworks that inline variables at build time (for example NEXT_PUBLIC_* in Next.js or VITE_* in Vite) need a rebuild, not just a restart. Those values end up in browser code, so never put secrets in them.

.env file format

dotenv
# comments are ignored
DATABASE_URL=postgres://user:pass@host:5432/app
REDIS_URL=redis://host:6379
SESSION_SECRET=change-me

env push splits each line at the first = and trims whitespace. It does not strip quotes, so write KEY=value, not KEY="value", unless the quotes are part of the value. Multi-line values are not supported by push; set them in the dashboard.

Security

  • Values are stored encrypted. deployxa secrets lists names without values; env list and env pull decrypt them, so run those only where it is safe.
  • Organizations can require a name prefix for variables. deployxa team shows the rule if one is set.
  • Add .env, .env.local and .deployxa/ to .gitignore.
  • CLI 1.0.4 uploads the whole folder on deployxa deploy, including .env files. Remove them from the folder, or deploy from Git, so secrets live only in project variables.
  • Shared projects and environment variables across a team are part of the Team plan and above.

Using variables in code

js
// Node.js
const db = process.env.DATABASE_URL;
python
# Python
import os
db = os.environ["DATABASE_URL"]
php
// PHP / Laravel
$db = env('DATABASE_URL');