> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment.md).

# Environment

Understand what a Harness environment represents and how it fits into a deployment pipeline.

A Harness environment represents where you deploy your application, such as development, staging, or production. Each environment contains one or more infrastructure definitions that point to the actual cluster, namespace, host, or cloud account where the Delegate runs the deployment.

Environments exist independently of pipelines. You define an environment once and reuse it across multiple stages, pipelines, and services.

***

## Infrastructure definitions <a href="#infrastructure-definitions" id="infrastructure-definitions"></a>

An environment can contain multiple infrastructure definitions. For example, a production environment might have five infrastructure definitions representing five Kubernetes clusters. When you select an environment in a pipeline stage, you choose which infrastructure definition to use for that deployment.

Go to [Infrastructure definitions](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/infrastructure-definitions.md) to create and manage the infrastructure definitions within an environment.

## Create an environment <a href="#create-an-environment" id="create-an-environment"></a>

In the Harness application, expand **Deployments** in the left navigation and select **Environments** to open the environments list for the project. The list page has two tabs: **Environments** and **Environment Groups**.

The **Environments** tab shows every environment in the project, along with its type and when it was created or last updated. Use **Add filter** to narrow the list, sort by **Last Updated**, and use **Columns** to choose which columns appear in the table.

To create an environment, select **+ Create environment** and complete the following steps.

1. Enter a **Name** for the environment, or select the name Harness suggests.
2. Choose a **Storage** option for the environment configuration. **Inline** stores the configuration directly on the environment.
3. Choose an **Environment Type**, either **Production** or **Pre-Production**.
4. Select **Create**.

Harness creates the environment and opens its detail page.

## View and manage an environment <a href="#view-and-manage-an-environment" id="view-and-manage-an-environment"></a>

An environment's detail page has three tabs. **Configuration** shows the environment name, ID, type, and when it was created and last modified. **Infrastructure Definitions** lists the infrastructure definitions in the environment; go to [Infrastructure definitions](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/infrastructure-definitions.md) to add one. **References** shows which pipelines use the environment.

## Environment-level failure handling <a href="#environment-level-failure-handling" id="environment-level-failure-handling"></a>

You can set a failure strategy directly on an environment so that Harness reacts to a failure while resolving the environment or its infrastructure, before deployment steps run.

Go to [Failure strategy](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/failure-strategy.md) to configure `on-failure` rules at the environment level.

***

## Next steps

* Go to [Environment groups](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/environment-groups.md) to deploy a service to a group of environments in one step.
* Go to [Infrastructure definitions](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/infrastructure-definitions.md) to create and manage the infrastructure definitions within an environment.
* Go to [Failure strategy](https://developer.harness.io/continuous-delivery/3.0/deployment-entities/environment/failure-strategy.md) to configure what happens when environment or infrastructure resolution fails.
* Go to [Deployments overview](https://developer.harness.io/continuous-delivery/3.0/new-to-deployments/overview.md) to review how environments fit into the overall pipeline model.

{% @harness-feedback/feedback %}
