Environment Variables

Security

Environment Variables

4 min readUpdated August 2026

Environment variables configure an app without hardcoding values in source. On StackBlaze they live on the app configure Variables tab (heading Environment Variables) as key/value pairs injected into the container at runtime.

Changes are staged, then applied when you click Commit N changes on the canvas. There is no separate Service → Environment page and no Settings → Variables page.

A key is added by hand on the Variables tab, a dropped .env file imports the rest, and the staged changes are committed.

Add variables

Add variable

Adds a blank KEY / value row. Use this for a single flag, URL, or credential. Values stay visible on the Variables tab so you can edit them later.

Drop or select a .env file

The dashed drop zone on the same tab accepts a .env or .txt file. There is no separate “Bulk import” button.

Typical keys: NODE_ENV, LOG_LEVEL, API_BASE_URL, DATABASE_URL. For files (certs, JSON keys), use secret files instead of stuffing PEM blobs into a variable.

Shared values

StackBlaze does not have Environment Groups. To share connection details, attach the same add-on to each app in the phase — connected apps get the add-on’s connection variables injected. For anything else, copy the keys onto each app’s Variables tab.

Preview environments

Preview settings live on the project, not on a per-service override UI. Open Project settings → General → Preview environments. A preview clones the deployed app spec (including env vars). Choose empty or snapshot data for attached datastores. There is no per-service “Override Variables” panel.

How it applies

  • Staged, then committed: the Variables tab edits the draft. Commit N changes on the canvas is what deploys the new values.
  • Add-on connections: attaching a database or cache in the same phase injects connection variables for that app. Re-attach or copy keys if another app needs the same values.

Step by step

01

Open the Variables tab

Open the app, then go to the Variables tab. The heading is Environment Variables. Add key/value pairs that are injected into the container at runtime.

02

Add a variable or drop a .env file

Click Add variable for a single key, or drop/select a .env file to import KEY=VALUE lines. Review the list on the tab — nothing is applied until you commit.

03

Commit the staged changes

Edits stay staged on the canvas. When you are ready, click Commit N changes. The app updates from that commit — there is no instant save and no secret-toggle that rolling-deploys on its own.

04

Share values across apps

There are no Environment Groups. Attach the same add-on in the phase so each app gets the connection variables, or copy the keys you need onto each app’s Variables tab.