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

# porter target

> List and manage deployment targets to control which cluster, namespace, and environment your Porter applications deploy to using the CLI

`porter target` contains commands for managing deployment targets.

## Prerequisites

* You've logged in to the Porter CLI after running [porter auth login](/standard/cli/command-reference/porter-auth)
* You're connected to the correct project by running [porter config set-project](/standard/cli/command-reference/porter-config)
* You're connected to the correct cluster by running [porter config set-cluster](/standard/cli/command-reference/porter-config)

***

## `porter target list`

List all deployment targets in the current cluster.

**Usage:**

```bash theme={null}
porter target list [flags]
```

**Options:**

| Flag        | Description                         |
| ----------- | ----------------------------------- |
| `--preview` | Include preview environment targets |

<CodeGroup>
  ```bash List Targets theme={null}
  porter target list
  ```

  ```bash Include Previews theme={null}
  porter target list --preview
  ```
</CodeGroup>

<Info>
  Deployment targets allow you to deploy the same application to different environments (production, staging, preview) within the same cluster.
</Info>

***

## `porter target create`

Create a new deployment target in the current cluster.

**Usage:**

```bash theme={null}
porter target create --name [name]
```

**Options:**

| Flag     | Description                                        |
| -------- | -------------------------------------------------- |
| `--name` | Name of the deployment target to create (required) |

```bash Create Target theme={null}
porter target create --name staging
```

On success, the command prints the new target's ID:

```
Created target with name staging and id cc1b12a3-1481-4b98-910f-12bf8c13f5d4
```

***

## `porter target delete`

Delete a deployment target from the current cluster. Works for both standard and preview environment targets.

**Usage:**

```bash theme={null}
porter target delete --name [name] [flags]
```

**Options:**

| Flag            | Description                                        |
| --------------- | -------------------------------------------------- |
| `--name`        | Name of the deployment target to delete (required) |
| `-f`, `--force` | Skip the confirmation prompt                       |

<CodeGroup>
  ```bash Delete Target theme={null}
  porter target delete --name staging
  ```

  ```bash Skip Confirmation theme={null}
  porter target delete --name staging --force
  ```
</CodeGroup>

<Warning>
  The default deployment target for a cluster can't be deleted. Attempting to delete it returns an error.
</Warning>

***

## Using Targets with Deployments

Specify a target when deploying with `porter apply`:

```bash theme={null}
porter apply -f porter.yaml --target staging
```

<Tip>
  Preview environment targets are automatically created when you set up preview environments. See [Preview Environments](/preview-environments/overview) for more details.
</Tip>

***

## Related Commands

* [porter apply](/standard/cli/command-reference/porter-apply) - Deploy to a specific target
* [porter app list](/standard/cli/command-reference/porter-app) - List apps in the current target
