---
title: "Deploy Letta"
description: "Stateful AI agent server with memory, token-protected"
category: "AI/ML"
url: https://railway.com/deploy/letta-1
---

# Deploy Letta

Stateful AI agent server with memory, token-protected

**[Deploy Letta on Railway](https://railway.com/template/letta-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/letta-1/manifest.json

- **Creator:** zer0person's Projects
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

### Letta

- **Image:** letta/letta:latest
- **Start command:** `sh -c 'printf "%s" "$LETTA_APP_SERVER_TOKEN" > /tmp/app-server-token; exec letta server --backend local --listen ws://0.0.0.0:4500 --ws-auth capability-token --ws-token-file /tmp/app-server-token'`
- **Public domain:** Yes

## Documentation

# Deploy and Host Letta on Railway

[Letta](https://github.com/letta-ai/letta) (formerly MemGPT) builds stateful agents with long-term memory that learn and improve over time.

## About Hosting Letta

This template runs the official `letta/letta:latest` image as the Letta App Server (WebSocket) with agent state on a persistent volume at `/root/.letta`. Access requires a capability token: a random `LETTA_APP_SERVER_TOKEN` is generated into the service variables (read it in the Variables tab). Add your model provider key (for example `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`) as a service variable after deploying. Connect Letta Code or the Letta Agent SDK to `wss://` with the token. Agents can run shell commands on this service, so keep the token private.

## Common Use Cases

- Run a self-hosted Letta app server for your agents
- Agents with persistent memory across conversations
- Connect the Letta Agent SDK or Letta Code to a remote server

## Dependencies for Letta Hosting

- One service with a volume; nothing else

### Deployment Dependencies

- [Letta on GitHub](https://github.com/letta-ai/letta)
- [Docker image](https://hub.docker.com/r/letta/letta)

## Why Deploy Letta on Railway?

Railway gives you a public HTTPS URL, persistent storage where needed and automatic restarts with no server to maintain. Check `/readyz` on the public URL to confirm the server is up.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/letta-1
