---
title: "Deploy Honcho Memory Server"
description: "Agent memory API with deriver worker and pgvector, JWT auth on by default"
category: "AI/ML"
url: https://railway.com/deploy/honcho-memory-server
---

# Deploy Honcho Memory Server

Agent memory API with deriver worker and pgvector, JWT auth on by default

**[Deploy Honcho Memory Server on Railway](https://railway.com/template/honcho-memory-server)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/honcho-memory-server/manifest.json

- **Creator:** Protemplate
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Postgres https://avatars.githubusercontent.com/u/98363230?v=4

- **Image:** pgvector/pgvector:pg17
- **Start command:** `docker-entrypoint.sh postgres -c "listen_addresses=*" -c "max_connections=200"`

### Honcho Deriver https://raw.githubusercontent.com/plastic-labs/honcho/main/assets/honcho.svg

- **Image:** ghcr.io/plastic-labs/honcho:v3.6.1
- **Start command:** `sh -c 'cd /app; if [ -z "$EMBED_MESSAGES" ]; then if [ -n "$LLM_OPENAI_API_KEY$LLM_GEMINI_API_KEY" ]; then EMBED_MESSAGES=true; else EMBED_MESSAGES=false; fi; export EMBED_MESSAGES; fi; /app/.venv/bin/python scripts/provision_db.py && exec /app/.venv/bin/python -m src.deriver'`

### Honcho https://raw.githubusercontent.com/plastic-labs/honcho/main/assets/honcho.svg

- **Image:** ghcr.io/plastic-labs/honcho:v3.6.1
- **Start command:** `sh -c 'cd /app; if [ -z "$EMBED_MESSAGES" ]; then if [ -n "$LLM_OPENAI_API_KEY$LLM_GEMINI_API_KEY" ]; then EMBED_MESSAGES=true; else EMBED_MESSAGES=false; fi; export EMBED_MESSAGES; fi; exec sh docker/entrypoint.sh'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Honcho Memory Server on Railway

Honcho is an open source memory layer for AI agents by Plastic Labs. Your app stores workspaces, peers, sessions and messages through a REST API, and a background worker reasons over them to build long term memories, peer cards and summaries that agents can query in natural language.

## About Hosting Honcho

Honcho runs as an API server and a background worker (the deriver) that share one Postgres database with pgvector. This template uses the official `ghcr.io/plastic-labs/honcho:v3.6.1` image for both, runs database migrations on boot, and keeps Postgres on Railway's private network. JWT auth is on from the first deploy with a generated signing secret, so the public API never accepts anonymous writes. Redis is optional upstream (cache only) and is left out.

## Common Use Cases

- **Agent memory**: give chatbots and agents durable memory of each user across sessions
- **User modeling**: build peer cards and representations of users and agents from conversations
- **Context retrieval**: fetch session context and summaries sized for your model's window
- **Dialectic queries**: ask Honcho what it knows about a user in plain language
- **Self hosted alternative to Honcho Cloud**: keep conversation data in your own database

## Dependencies for Honcho Hosting

- **PostgreSQL with pgvector**: included (`pgvector/pgvector:pg17` with a volume)
- **LLM API key**: optional at boot. Needed for memory reasoning, summaries, dreams, dialectic chat and embeddings (`LLM_OPENAI_API_KEY`, or other providers via per module settings)

### Deployment Dependencies

- [Honcho self hosting guide](https://docs.honcho.dev/v3/contributing/self-hosting)
- [Honcho configuration guide](https://docs.honcho.dev/v3/contributing/configuration)
- [Honcho GitHub repository](https://github.com/plastic-labs/honcho)

### Implementation Details

```env
PORT=8000
AUTH_USE_AUTH=true
AUTH_JWT_SECRET=${{secret(64,"abcdef0123456789")}}
DB_CONNECTION_URI=postgresql+psycopg://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}
LLM_OPENAI_API_KEY=   # optional
```

First steps after deploy:

1. Open a shell with `railway ssh --service Honcho`, then run `cd /app &amp;&amp; python scripts/generate_jwt.py --admin --print-only` to get an admin key.
2. Call `POST /v3/keys?workspace_id=` with the admin key to mint a key scoped to one workspace for your app.
3. Point the Honcho Python or TypeScript SDK at your Railway domain with that key.
4. Add `LLM_OPENAI_API_KEY` on the Honcho service and redeploy both Honcho services to turn on memory reasoning and message embeddings.

Without an LLM key, Honcho still stores workspaces, peers, sessions and messages; message embeddings stay off until a key is present. Rotating `AUTH_JWT_SECRET` invalidates every issued key.

## Why Deploy Honcho on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Honcho on Railway, you get the API, the deriver worker and pgvector Postgres wired together with generated secrets, auth on by default, health checks, managed SSL and private networking to your agents.


## 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 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/honcho-memory-server
