---
title: "Deploy open-glean"
description: "Self-hosted AI knowledge workspace with Hydra DB search and citations"
category: "AI/ML"
url: https://railway.com/deploy/open-glean
---

# Deploy open-glean

Self-hosted AI knowledge workspace with Hydra DB search and citations

**[Deploy open-glean on Railway](https://railway.com/template/open-glean)**

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

- **Creator:** kmaki's Projects
- **Category:** AI/ML

## Template content

### open-glean

- **Image:** xiaosong233/open-glean-railway:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Open Glean on Railway

Open Glean is a self-hosted AI workspace for knowledge work. It connects to Hydra DB, retrieves relevant memories and files, and produces cited answers through a modern browser interface. Deep Research, collections, context management, integrations, mindmaps, and OpenAI-compatible model support make it a practical second brain for teams and individuals.

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/open-glean)

## About Hosting Open Glean on Railway

Railway runs the official Open Glean production container as a single HTTP service with automatic HTTPS, a generated public domain, environment variables, logs, and managed deployments. The template uses a pre-built Docker image and does not perform a source-code or Railpack build at deployment time.

## Tech Stack

- Next.js 16 standalone server
- React 19
- Tailwind CSS v4
- Hydra DB SDK for retrieval and integrations
- OpenAI-compatible LLM providers, including OpenRouter
- Optional MongoDB or DocumentDB-compatible chat persistence
- Docker on Railway

## Why Deploy Open Glean on Railway

Railway provides a fast one-click path to a private, self-hosted AI workspace with HTTPS and simple configuration. The service is ready to run immediately, while optional Hydra, LLM, and MongoDB settings can be added as environment variables without changing the image. Logs, redeploys, and runtime configuration are available from one project dashboard.

## Common Use Cases

- Search and ask questions across Hydra DB memories and files
- Run cited Deep Research workflows
- Host a team knowledge workspace behind a Railway domain
- Connect Hydra integrations and browse collections
- Use OpenRouter or another OpenAI-compatible model for answer synthesis
- Run a lightweight deployment with browser-local chat fallback when MongoDB is not configured

## Deployment Notes

The service listens on container port 3000 and Railway routes the generated domain to that port through `PORT=3000`. The image's own `node server.js` command is preserved; no custom start command is required. `OPEN_GLEAN_SESSION_SECRET` is generated automatically by the template and is required for production session-cookie encryption. `HYDRA_BASE_URL` defaults to `https://api.hydradb.com`. Add `HYDRA_API_KEY` for a deployment-level Hydra key, or users can enter their key in Settings. Add `OPENROUTER_API_KEY` and `OPEN_GLEAN_LLM_MODEL` to enable server-level answer synthesis. `MONGODB_URI` and optional `MONGODB_PROXY_KEY` enable chat persistence; without them, the app uses browser localStorage. No volume is mounted by default because the default persistence mode is browser-local and the container image is non-root.

### Template Variables

| Variable | Default | Purpose |
|----------|---------|---------|
| `PORT` | `3000` | Railway HTTP routing port |
| `OPEN_GLEAN_SESSION_SECRET` | `${{secret(32)}}` | Encrypts session cookies and signs browser subjects |
| `HYDRA_BASE_URL` | `https://api.hydradb.com` | Hydra DB API endpoint |
| `MONGODB_DB` | `open_glean` | MongoDB database name when persistence is configured |
| `OPEN_GLEAN_MAX_CONCURRENT_RESEARCH` | `3` | Concurrent Deep Research runs |
| `HYDRA_API_KEY` | unset | Optional shared Hydra DB API key |
| `OPENROUTER_API_KEY` | unset | Optional server-level LLM API key |
| `OPEN_GLEAN_LLM_MODEL` | unset | Optional default model identifier |
| `MONGODB_URI` | unset | Optional MongoDB or DocumentDB-compatible URI |
| `MONGODB_PROXY_KEY` | unset | Optional Lambda proxy shared secret |

## Dependencies for Open Glean on Railway

Open Glean is deployed as one web service. Hydra DB and an LLM provider are external integrations configured by environment variables; MongoDB is optional for server-side chat persistence. No additional Railway service is required for the default browser-local persistence mode.

### Deployment Dependencies

| Service | Image | Port | Volume |
|---------|-------|------|--------|
| open-glean | xiaosong233/open-glean-railway:latest | 3000 | - |
| Hydra DB | external `https://api.hydradb.com` | 443 | - |
| MongoDB | external, optional | 27017 | - |


## 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/open-glean
