|
| 1 | +--- |
| 2 | +title: Deploy with control plane |
| 3 | +sidebarTitle: With control plane |
| 4 | +icon: "cloud-arrow-up" |
| 5 | +--- |
| 6 | + |
| 7 | +This guide shows you how to deploy your applications to [hybrid](/langsmith/hybrid) or [self-hosted](/langsmith/self-hosted) instances with a [control plane](/langsmith/control-plane). With a control plane, you build Docker images locally, push them to a registry that your Kubernetes cluster has access to, and deploy them with the [LangSmith UI](https://smith.langchain.com). |
| 8 | + |
| 9 | +<Note> |
| 10 | +**This guide is for deploying applications, not setting up infrastructure.** |
| 11 | + |
| 12 | +Before using this guide, you must have already completed infrastructure setup: |
| 13 | +- **[Hybrid setup](/langsmith/deploy-hybrid)**: For hybrid hosting. |
| 14 | +- **[Self-hosted with deployment setup](/langsmith/deploy-self-hosted-full-platform)**: For self-hosted with control plane. |
| 15 | + |
| 16 | +If you haven't set up your infrastructure yet, start with the [Hosting section](/langsmith/hosting). |
| 17 | +</Note> |
| 18 | + |
| 19 | +## Overview |
| 20 | + |
| 21 | +Applications deployed to hybrid or self-hosted LangSmith instances with control plane use Docker images. In this guide, the application deployment workflow is: |
| 22 | + |
| 23 | +1. Test your application locally using `langgraph dev` or [Studio](/langsmith/studio). |
| 24 | +1. Build a Docker image using the `langgraph build` command. |
| 25 | +1. Push the image to a container registry accessible by your infrastructure. |
| 26 | +1. Deploy from the [control plane UI](/langsmith/control-plane#control-plane-ui) by specifying the image URL. |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +Before completing this guide, you'll need the following: |
| 31 | + |
| 32 | +- Completed infrastructure setup to enable your [data plane](/langsmith/data-plane) to receive application deployments: |
| 33 | + - [Hybrid setup](/langsmith/deploy-hybrid): Installs data plane components (listener, operator, CRDs) in your Kubernetes cluster that connect to LangChain's managed control plane. |
| 34 | + - [Self-hosted with deployment setup](/langsmith/deploy-self-hosted-full-platform): Enables deployment management on your self-hosted LangSmith instance. |
| 35 | +- Access to the [LangSmith UI](https://smith.langchain.com) with deployment management enabled. |
| 36 | +- A container registry accessible by your Kubernetes cluster. |
| 37 | + |
| 38 | +## Step 1. Test locally |
| 39 | + |
| 40 | +Before deploying, test your application locally. You can use the [LangGraph CLI](/langsmith/cli#dev) to run a LangGraph server in development mode: |
| 41 | + |
| 42 | +```bash |
| 43 | +langgraph dev |
| 44 | +``` |
| 45 | + |
| 46 | +For a full guide local testing, refer to the [Local server quickstart](/langsmith/local-server). |
| 47 | + |
| 48 | +## Step 2. Build Docker image |
| 49 | + |
| 50 | +Build a Docker image of your application using the [`langgraph build`](/langsmith/cli#build) command: |
| 51 | + |
| 52 | +```bash |
| 53 | +langgraph build -t my-image |
| 54 | +``` |
| 55 | + |
| 56 | +Build command options include: |
| 57 | + |
| 58 | +| Option | Default | Description | |
| 59 | +|--------|---------|-------------| |
| 60 | +| `-t, --tag TEXT` | Required | Tag for the Docker image | |
| 61 | +| `--platform TEXT` | | Target platform(s) to build for (e.g., `linux/amd64,linux/arm64`) | |
| 62 | +| `--pull / --no-pull` | `--pull` | Build with latest remote Docker image | |
| 63 | +| `-c, --config FILE` | `langgraph.json` | Path to configuration file | |
| 64 | + |
| 65 | +Example with platform specification: |
| 66 | + |
| 67 | +```bash |
| 68 | +langgraph build --platform linux/amd64 -t my-image:v1.0.0 |
| 69 | +``` |
| 70 | + |
| 71 | +For full details, see the [CLI reference](/langsmith/cli#build). |
| 72 | + |
| 73 | +## Step 3. Push to container registry |
| 74 | + |
| 75 | +Push your image to a container registry accessible by your Kubernetes cluster. The specific commands depend on your registry provider. |
| 76 | + |
| 77 | +<Tip> |
| 78 | +Tag your images with version information (e.g., `my-registry.com/my-app:v1.0.0`) to make rollbacks easier. |
| 79 | +</Tip> |
| 80 | + |
| 81 | +## Step 4. Deploy with the control plane UI |
| 82 | + |
| 83 | +The [control plane UI](/langsmith/control-plane#control-plane-ui) allows you to create and manage deployments, view logs and metrics, and update configurations. To create a new deployment in the [LangSmith UI](https://smith.langchain.com): |
| 84 | + |
| 85 | +1. In the left-hand navigation panel, select **Deployments**. |
| 86 | +1. In the top-right corner, select **+ New Deployment**. |
| 87 | +1. In the deployment configuration panel, provide: |
| 88 | + - **Image URL**: The full image URL you pushed in [Step 3](#step-3-push-to-container-registry). |
| 89 | + - **Listener/Compute ID**: Select the listener configured for your infrastructure. |
| 90 | + - **Namespace**: The Kubernetes namespace to deploy to. |
| 91 | + - **Environment variables**: Any required configuration (API keys, etc.). |
| 92 | + - Other deployment settings as needed. |
| 93 | +1. Select **Submit**. |
| 94 | + |
| 95 | +The control plane will coordinate with your [data plane](/langsmith/data-plane) listener to deploy your application. |
| 96 | + |
| 97 | +After creating a deployment, the infrastructure is [provisioned asynchronously](/langsmith/control-plane#asynchronous-deployment). Deployment can take up to several minutes, with initial deployments taking longer due to database creation. |
| 98 | + |
| 99 | +From the control plane UI, you can view build logs, server logs, and deployment metrics including CPU/memory usage, replicas, and API performance. For more details, refer to the [control plane monitoring documentation](/langsmith/control-plane#monitoring). |
| 100 | + |
| 101 | +<Note> |
| 102 | +A [LangSmith Observability tracing project](/langsmith/observability) is automatically created for each deployment with the same name as the deployment. Tracing environment variables are set automatically by the control plane. |
| 103 | +</Note> |
| 104 | + |
| 105 | +## Update deployment |
| 106 | + |
| 107 | +To deploy a new version of your application, create a [new revision](/langsmith/control-plane#revisions): |
| 108 | + |
| 109 | +Starting from the LangSmith UI: |
| 110 | + |
| 111 | +1. In the left-hand navigation panel, select **Deployments**. |
| 112 | +1. Select an existing deployment. |
| 113 | +1. In the Deployment view, select **+ New Revision** in the top-right corner. |
| 114 | +1. Update the configuration: |
| 115 | + - Update the **Image URL** to your new image version. |
| 116 | + - Update environment variables if needed. |
| 117 | + - Adjust other settings as needed. |
| 118 | +1. Select **Submit**. |
| 119 | + |
| 120 | +## Next steps |
| 121 | + |
| 122 | +- **[Control plane](/langsmith/control-plane)**: Learn more about control plane features. |
| 123 | +- **[Data plane](/langsmith/data-plane)**: Understand data plane architecture. |
| 124 | +- **[Observability](/langsmith/observability)**: Monitor your deployments with automatic tracing. |
| 125 | +- **[Studio](/langsmith/studio)**: Test and debug deployed applications. |
| 126 | +- **[LangGraph CLI](/langsmith/cli)**: Full CLI reference documentation. |
0 commit comments