---
title: "Deploy SlashDocs + Postgres + Dex"
description: "Agent-published HTML docs with review UI, Postgres, S3 and Dex login"
category: "AI/ML"
url: https://railway.com/deploy/slashdocs-postgres-dex
---

# Deploy SlashDocs + Postgres + Dex

Agent-published HTML docs with review UI, Postgres, S3 and Dex login

**[Deploy SlashDocs + Postgres + Dex on Railway](https://railway.com/template/slashdocs-postgres-dex)**

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

- **Creator:** Protemplate
- **Category:** AI/ML
- **Total deploys:** 3

## Template content

### Render https://avatars.githubusercontent.com/u/7713209?v=4

- **Image:** caddy:2.11-alpine
- **Start command:** `sh -c 'exec caddy reverse-proxy --from :8080 --to "http://$UPSTREAM"'`
- **Health check:** /readyz
- **Public domain:** Yes

### Dex https://raw.githubusercontent.com/dexidp/dex/master/docs/logos/dex-glyph-color.png

- **Image:** dexidp/dex:v2.46.0-alpine
- **Start command:** `sh -c 'echo e3stIC8qIERleCBjb25maWcgZm9yIHRoZSBSYWlsd2F5IHRlbXBsYXRlLiBSZW5kZXJlZCBieSB0aGUgZGV4IGltYWdlIGVudHJ5cG9pbnQgdGhyb3VnaCBnb21wbGF0ZSAqLyAtfX0Ke3stIC8qIChhbnkgLnlhbWwgcGFzc2VkIHRvIGBkZXggc2VydmVgIGlzIHRlbXBsYXRlZCwgY3dkIC9ldGMvZGV4LCBvdXRwdXQgaW4gL3RtcCkuIFNhbWUgc3R5bGUgYXMgKi8gLX19Cnt7LSAvKiB1cHN0cmVhbSBjb25maWcuZG9ja2VyLnlhbWwuIFN0YXRpYyBwYXNzd29yZHMgbXVzdCBiZSBiY3J5cHQ7IGdvbXBsYXRlIGhhc2hlcyB0aGUgZ2VuZXJhdGVkICovIC19fQp7ey0gLyogREVYX0FETUlOX1BBU1NXT1JEIGF0IGJvb3QuIFN0b3JhZ2UgaXMgbWVtb3J5OiBEZXggb25seSBicm9rZXJzIGxvZ2lucywgc2xhc2hkb2NzIGtl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A4YTg2ODRiLWRiODgtNGI3My05MGE5LTNjZDE2NjFmNTQ2Ngo= | base64 -d > /etc/dex/config.yaml && exec docker-entrypoint dex serve /etc/dex/config.yaml'`
- **Health check:** /dex/healthz
- **Public domain:** Yes

### SlashDocs https://avatars.githubusercontent.com/u/7713209?v=4

- **Image:** razorpay/slashdocs:0.1.1
- **Start command:** `sh -c 'i=0; until wget -q -O /dev/null "$SLASHDOCS_OIDC_INTERNAL_ISSUER_URL/healthz" || [ "$i" -ge 60 ]; do i=$((i+1)); echo "waiting for Dex at $SLASHDOCS_OIDC_INTERNAL_ISSUER_URL ($i/60)"; sleep 3; done; exec slashdocs-server'`
- **Health check:** /readyz
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

### Blob https://avatars.githubusercontent.com/u/6293622?v=4

- **Image:** versity/versitygw:v1.8.0
- **Start command:** `sh -c 'mkdir -p /data/slashdocs-documents && exec versitygw --quiet --port :9000 --health /health posix /data'`
- **Health check:** /health

## Documentation

# Deploy and Host SlashDocs on Railway

slashdocs is an open-source server from Razorpay that gives AI agents a place to publish self-contained HTML documents that humans can review. Agents push documents through the API, CLI, or remote MCP server; people read them in a web UI, leave comments anchored to text, and track versions.

## About Hosting SlashDocs

slashdocs ships as one Go binary with the React UI embedded. It needs Postgres for metadata, an S3-compatible bucket for the uploaded HTML, and an OpenID Connect identity provider for human sign-in. This template runs the pinned image `razorpay/slashdocs:0.1.1` next to a Railway Postgres service, a versitygw S3 service with a volume, and a Dex identity provider with a single static admin user, so you can sign in minutes after deploying without creating a Google or Okta app first. A small Caddy service provides the second hostname that slashdocs requires for sandboxed document rendering. All five services talk over Railway's private network and every secret is generated on deploy.

## Common Use Cases

- **Agent reports**: coding or research agents publish HTML reports that teammates review with comments
- **Versioned specs**: each push creates a new immutable version with a diffable history
- **Internal documentation**: agents keep runbooks and dashboards fresh, humans approve changes
- **MCP endpoint**: connect Claude, Cursor or other MCP clients to `/mcp` and let them publish directly
- **Private knowledge base**: documents are shared per user, per link, or org-wide

## Dependencies for SlashDocs Hosting

- **PostgreSQL**: included, migrations run on boot
- **S3-compatible storage**: included (versitygw with a Railway volume), or point `BLOB_*` at AWS S3, R2 or MinIO
- **OIDC provider**: included (Dex static user), replaceable with Google, Okta, Entra ID or Keycloak
- **Second hostname for renders**: included (Render service), or a custom domain on SlashDocs

### Deployment Dependencies

- [slashdocs self-hosting guide](https://github.com/razorpay/slashdocs/blob/master/docs/self-hosting.md)
- [slashdocs repository](https://github.com/razorpay/slashdocs)
- [Dex identity provider](https://dexidp.io/)

### Implementation Details

The SlashDocs service listens on `PORT=8080` and reports readiness on `/readyz` once Postgres and the bucket answer. Dex renders its config through gomplate at boot, bcrypt-hashing the generated `DEX_ADMIN_PASSWORD` and registering the slashdocs callback URL. The Render service runs `caddy reverse-proxy` to SlashDocs while keeping the original Host header, which is how slashdocs tells a render request from an app request.

```env
SLASHDOCS_APP_ORIGIN=https://${{RAILWAY_PUBLIC_DOMAIN}}
SLASHDOCS_RENDER_ORIGIN=https://${{Render.RAILWAY_PUBLIC_DOMAIN}}
SLASHDOCS_OIDC_ISSUER_URL=https://${{Dex.RAILWAY_PUBLIC_DOMAIN}}/dex
SLASHDOCS_OIDC_INTERNAL_ISSUER_URL=http://${{Dex.RAILWAY_PRIVATE_DOMAIN}}:5556/dex
DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}
BLOB_ENDPOINT=http://${{Blob.RAILWAY_PRIVATE_DOMAIN}}:9000
```

First steps after deploy: open the SlashDocs domain, click Continue with Dex, and sign in with `DEX_ADMIN_EMAIL` (default admin@example.com, editable) and the generated `DEX_ADMIN_PASSWORD` from the Dex service variables. Create a service account and key in the UI, then publish with `curl -F file=@report.html -F title=... https://your-slashdocs-domain/v1/documents` or install the CLI from `/install.sh`. To move to your company SSO later, set the provider variables on SlashDocs and delete the Dex service.

## Why Deploy SlashDocs 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 SlashDocs on Railway, you get the full upstream stack (app, Postgres, S3 storage, identity provider, render origin) wired together with generated secrets, health checks, managed SSL, and private networking, ready for agents to publish to on day one.


## 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/slashdocs-postgres-dex
