> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/stormkit-io/stormkit-io/llms.txt
> Use this file to discover all available pages before exploring further.

# Multiple Environments

> Create and manage multiple development environments easily with Stormkit.

## Overview

With Stormkit, you can create multiple environments per application to support different stages of your development workflow. Each environment points to a specific branch, and when that branch is updated, Stormkit will automatically deploy it (provided you have [Auto Deployments](/deployments/auto-deployments) enabled).

This feature enables you to maintain separate configurations for production, staging, development, and any other custom environments you need.

## Default Environment

By default, each application comes with a production environment already set. You'll need to configure it to deploy successfully.

<Note>
  The production environment cannot be deleted or renamed, but you can change the branch it points to.
</Note>

Any branch that does not match an environment's configured branch (such as a feature branch) will be deployed using the default environment's configuration.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/stormkit-io-stormkit-io/assets/docs/features/env-screen.png" alt="Environment screen showing Add Environment button" />
</Frame>

## Creating an Environment

<Steps>
  <Step title="Navigate to your application">
    Select your application from the dashboard. You'll be taken directly to your application's default environment (production).
  </Step>

  <Step title="Add new environment">
    On the left navigation menu, you'll see an **Add Environment** button. Click it to create a new environment.
  </Step>

  <Step title="Configure the environment">
    [Configure your environment](/deployments/configuration) with the appropriate settings, including:

    * Environment name
    * Branch to track
    * Build and deployment settings
    * Environment variables
  </Step>
</Steps>

## Use Cases

<CardGroup cols={2}>
  <Card title="Staging Environment" icon="flask">
    Create a staging environment to test changes before they reach production. Point it to your `staging` or `develop` branch.
  </Card>

  <Card title="Preview Environments" icon="eye">
    Set up preview environments for feature branches to review changes in isolation before merging.
  </Card>

  <Card title="Testing Environment" icon="vial">
    Maintain a dedicated testing environment with specific configurations for QA and automated testing.
  </Card>

  <Card title="Demo Environment" icon="presentation">
    Create demo environments for showcasing features to clients or stakeholders without affecting production.
  </Card>
</CardGroup>

## Environment Configuration

Each environment can have its own:

* Branch tracking
* Build configuration
* Environment variables
* Custom domains
* Auth wall settings
* Snippets
* Redirects and headers
* Database schema (self-hosted)

This isolation ensures that changes in one environment don't affect others.

## Deleting an Environment

<Warning>
  Deleting an environment will also remove all associated deployments. This action cannot be undone.
</Warning>

To delete an environment:

1. Navigate to the environment's [configuration page](/deployments/configuration)
2. Scroll to the bottom of the page
3. Click the **Delete environment** button
4. Confirm the deletion

<Note>
  **Production** environments cannot be deleted as they are required by design.
</Note>

## Best Practices

* **Use descriptive names** - Name environments clearly (e.g., "Production", "Staging", "QA")
* **Mirror production** - Keep staging environments as close to production as possible
* **Environment variables** - Use environment-specific variables for API keys and configuration
* **Regular cleanup** - Remove unused environments to keep your workspace organized
