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

# Deploy LangSmith with Terraform

> Provision LangSmith self-hosted on AWS, Azure, or GCP using LangChain's production-ready Terraform modules.

<Info>
  Self-hosted LangSmith is an add-on to the Enterprise plan designed for LangChain's largest, most security-conscious customers. See [pricing](https://www.langchain.com/pricing) for details, or [contact sales](https://www.langchain.com/contact-sales) to request a license key for trial.
</Info>

LangChain publishes production-ready Terraform modules for [LangSmith self-hosted](/langsmith/self-hosted) at [github.com/langchain-ai/terraform](https://github.com/langchain-ai/terraform). The modules provision the cloud foundation (network, cluster, database, cache, object storage, secrets, DNS) and install the LangSmith Helm chart with sensible defaults.

Use this path when you want infrastructure as code from day one. If you already manage cloud infrastructure with your own tooling and need just the application install, follow the [Helm installation guide](/langsmith/kubernetes) instead.

<Tip>
  **Prefer Helm?** The [Kubernetes setup guide](/langsmith/kubernetes) walks through installing with Helm against any conformant cluster, no Terraform required. The Terraform path bundles cluster provisioning, secrets wiring, and the Helm release into one workflow.
</Tip>

## Choose a provider

<CardGroup cols={3}>
  <Card title="AWS (EKS)" icon="brand-aws" href="/langsmith/self-host-terraform-aws-deploy">
    Provision EKS, RDS PostgreSQL, ElastiCache, S3, and networking.
  </Card>

  <Card title="Azure (AKS)" icon="brand-windows" href="/langsmith/self-host-terraform-azure-deploy">
    Provision AKS, Azure Database for PostgreSQL, Azure Managed Redis, Blob Storage, and Key Vault.
  </Card>

  <Card title="GCP (GKE)" icon="brand-google" href="/langsmith/self-host-terraform-gcp-deploy">
    Provision GKE, Cloud SQL, Memorystore, GCS, and Workload Identity.
  </Card>
</CardGroup>

## Prerequisites

Install the following tools before running the modules:

| Tool        | Version | Purpose                                          |
| ----------- | ------- | ------------------------------------------------ |
| `terraform` | 1.5     | Run the modules                                  |
| `kubectl`   | 1.33    | Inspect the cluster after provisioning           |
| `helm`      | 3.12    | Manage the LangSmith chart release               |
| Cloud CLI   | latest  | `aws`, `az`, or `gcloud` for the target provider |

You also need:

* A LangSmith license key. [Contact sales](https://www.langchain.com/contact-sales) to request one.
* Permissions in the target cloud account to create VPC or VNet networking, a managed Kubernetes cluster, managed databases, object storage, secrets, and IAM roles.
* A registered domain (or subdomain) for the LangSmith UI endpoint.

## Deployment tiers

Pick a tier with a single Terraform variable. The modules size every dependent resource accordingly.

| Tier               | PostgreSQL                                     | Redis                                                 | ClickHouse                                                              | Use case                             |
| ------------------ | ---------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------ |
| `dev`              | In-cluster                                     | In-cluster                                            | In-cluster                                                              | Demos, evaluations, short-lived POCs |
| `production`       | Cloud-managed (RDS, Cloud SQL, Azure Database) | Cloud-managed (ElastiCache, Memorystore, Azure Cache) | [LangChain Managed ClickHouse](/langsmith/langsmith-managed-clickhouse) | Persistent, scalable production      |
| `production-large` | Cloud-managed, larger instance class           | Cloud-managed, larger instance class                  | LangChain Managed ClickHouse                                            | High-throughput production           |

<Warning>
  Use in-cluster ClickHouse for development and POC, not production. Production deployments must use [LangChain Managed ClickHouse](/langsmith/langsmith-managed-clickhouse) or a self-managed external ClickHouse cluster. Blob storage is always required because trace payloads must not live in ClickHouse.
</Warning>

## What the modules provision

* **Networking:** VPC or VNet with public and private subnets, NAT, and security groups.
* **Compute:** Managed Kubernetes (EKS, AKS, or GKE) with autoscaling node pools sized per tier.
* **Data plane:** Managed PostgreSQL, managed Redis or cache, and a blob storage bucket for trace payloads.
* **Secrets:** Cloud-native secret store (AWS SSM Parameter Store, Azure Key Vault, GCP Secret Manager) synced into Kubernetes by [External Secrets Operator](https://external-secrets.io/).
* **Ingress:** Cloud-native load balancer by default. Envoy Gateway (Gateway API) is available for multi-namespace dataplane deployments.
* **Optional hardening (AWS today):** AWS Network Firewall with FQDN egress allowlists, WAFv2, CloudTrail, and a private EKS API endpoint with SSM bastion access.

## Enterprise feature toggles

Each module exposes flags for the optional LangSmith add-ons. Toggle each in the `tfvars` file before running `make apply`.

* **[LangSmith Deployment](/langsmith/deploy-self-hosted-full-platform)** (`enable_deployments`): Agent Server plus the host-backend, listener, and operator that run and manage deployed agents.
* **[Fleet](/langsmith/fleet)** (`enable_fleet`): The agent-building product, formerly Agent Builder, deployed as a standalone service (chart v0.15+).
* **Insights** (`enable_insights`): ClickHouse-backed analytics.
* **Polly** (`enable_polly`): AI evaluation and monitoring.

## Next steps

* Pick a provider above and follow the deployment guide.
* Review [required dependency versions](/langsmith/self-host-dependency-versions) for PostgreSQL, ClickHouse, Redis, and Kubernetes.
* Plan capacity with the [scaling guide](/langsmith/self-host-scale).
* After the application is running, enable [LangSmith Deployment](/langsmith/deploy-self-hosted-full-platform) to add agent deployment and management to the UI.

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/self-host-terraform.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
