Add a variable
1
Open Secrets
Open the project and select Secrets.
2
Add it
Choose New Variable, enter the name and value, and pick a scope.
3
Redeploy
Running apps only read variables when they start. Redeploy to apply the change.
.env file. History shows past changes.
Scopes
Vault
The workspace Vault stores a secret once for all your projects (paid plans). Open Vault in the sidebar and add a secret. Then reference it in any project variable:postgres://app:{{vault.DB_PASSWORD}}@host/db. Pxxl first looks for the secret in the project’s environment, then in All environments. If the secret doesn’t exist, the deploy fails and names it.
Vault names use capital letters, numbers, and _, up to 128 characters. Values can be up to 32 KB.
Use another project’s value
Reference a variable from another project in the same group (the main project and its services):${<project name or id>.<KEY>}. Pxxl copies the value at deploy time. A reference it can’t resolve stays as plain text, so check the spelling. A plain ${KEY} with no dot is not expanded.
The value field on Secrets has a picker for Vault secrets and other services’ values, so you don’t have to type these.
Names and limits
- Names start with a letter or
_, then letters, numbers, and_. Up to 256 characters. - Values can be up to 32,768 characters.
- Bulk Edit strips one pair of quotes around a value.
- No names are reserved. You can override
PORTand most variables Pxxl sets (see below).
From the CLI
pxxl env command.
Build and runtime
Which value wins
From lowest to highest:[env]inpxxl.toml(build only).- Global variables.
- Project variables.
- References are filled in:
${service.KEY}, then{{vault.KEY}}.
Variables Pxxl sets
Every project
These are saved as normal variables when the project is created. You can see and edit them in Secrets.Defaults in the running app
Set only if you haven’t set them yourself:Framework defaults at build time
When you attach a database
Choosing Add DATABASE_URL savesDATABASE_URL as a secret global variable, for example postgresql://user:pass@host:5432/db. A project-level DATABASE_URL overrides it.
Functions
Functions deploys get these. They always replace a variable with the same name.Multiple services in one container
Each service process gets its ownPORT, EXPOSE_PORT, LISTEN_PORT, SERVER_PORT, and HOST=0.0.0.0. These can’t be overridden for that process.
WordPress
WordPress projects getWORDPRESS_DB_HOST, WORDPRESS_DB_NAME, WORDPRESS_DB_USER, WORDPRESS_DB_PASSWORD, and WORDPRESS_CONFIG_EXTRA set for you. Your own values for these, and MYSQL_* or MARIADB_*, are ignored.
pxxl dev
pxxl dev runs your app with the project’s variables, plus:
Your shell’s variables beat the project’s.
What Pxxl doesn’t set
There’s noNODE_ENV, CI, commit SHA, branch name, project id, region, or public URL variable. Set the ones you need yourself, for example:
Good habits
- Never commit
.envfiles. Add them to.gitignoreand.pxxlignore. - Frontend frameworks put some variables into browser code (for example
VITE_*,NEXT_PUBLIC_*). Only use those prefixes for values that are safe to show the public. - Don’t put secrets in
pxxl.toml. It’s committed with your code.

