---
title: Environment Variables
description: Configure build-time and runtime environment variables for your project.
order: 3
---

Environment variables let you configure your application without committing secrets to your repository. Atlasflow scopes every variable to either **build** or **runtime**.

## Build vs runtime

| Type        | When it applies             | Typical use                                                  |
| ----------- | --------------------------- | ------------------------------------------------------------ |
| **Build**   | During the image build step | Private package registry tokens, build flags like `NODE_ENV` |
| **Runtime** | When your container starts  | `DATABASE_URL`, API keys, feature flags                      |

A variable set as **build** is available to your Dockerfile or auto-detected build, but is not present in the running container unless you also add it as a runtime variable. A **runtime** variable is injected into the container's environment when it starts.

> **Note:** If your app reads a value at startup (most secrets and connection strings), add it as a **runtime** variable. If it's only needed while building the image, add it as a **build** variable.

## Add a variable

1. Open your project **Settings**.
2. Choose the **Build** or **Runtime** variables section.
3. Add the variable name and value.
4. Save. The change applies to your next deployment.

## Security

Values are encrypted at rest. The dashboard hides values by default; you can reveal a variable's value when you need to confirm it. Avoid logging secret values from your application.

## Updating and removing

Editing or deleting a variable takes effect on the next deployment. Trigger a [redeploy](/docs/guides/redeploys.md) if you want a change to apply immediately without pushing a commit.

## Reserved behavior

Atlasflow injects the variables your container needs to run on the platform. Define your own application variables as usual; if a name you choose ever conflicts with a platform value, the platform value takes precedence.

## Next steps

- [Configuration](/docs/guides/configuration.md): other project settings.
- [Redeploys](/docs/guides/redeploys.md): apply variable changes immediately.
- [Builds](/docs/concepts/builds.md): how build variables are used.