Environment variables

Velixir injects environment variables into your app's pod at start-up. They're set per-app from the dashboard or the CLI (CLI support coming soon — for now use the dashboard) and applied on the next deploy.

Setting a variable

From the app's Environment tab:

  1. Enter a key (DATABASE_URL, STRIPE_API_KEY, anything matching ^[A-Z_][A-Z0-9_]*$).
  2. Enter a value.
  3. Tick Treat as secret if it's something you don't want shown back in the UI.
  4. Click Save.

Setting a key that already exists replaces its value. No separate "edit" step.

Secrets vs plain values

  • Plain values are stored as you typed them and shown back in the UI. Use these for non-sensitive config: feature flags, hostnames, environment names.
  • Secrets are encrypted at rest with ASP.NET Core DataProtection (the same key infrastructure that signs cookies and antiforgery tokens). The UI shows •••••••• instead of the value; to change a secret you set the key again with a new value.

Both kinds reach your pod as plain process.env strings — your code doesn't need to do anything special to read them.

Reading them from your code

// Anywhere in your .NET app
var dbUrl = Environment.GetEnvironmentVariable("DATABASE_URL");

// Or via configuration binding
builder.Configuration["DATABASE_URL"];

We also set some platform-managed vars automatically:

  • ASPNETCORE_URLS — bound to your app's listen port (default 8080).
  • ASPNETCORE_ENVIRONMENTProduction.
  • ASPNETCORE_HTTP_PORTS, PORT — same port as ASPNETCORE_URLS.
  • VELIXIR_APP_ID, VELIXIR_APP_SLUG — identifiers your app can log or report.

If you provision a managed database or cache inside the same project and link it to your app, we also inject a connection string for it automatically (see Postgres databases / Valkey caches).

Applying changes

Setting or deleting an env var doesn't auto-redeploy. The Environment tab shows a banner reminding you to redeploy — running pods keep their original values until they're rolled over. Hit Deploy on the latest release (or push a new one) to apply changes.

Limits

  • Keys: max 200 characters, must match ^[A-Za-z_][A-Za-z0-9_]*$.
  • Values: max 4000 characters. For larger blobs (certificates, big JSON config), put the blob in object storage and store the URL here.