> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Manage environments

An environment is where one agent of a [blueprint](/blueprints) runs. Each environment has its own variables and secrets, so you can run the same blueprint as `staging` and `production` with different API keys. This page covers the Astropods web app. To do the same tasks from the terminal, see [`ast env`](/cli/env).

## Before you start

To complete this guide, you'll need the following:

* An Astropods account at astropods.com. You sign in to the web app to manage environments.
* A private blueprint with at least one [pushed build](/blueprints). Environments are available for private blueprints only, and you need a build to deploy into one.
* The values you want to store, such as an API key. Astropods can't show a secret's value after you save it, so keep your own copy.

## Create an environment

#### Open the Environments tab

Log into astropods.com, click a blueprint, and click **Environments**. The tab lists the environments for that blueprint, with each one's agent and variable count.

#### Create an environment

Click **New environment** and enter a name. Use lowercase letters, numbers, and dashes. The CLI uses this name in `--env`, and it must be unique for the blueprint.

#### Choose an icon and color

The icon and color help you tell environments apart in lists and on the deploy page.

#### Copy variables (optional)

To reuse the variables and secrets from an existing environment, select it under **Copy variables from another environment**. The copy includes names and values. Secrets stay linked to the account vault.

#### Save the environment

Click **Create environment**. The new environment opens.

An environment with no agent shows **No agent in this environment**. Click **Deploy** to deploy the blueprint into it.

## Add a variable or secret

You can add variables that differ between environments, like channel IDs or regions. Add a secret for an API key, token, or password.

To add a variable or secret, do the following:

1. At astropods.com, click a blueprint, then click **Environments**.

2. Click the environment's name.

3. In the **Variables and secrets** panel, click **Add environment variable**.

4. Enter a key. Use letters, numbers, and underscores, and start with a letter or underscore.

5. Enter a value.

6. Leave **Secret** on for an API key, token, or password. Turn it off to store a value you can read later, like a region.

   > **Note**
   >
   > Astropods can't show a secret's value again, so keep your own copy.

7. Click **Save**.

A secret shows a lock icon and a masked value after you save it.

The change applies the next time you deploy into the environment. If the environment already has an agent, the page shows a **Redeploy** prompt so the agent picks up the change.

To add several values at once, click **Copy from existing** and choose another environment. Secret values don't copy over, so set them again after you copy.

## Override account variables

An environment variable overrides an account variable with the same name, in that environment only. When you add a variable whose name matches an account variable, the dialog says so and links to the account variables.

Removing the environment's value restores the account value. To manage account-level values, click **Account variables** at the top of the panel. See [Managing secrets](/secrets).

## Deploy into an environment

Deploy a blueprint into an environment to run an agent with that environment's variables and secrets. An environment holds one agent, so deploy into an environment that has none.

To deploy into an environment, do the following:

1. At astropods.com, click a blueprint, then click **Environments**.
2. Click the name of an environment that has no agent.
3. In the **Agent** panel, click **Deploy**. The deploy page opens with that environment selected.
4. In the **Build and environment** section, check that **Runs with the** names the environment you want. To change it, click the environment name and pick another.
5. Scroll to **Agent variables**. An environment uses your account variables unless it sets its own. When an environment or account variable has the same name and type (secret or plain) as an agent variable, the form fills it in and shows **Auto-filled**. For example, `ANTHROPIC_API_KEY` appears with **Auto-filled** beside it. Fill any variable that is still empty.
6. Review the other sections, then click **Deploy** at the bottom of the page. For help with the messaging interface, see [Deploy your first agent](/deploy-agent).

## Rename or delete an environment

To rename an environment, click its name at the top of the environment page. Scripts that use the old name in `--env` stop working until you update them.

To delete an environment, click **Delete** in the **Danger zone** and confirm. Deleting removes the environment and all its variables and secrets, and you can't recover secret values. An environment that has an agent can't be deleted: delete the agent first.

## Next steps

* [ast env](/cli/env): manage environments from the terminal
* [Managing secrets](/secrets): store account-level secrets and variables
* [Managing your agents](/managing-agents): redeploy and monitor the agent in an environment