Environment Variables
Setting env vars
Set environment variables from Mission Control → Environment Variables — that field is write-only, and the editor shows only the key after a save. If your ZIP includes a .env file, moonbase applies its non-secret values automatically; anything shaped like a real credential (API key, token, password, database URL) is never auto-applied, even from a shipped .env — you'll be prompted to set it through this same UI instead.
The dashboard, environment variables API and AI connector return key names, never saved values. The owner can explicitly include environment variable values in a reauthenticated account export — see Export Your Mission. Your Mission's own code does run with them, so an app or key that can deploy code to a Mission could, through that code, use them: only connect apps you trust. Build-log redaction is best effort for configured literal values. Treat build output as potentially sensitive. Startup failures return a fixed diagnostic instead of app output.
Drag-and-drop loader
During upload, you can drag your .env file directly into the consent dialog to auto-fill all your variables. Platform-managed keys (MOONBASE_*) are handled automatically.
Secrets safety
The dashboard and environment variables API show only key names after a save. Values are stored encrypted at rest (AES-256-GCM). The one way to get them back is the mission owner's 'Download everything' export with values, which asks for your password first — see Export Your Mission. Do not commit real secrets to your repository.
When new values take effect
Changing an environment variable does not affect an already-running deploy — the current values are sent fresh with every new deploy, so 'Save and redeploy' (or 'Deploy new version') is what applies a change. If your framework bakes a variable into the client bundle at build time (for example a Next.js NEXT_PUBLIC_* value), redeploying is what picks up the new value, the same as any other env var change here.
Connecting a backend
Step-by-step guides, with which value goes in which variable, what is public and what stays on the server, and examples for a mission with and without a build step: