---
title: "Deploy MemPalace"
description: "Always-on MemPalace AI memory server over HTTP MCP with token auth"
category: "AI/ML"
url: https://railway.com/deploy/deploy-mempalace-mcp-hub
---

# Deploy MemPalace

Always-on MemPalace AI memory server over HTTP MCP with token auth

**[Deploy MemPalace on Railway](https://railway.com/template/deploy-mempalace-mcp-hub)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-mempalace-mcp-hub/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### mempalace https://api.iconify.design/mdi/brain.svg

- **Image:** ghcr.io/onepush-dev/mempalace:3.12.0
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted MemPalace (AI/ML) on Railway

This template runs MemPalace as an always-on, token-protected HTTP MCP hub, so all your AI clients can share one persistent memory palace.

## About Hosting MemPalace open-source software on Railway (self hosted MemPalace template)

MemPalace stores your conversation history as verbatim text and retrieves it with semantic search, and this template keeps that palace on infrastructure you control.

## Why Deploy MemPalace, the self-hosted AI memory MCP hub on Railway

Self-hosting MemPalace on Railway gives you one token-protected HTTP MCP hub that all your AI clients can share. You keep full control of your data.

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 MemPalace 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.

### Railway vs Other Hosting Providers and VPS for MemPalace self hosting

Here is how this MemPalace hub on Railway compares with a general-purpose cloud or VPS.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | A template with the image, HTTPS domain, /data volume, and health checks wired. | Full Droplet control, but you set up the runtime, proxy, TLS, and volume yourself. |
| AWS | A managed service with the volume and domain set from the template. | Broad services and fine-grained IAM, but more to configure before the hub is reachable. |
| Hetzner | The same managed flow with the token generated for you. | Low-cost servers with strong raw resources, but you handle updates and firewalling. |

Railway trades some low-level control for a faster path to a running, token-protected MCP endpoint.

## Common Use Cases for hosted MemPalace

- **Verbatim team memory:** Store meeting notes, design decisions and runbook excerpts exactly as written, so a later search returns the original wording rather than a paraphrase.
- **Semantic search across projects:** Run natural-language queries like "why did we switch to GraphQL" against everything mined into the palace, scoped by wing or room.
- **Knowledge graph of people and systems:** Track entities and their relationships with validity windows, then query what was true at a given point in time.
- **One memory shared by many clients:** Point Claude Code, Cursor and Codex at the same HTTPS /mcp endpoint so every tool reads from one palace.
- **Token-protected MCP access:** Expose the 47 MCP tools over HTTP behind a bearer token, keeping the hub private while still reachable from your own machines.

## Dependencies for MemPalace Docker hosted on Railway

This template runs MemPalace as one always-on service with one volume for persistent state. Keep one replica, because the palace data lives on that single volume.

### Deployment Dependencies for Managed MemPalace Service (one service: the MemPalace hub on port 8080 with a public domain, a volume at /data, and health check /healthz (timeout 300 seconds); restart policy Always; keep one replica because of the volume)

The template creates one service with a public domain on port 8080, a volume at /data, and a /healthz check with a 300 second timeout. The restart policy is Always.

Template variable (generated, no inputs):

- **MEMPALACE_MCP_HTTP_TOKEN** (48 characters): the Bearer token every MCP client sends to reach /mcp and /statusz. Keep it secret. /healthz is public.

### Implementation Details for MemPalace (ghcr.io/onepush-dev/mempalace:3.12.0 is the unmodified upstream ghcr.io/mempalace/mempalace:3.12.0 image (app unchanged) plus railway/start.sh, which creates /data, chowns it to uid 1000, refuses to start without MEMPALACE_MCP_HTTP_TOKEN, then setpriv to uid 1000 and runs mempalace serve --host 0.0.0.0 --port 8080; baked ENV is MEMPALACE_MCP_IDLE_HOURS=0 (the hub does not exit when idle) and MEMPALACE_SERVE_PORT=8080)

The image is the unmodified upstream image with railway/start.sh added. It then drops to uid 1000 and runs the server. The baked environment keeps the hub running when idle.

## How does MemPalace compare against other tools

### MemPalace vs the existing Railway template at /deploy/mempalace (Existing Railway Template Alternative)

- **Packaging:** This listing is independent community packaging of MemPalace/mempalace v3.12.0, not affiliated with or endorsed by the MemPalace authors, and distinct from the template at /deploy/mempalace.
- **Access control:** A MEMPALACE_MCP_HTTP_TOKEN is generated per deploy and required as an Authorization Bearer header for /mcp and /statusz, while /healthz stays public.
- **Hub behavior:** The idle watchdog is off with MEMPALACE_MCP_IDLE_HOURS=0, so the hub stays up when idle.

### MemPalace vs a local stdio MCP memory server (Local Stdio MCP Alternative)

- **Sharing:** A local stdio server serves one machine, while this hub is one HTTP MCP endpoint that several AI clients can share.
- **Persistence:** The palace and embedding-model cache live on a Railway volume at /data, so memory survives restarts without depending on one laptop.
- **Setup effort:** A local stdio server is quicker to start for one user, with no hosting or token to manage.

### MemPalace with Docker vs Railway (Docker and Railway Alternative)

- **Control:** Running the image yourself with Docker gives direct control over volumes, networking and the host, which Railway abstracts away.
- **Hosting effort:** On Railway the template supplies the public HTTPS domain, the /data volume and the /healthz health check without extra configuration.
- **Replicas:** Keep one replica on Railway, because the volume holds local persistent state.

### Railway vs Self-Run Docker Host for MemPalace (Railway Alternative)

- **Cost model:** Railway is usage-based, while a self-run Docker host is a machine you already pay for and operate yourself.
- **Operations:** Railway handles the platform layer, while a self-run host leaves patching and uptime to you.

## How to use MemPalace on Railway?

1. Copy MEMPALACE_MCP_HTTP_TOKEN from the Variables tab and keep it secret.
2. Point your MCP client at your Railway HTTPS domain plus /mcp, sending the token as an Authorization Bearer header:

```bash
claude mcp add --transport http mempalace https://YOUR-RAILWAY-DOMAIN/mcp --header "Authorization: Bearer TOKEN"
```

3. There is no web UI. Browser requests with a non-loopback Origin are refused, but MCP clients that send no Origin work.
4. Check /healthz without a token, then /statusz with the token.
5. Expect the first write to be slow, since it downloads the about 80 MB MiniLM model into /data/.cache.
6. Storage is embedded ChromaDB on the volume, so no Qdrant service is required.
7. Keep one replica, because the volume holds local persistent state.

## How to self host MemPalace on other VPS Services (MemPalace self hosting guide)

Run the upstream container image or a local install, give it a data directory and a bearer token, and start it with `mempalace serve`. Put HTTPS in front of it if you expose it.

### Clone the Repository

Fetch the release this template packages.

```bash
git clone --branch v3.12.0 https://github.com/MemPalace/mempalace.git
cd mempalace
```

### Install Dependencies

Install into an isolated environment, or skip this and use the published container image.

```bash
python -m venv .venv && source .venv/bin/activate
pip install -e .
```

### Configure Environment Variables

Set a data directory and a bearer token. Keep the token secret, since every MCP client must send it.

```bash
export MEMPALACE_MCP_HTTP_TOKEN="$(openssl rand -hex 24)"
export HOME=/srv/mempalace-data
export MEMPALACE_MCP_IDLE_HOURS=0
```

### Start the MemPalace Application

Start the HTTP MCP server, then place an HTTPS reverse proxy in front of it at your-domain. Railway handles the HTTPS domain, the volume and restarts for you.

```bash
mempalace serve --host 0.0.0.0 --port 8080
```

## Pricing and License of MemPalace (MemPalace pricing)

MemPalace is MIT-licensed open-source software, so you can self-host it for free. Check the upstream license file in the repository for the full terms before you rely on it.

## MemPalace hosted vs self hosted comparison (Pricing, features, costs, and more)

MemPalace is free MIT software, and the pinned v3.12.0 release does not describe a hosted plan.

### Monthly cost of self hosting MemPalace on Railway

Railway bills on usage, so the monthly cost depends on how much RAM and CPU the hub uses, how large the volume at /data grows, and which other services you attach.

### System Requirements for Hosting MemPalace on a VPS

Running MemPalace on a VPS needs enough RAM and disk for the embedded ChromaDB store, the MiniLM embedding model of about 80 MB, and the Python runtime.

## Frequently Asked Questions (FAQs)

### How do I connect a client to my MemPalace hub?

Point your MCP client at your Railway HTTPS domain with /mcp on the end, and send MEMPALACE_MCP_HTTP_TOKEN as an Authorization Bearer header.

### Is there a web UI?

No. This listing is an HTTP MCP endpoint, not a web app. Browser requests with a non-loopback Origin are refused by a DNS-rebinding guard, so use an MCP client instead.

### Why does the first write take so long?

The first write downloads the about 80 MB MiniLM embedding model into /data/.cache. Later writes reuse the cached model, so the slow start only happens once per volume.

### Is this the same as the existing /deploy/mempalace template?

No. This listing packages MemPalace/mempalace v3.12.0 with bearer-token auth and an always-on hub.

### What should I back up?

Back up the /data volume, which holds the palace, config and cached model.


## 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/deploy-mempalace-mcp-hub
