---
schema_version: "1"
id: 5e3a7934d0f08b5482c21a85b43257f8933b32b3d0ffd930ce94235b4a5d2690
title: Install and Configure the Terraform Provider
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mulesoft-terraform-provider/install-configure.md
canonical_url: https://docs.mulesoft.com/mulesoft-terraform-provider/install-configure
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a779cbbddbba83b7713f0509404a0184cd7f03942775717e957a6cfdeed55fd8
description: MuleSoft Documentation Site
latest: true
---
---
product: MuleSoft Terraform Provider
---

# Install and Configure the Terraform Provider

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

To use the MuleSoft Terraform provider, install the provider from the Terraform Registry and
configure authentication for your MuleSoft Platform organization.

The provider supports Terraform-based management for MuleSoft Platform resources, including CloudHub
2.0, API Manager, Access Management, Secrets Manager, MCP servers, and AI agent resources.

## Access the Provider in the Terraform Registry

Go to the Terraform Registry and search for the MuleSoft Terraform provider.

For provider installation instructions and the complete list of supported resources, see the
[MuleSoft Terraform provider documentation](https://registry.terraform.io/providers/mulesoft/anypoint/latest/docs).

## Add the Provider

Add the provider to your Terraform configuration file:

```hcl
terraform {
  required_providers {
    anypoint = {
      source  = "mulesoft/anypoint"
      version = "~> 1.0.0"
    }
  }
}
```

> [!NOTE] Replace `1.0.0` with the latest version. See the
> [MuleSoft Anypoint provider on the Terraform Registry](https://registry.terraform.io/providers/mulesoft/anypoint/latest)
> for the current release.

## Initialize Terraform

Run the following command to download and install the provider:

```bash
terraform init
```

## Configure Credentials

The provider supports two types of connected apps depending on the resources you manage.

### Standard Connected App

Most resources use a standard connected app (client credentials only):

```bash
export TF_VAR_anypoint_client_id="<client-id>"
export TF_VAR_anypoint_client_secret="<client-secret>"
export TF_VAR_anypoint_base_url="https://anypoint.mulesoft.com"
```

### Admin Connected App

Some resources require an admin connected app configured with user credentials. This is needed for
resources that authenticate on behalf of a user:

```bash
export TF_VAR_anypoint_admin_client_id="<admin-connected-app-client-id>"
export TF_VAR_anypoint_admin_client_secret="<admin-connected-app-client-secret>"
export TF_VAR_anypoint_admin_username="<admin-username>"
export TF_VAR_anypoint_admin_password="<admin-password>"
export TF_VAR_anypoint_base_url="https://anypoint.mulesoft.com"
```

## Configure the Provider

Configure the provider using the authentication method required for your resources.

### Standard Connected App

```hcl
provider "anypoint" {
  client_id     = var.anypoint_client_id
  client_secret = var.anypoint_client_secret
  base_url      = var.anypoint_base_url
}
```

### Admin Connected App

```hcl
provider "anypoint" {
  alias         = "admin"
  username      = var.anypoint_admin_username
  password      = var.anypoint_admin_password
  client_id     = var.anypoint_admin_client_id
  client_secret = var.anypoint_admin_client_secret
  base_url      = var.anypoint_base_url
}
```

The provider also supports additional authentication methods, including access token authentication
and control plane configuration. For the complete provider configuration reference, see the
[MuleSoft Terraform provider documentation](https://registry.terraform.io/providers/mulesoft/anypoint/latest/docs).

## See Also

- [MuleSoft Terraform Provider](https://docs.mulesoft.com/mulesoft-terraform-provider/)

- [How the Provider Works](https://docs.mulesoft.com/mulesoft-terraform-provider/how-provider-works)

- [Resources](https://docs.mulesoft.com/mulesoft-terraform-provider/resources)
