LangGraph Cloud vs self-hosted
LangGraph Cloud for hassle-free, scalable AI agent orchestration with managed infrastructure and automatic updates. Choose self-hosted LangGraph for full control, customization, and data privacy by running the system on your own servers.VERDICT
LangGraph Cloud is the winner due to ease of use and scalability; use self-hosted LangGraph when you require strict data control or custom integrations.| Option | Key strength | Pricing | API access | Best for |
|---|---|---|---|---|
| LangGraph Cloud | Managed service, auto-scaling, zero maintenance | Subscription-based | Fully managed API endpoint | Rapid deployment, scalability, minimal ops |
| Self-hosted LangGraph | Full control, customizable, data privacy | Free (self-managed infrastructure costs) | Local or private network API | Sensitive data, custom environments |
| LangGraph Cloud | Automatic updates and backups | Included in subscription | Cloud-hosted API with SLA | Teams without DevOps resources |
| Self-hosted LangGraph | Custom integrations and extensions | No direct cost, infrastructure dependent | Direct access to source and runtime | Advanced customization and compliance |
Key differences
LangGraph Cloud offers a fully managed, scalable platform with automatic updates and maintenance, removing operational overhead. Self-hosted LangGraph requires you to deploy and manage the runtime yourself, providing full control over data, environment, and customization. Cloud is subscription-based with SLA-backed API access, while self-hosted is free software but incurs infrastructure costs.
Cloud example usage
Using LangGraph Cloud involves invoking the cloud-hosted API with your API key, enabling quick startup without infrastructure setup.
from langgraph.graph import StateGraph, END
import os
class State(dict):
pass
def my_node(state: State) -> State:
return {"messages": state.get("messages", []) + ["Hello from Cloud"]}
graph = StateGraph(State)
graph.add_node("my_node", my_node)
graph.set_entry_point("my_node")
graph.add_edge("my_node", END)
app = graph.compile(cloud_api_key=os.environ["LANGGRAPH_CLOUD_API_KEY"])
result = app.invoke({"messages": []})
print(result) {'messages': ['Hello from Cloud']} Self-hosted example usage
With self-hosted LangGraph, you run the server locally or on your infrastructure, then invoke the compiled graph directly without cloud dependencies.
from langgraph.graph import StateGraph, END
from langgraph.savers import MemorySaver
class State(dict):
pass
def my_node(state: State) -> State:
return {"messages": state.get("messages", []) + ["Hello from Self-hosted"]}
graph = StateGraph(State)
graph.add_node("my_node", my_node)
graph.set_entry_point("my_node")
graph.add_edge("my_node", END)
# Use MemorySaver for persistence if needed
app = graph.compile(checkpointer=MemorySaver())
result = app.invoke({"messages": []})
print(result) {'messages': ['Hello from Self-hosted']} When to use each
Use LangGraph Cloud when you want fast setup, automatic scaling, and minimal maintenance. Choose self-hosted LangGraph if you need full control over data, want to customize deeply, or must comply with strict security policies.
| Scenario | Recommended Option | Reason |
|---|---|---|
| Startup or small team | LangGraph Cloud | No infrastructure management, quick launch |
| Enterprise with compliance needs | Self-hosted LangGraph | Data privacy and environment control |
| Custom integrations or extensions | Self-hosted LangGraph | Full access to runtime and source |
| Scaling with fluctuating demand | LangGraph Cloud | Automatic scaling and uptime guarantees |
Pricing and access
| Option | Free | Paid | API access |
|---|---|---|---|
| LangGraph Cloud | No | Subscription plans | Cloud-hosted API with SLA |
| Self-hosted LangGraph | Yes (software) | Infrastructure costs only | Local/private API endpoint |
Key Takeaways
-
LangGraph Cloudis best for rapid deployment and scaling without infrastructure overhead. -
Self-hosted LangGraphoffers maximum control and customization for sensitive or complex environments. - Choose based on your team's operational capacity, compliance requirements, and customization needs.