Skip to main content
vers env manages environment variables that Vers injects into new VMs at boot. The variables are written to /etc/environment, so they’re available to SSH sessions and anything launched via vers execute.
vers env only affects newly-created VMs. Existing VMs keep the environment they were booted with.

Synopsis

Subcommands

vers env list

List all environment variables configured for your account. Aliases: ls.

vers env set

Set an environment variable.
Constraints
  • KEY must be a valid shell identifier: letters, digits, underscores; cannot start with a digit.
  • KEY is at most 256 characters.
  • VALUE is at most 8192 characters.
Examples:

vers env delete

Remove an environment variable. The key is no longer injected into new VMs; existing VMs are unaffected. Aliases: del, rm, remove.

How it works

1

Stored per account

Variables live on your Vers account, not on any single VM.
2

Injected at VM boot

When a new VM is provisioned (vers run, vers branch, vers run-commit, vers build), the orchestrator writes every variable to /etc/environment before handing the VM over.
3

Available to sessions and exec

Login shells, SSH sessions (vers connect), and commands run via vers execute all see the variables.

Use cases

  • Secrets: API keys, database URLs, webhook tokens — available to every VM without leaking into your Dockerfile or vers.toml.
  • Feature flags: DEBUG=true, FEATURE_X=on.
  • Per-account defaults: any variable you want every VM you create to inherit.
For secrets you want scoped to a single commit rather than your whole account, bake them into a commit with vers build + ENV or write to /etc/environment in a RUN step.

Common Patterns

Bulk-load from a local .env file

Clear every variable

Verify injection on a fresh VM

See also

  • vers build — bake environment into a specific commit via ENV
  • vers execute — commands inherit /etc/environment
  • vers connect — SSH sessions inherit /etc/environment