---
title: "Deploy Hocuspocus | (Just Updated) Yjs Collaboration Server, Token Auth and Storage Included"
description: "Yjs realtime collaboration server, token auth and storage generated"
category: "Queues"
url: https://railway.com/deploy/hocuspocus-or-just-updated-yjs-collabora
---

# Deploy Hocuspocus | (Just Updated) Yjs Collaboration Server, Token Auth and Storage Included

Yjs realtime collaboration server, token auth and storage generated

**[Deploy Hocuspocus | (Just Updated) Yjs Collaboration Server, Token Auth and Storage Included on Railway](https://railway.com/template/hocuspocus-or-just-updated-yjs-collabora)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/hocuspocus-or-just-updated-yjs-collabora/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Queues

## Template content

### hocuspocus

- **Image:** ghcr.io/bon5co/hocuspocus-railway:4.7.1@sha256:8a9258879297d3487c36fdc28fa44727613de31418b945e75b0f0abf5240c368
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Hocuspocus on Railway

Hocuspocus is the open-source Yjs collaboration backend from the Tiptap team. This template deploys a ready-to-use Hocuspocus 4.7 server: editors and agents connect over WebSocket, sync Yjs documents in real time, and documents persist on a volume. The access token is generated for you, so nothing needs filling in.

## About Hosting Hocuspocus

The image is a small wrapper (source: github.com/bon5co/hocuspocus-railway) around the official `@hocuspocus/server` package, pinned by digest. It adds what a hosted server needs: token authentication on every connection, SQLite persistence of each document under `/data`, and a `/health` endpoint. It runs as a single process.

## Why Deploy Hocuspocus on Railway?

- No manual step: the token is generated, port and health path are wired up.
- Public HTTPS and WSS endpoint out of the box.
- Documents survive redeploys because the volume is already mounted.
- Connections are authenticated from the first message.

## Common Use Cases

- Real-time collaborative text editors built on Tiptap, ProseMirror, Quill or Monaco.
- Shared state between AI agents and humans in the same document.
- Multiplayer whiteboards, notes and forms built on Yjs.
- Self-hosted replacement for Liveblocks or Tiptap Cloud collaboration.

## Dependencies for Hocuspocus Hosting

### Deployment Dependencies

- Image: [ghcr.io/bon5co/hocuspocus-railway](https://github.com/bon5co/hocuspocus-railway) (Hocuspocus 4.7.1, Yjs 13.6.33)
- Docs: https://tiptap.dev/docs/hocuspocus
- Volume mounted at `/data` (SQLite database).

## Machine-readable contract

```
service: hocuspocus
base_url: https://
health: GET /health -&gt; 200 {"status":"ok","documents":N}
websocket: wss:///   (HocuspocusProvider option token = HOCUSPOCUS_TOKEN; document name = provider name)
credential_variables:
  HOCUSPOCUS_TOKEN  (wrong token -&gt; authentication failed)
optional_variables:
  HOCUSPOCUS_DB     (SQLite path, default /data/hocuspocus/db.sqlite)
volume: /data
```

Check health:

```
curl https:///health
```

Connect a client:

```js
import { HocuspocusProvider } from "@hocuspocus/provider";
import * as Y from "yjs";
const doc = new Y.Doc();
new HocuspocusProvider({ url: "wss://", name: "my-document", document: doc, token: "" });
doc.getText("t").insert(0, "hello");
```


## Similar templates

- [Celery | Web, Worker and Scheduler as Three Services](https://railway.com/deploy/celery-or-web-work-1) — Web, worker and scheduler wired up: Celery on Redis, outcomes in Postgres.
- [Redpanda](https://railway.com/deploy/redpanda-1) — Redpanda 26.2: Kafka-compatible streaming, single node, with Kafbat UI.
- [smoothmq](https://railway.com/deploy/AJv-64) — A drop-in replacement for AWS SQS

Open this page in a browser: https://railway.com/deploy/hocuspocus-or-just-updated-yjs-collabora
