Deploy LongMemory

Persistent memory for LLM apps and agents, with MCP and a dashboard

Deploy LongMemory

Deploy and Host LongMemory on Railway

LongMemory is an open-source persistent memory store for LLM applications. It gives assistants and agents somewhere to remember things between sessions, through a REST API and an MCP endpoint that Claude Desktop, GitHub Copilot, Codex and other MCP clients connect to directly.

About Hosting LongMemory

This template deploys two services: the memory server and its web dashboard. There is no external database to run, because LongMemory keeps everything in SQLite on a volume, which makes this a genuinely small deployment for what it does. The server gets a public HTTPS domain so MCP clients can reach it, the dashboard gets its own, and the two talk over Railway's private network. An API key is generated for you and the server refuses to start without one, so the deployment is never briefly open while you configure it.

One thing is worth doing before you rely on it. LongMemory can use OpenAI, Gemini, AWS Bedrock or Ollama for embeddings, and none of them is required, but without one it falls back to a built-in provider that hashes words into vectors. That never raises an error, so it looks like it is working, yet only queries repeating a memory's actual words retrieve it reliably. Set an embedding key on the server and recall becomes semantic; until you do, every boot logs a warning saying so.

Common Use Cases

  • Give Claude Desktop, Copilot or Codex a shared memory that survives across sessions and machines.
  • Keep an agent's long-term memory on infrastructure you control rather than a hosted memory SaaS.
  • Browse, search and prune what your assistants have remembered through the included dashboard.

Dependencies for LongMemory Hosting

  • A volume for the SQLite database, which the template creates.
  • Optionally an embedding provider key (OpenAI, Gemini or AWS Bedrock) for semantic recall.
  • An MCP-capable client, if you want to connect one rather than use the REST API.

Deployment Dependencies

Implementation Details

Two services build from this template's repository, each from its own directory:

  • longmemory — the server, built from upstream source at the commit of release v2.0.1. Upstream publishes no pullable image, and its tags and package versions disagree, so both Dockerfiles fetch one commit and assert its SHA. It listens dual-stack, keeps its database in a subdirectory of the volume because a Railway volume root holds a root-owned lost+found, and drops privileges after preparing that directory. Healthcheck on /health; MCP on /mcp.
  • dashboard — the upstream Next.js dashboard behind a password. It reads the API key server-side and proxies requests through its own route, so the key never reaches the browser. Next.js listens on loopback only; Caddy in the same container is the only listener and asks for the password. Healthcheck on /api/settings, answered for Railway's probe only.

After deploying, open the dashboard's URL and sign in as admin with the DASHBOARD_PASSWORD from the dashboard service's variables; the template generates it. To connect an MCP client, point it at the longmemory service's domain with /mcp appended and send LONGMEMORY_API_KEY as a bearer token. There are two access boundaries and both are generated: the API key for the server, and the dashboard password, which matters as much because the dashboard calls the API with the key on behalf of whoever is signed in. Anyone holding either can read and write every memory, and the user_id field on the API is metadata rather than a tenancy boundary, so recalls are not separated by it.

Telemetry is disabled in this template; upstream enables it by default.

Why Deploy LongMemory 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 LongMemory on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
118
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
6