---
title: "Deploy DSH + LongMemory"
description: "DSH, DeepSeek's coding agent, with LongMemory as its MCP memory server"
category: "AI/ML"
url: https://railway.com/deploy/dsh-longmemory
---

# Deploy DSH + LongMemory

DSH, DeepSeek's coding agent, with LongMemory as its MCP memory server

**[Deploy DSH + LongMemory on Railway](https://railway.com/template/dsh-longmemory)**

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

- **Creator:** Paul Zarudnev's Projects
- **Category:** AI/ML

## Template content

### dsh

- **Source:** https://github.com/RockinPaul/dsh_railway_template
- **Health check:** /up
- **Public domain:** Yes

### longmemory

- **Source:** https://github.com/RockinPaul/longmemory_railway_template
- **Health check:** /health

## Documentation

# Deploy and Host DSH with LongMemory on Railway

[DSH](https://github.com/deepseek-ai/deepseek-harness) is DeepSeek Harness, DeepSeek's open-source
coding agent: a model that reads your files, runs shell commands and keeps working through a long
task, with a browser UI. This template runs DSH 0.1.5-rc.1 on Railway and pairs it with a
[LongMemory](https://github.com/CaviraOSS/LongMemory) server as an MCP tool server, so the agent
can recall, store decisions and track task state across sessions. Built on DeepSeek Harness; not
affiliated with or endorsed by DeepSeek.

## About Hosting DSH

DSH's web surface is built to run on your own machine: it binds loopback only and refuses to listen
on all interfaces. This template therefore puts Caddy in the same container, answering the platform
health check itself and forwarding to the harness. The forwarding has one non-negotiable property —
the browser's `Host` header passes through untouched — because DSH checks every API call and
WebSocket against a trust fence that requires the request `Host` to be a trusted authority and any
`Origin` to match it. The template registers your Railway domain as trusted at boot.

Sign-in is DSH's own. Each start prints a one-time URL carrying a token; opening it sets a signed
30-day cookie. That cookie's signing secret lives on the volume, so a redeploy prints a new token but
does not sign you out. Your workspace, sessions, settings, credentials and any toolchain you install
also live on the volume.

## Common Use Cases

- Run a coding agent on a machine that stays awake, and check on it from any browser.
- Give the agent memory that outlives a session: decisions, task state and project context stored
  in LongMemory and recalled through MCP tools.
- Keep a project's toolchain and repositories in one persistent place, separate from your laptop.

## Dependencies for DSH Hosting

- A **DeepSeek API key**, set at deploy time or later under *Settings → Models*.
- Two volumes, created by the template: one for the agent's home and workspace, one for
  LongMemory's database.
- Optionally, an OpenAI or Gemini key on the `longmemory` service for semantic recall. Without one,
  LongMemory matches on shared words rather than meaning, and says so in its log.

### Deployment Dependencies

- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — upstream project (MIT);
  [documentation](https://deepseek-harness.github.io/deepseek-harness/).
- [LongMemory](https://github.com/CaviraOSS/LongMemory) — memory server (Apache-2.0).
- [Template repository](https://github.com/RockinPaul/dsh_railway_template) (MIT) and the
  [LongMemory template repository](https://github.com/RockinPaul/longmemory_railway_template) it
  builds the memory service from.
- [Caddy](https://caddyserver.com) (Apache-2.0) and [mise](https://mise.jdx.dev) (MIT).

### Implementation Details

Two services:

- **dsh** — the only public service. `node:22-bookworm-slim` with `@deepseek-ai/dsh` 0.1.5-rc.1
  installed from npm (the package hard-depends on the built web frontend), the Caddy 2.11 binary,
  and mise for toolchains. Health check `/up`, answered by Caddy. Volume at `/data` holding the
  home directory, the harness home, the workspace, the npm prefix and mise data. Runs as an
  unprivileged user whose home is on the volume.
- **longmemory** — private, no public domain. Built from a pinned upstream commit, SQLite on its own
  `/data` volume, health check `/health`. Its API key is generated per deployment and handed to
  `dsh` as a service reference, along with its private-network address.

The LongMemory connection is a Cordis configuration overlay applied at boot when the service
reference is present. The MCP client negotiates at startup and exposes thirteen tools to the model
as `mcp__longmemory__*` — recall, ingest, remember a decision, update task state, explain, code
graph and more. If LongMemory is still starting, the harness comes up without those tools and
reconnects with backoff.

**First run:** open the `dsh` service's deploy logs, find the `dsh web:` line, and open
`https:///?token=…` with its token. If you left the key blank, paste it under
*Settings → Models*. An optional edge gate adds HTTP basic auth in front of DSH's sign-in when you
set `DSH_GATE_PASSWORD` on the service.

Three things to know. Upstream has shipped only alphas and release candidates so far, and releases
land every few days; the pinned version moves accordingly. Running sessions end on redeploy — files
survive, in-flight agent turns do not. And the token exchange, the fence and the MCP client were all
measured against the running service: an unauthenticated index request is 401, a foreign `Host` or
`Origin` on the API is 403, and a cookie issued before a redeploy authenticates after it.

## Why Deploy DSH 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 DSH 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.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/dsh-longmemory
