---
title: "Deploy Ownstate"
description: "Self-hosted institutional memory and context for secure AI agents."
category: "AI/ML"
url: https://railway.com/deploy/ownstate
---

# Deploy Ownstate

Self-hosted institutional memory and context for secure AI agents.

**[Deploy Ownstate on Railway](https://railway.com/template/ownstate)**

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

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

## Template content

### Worker https://devicons.railway.com/i/rust.svg

- **Source:** https://github.com/aibunny/ownstate

### pgvector https://devicons.railway.com/i/postgresql.svg

- **Image:** pgvector/pgvector:pg18

### API https://devicons.railway.com/i/rust.svg

- **Source:** https://github.com/aibunny/ownstate
- **Health check:** /ready
- **Public domain:** Yes

## Documentation

# Deploy and Host Ownstate on Railway

Ownstate is a self-hosted institutional memory and context layer for AI agents. It records evidence, resolves repository and project scope, retrieves relevant knowledge, and keeps durable state outside any individual model runtime.

## About Hosting Ownstate

This template deploys the complete production topology: a public Rust API, a private background worker, and a private PostgreSQL 18 database with pgvector. Railway generates independent API, admin, and database credentials, connects services over its private network, and attaches persistent volumes for database data and Fastembed model caches. The API runs migrations and exposes `/ready` for deployment health checks. The worker processes asynchronous knowledge jobs without a public endpoint.

## Common Use Cases

- Give Codex, Claude, OpenCode, and other agents durable project context through Ownstate.
- Preserve evidence, decisions, artifacts, and institutional knowledge across sessions and model changes.
- Run a private memory service without depending on proprietary Ownstate infrastructure or a hosted model provider.

## Dependencies for Ownstate Hosting

- A Railway account with capacity for three services and persistent volumes.
- A local MCP client for Ownstate’s stdio MCP binary; the Railway template exposes the HTTP API, not the stdio process.

## Security and Operations

Only the API is public. Keep pgvector and the worker private, give routine clients only `OWNSTATE_API_TOKEN`, and reserve `OWNSTATE_ADMIN_TOKEN` for explicit human administration. Enable Railway backups before storing important data. Ownstate intentionally exposes no MCP or model-controlled operation that deletes recorded evidence.

## Why Deploy Ownstate on Railway?

Railway provisions the application, worker, private pgvector database, generated credentials, health checks, and durable storage together. After deployment, copy the API domain and routine API token into your trusted client configuration, verify `/ready`, and connect your MCP client.

## 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/ownstate
