Deploy Hocuspocus

Hocuspocus 4.7: Y.js collaboration backend with JWT auth and SQLite.

Deploy Hocuspocus

/data

Deploy and Host Hocuspocus on Railway

Hocuspocus is a WebSocket backend for Y.js, the CRDT library behind many collaborative editors. It syncs shared documents between clients in real time, merges offline edits without conflicts and stores the result. It is made by the Tiptap team and works with Tiptap, BlockNote, Lexical, CodeMirror and any other Y.js binding.

About Hosting Hocuspocus

This template deploys Hocuspocus 4.7.0 from a small public wrapper repository, because the official command-line server accepts every client. The wrapper verifies an HS256 JWT on every connection. Your backend signs it with HOCUSPOCUS_JWT_SECRET, and an optional docs claim limits which documents it opens. Documents are stored in SQLite on a Railway volume and survive redeploys. Clients connect over WSS to the public domain. If you set WEBHOOK_URL, the server posts document changes to your backend, signed with WEBHOOK_SECRET. The server runs as the unprivileged node user and fits the Hobby plan.

Common Use Cases

  • Real-time collaborative editing in a Tiptap or BlockNote editor
  • Multiplayer whiteboards, forms and to-do lists built on Y.js
  • Offline-first documents that merge when clients reconnect

Dependencies for Hocuspocus Hosting

Deployment Dependencies

Implementation Details

ServiceSourceNetworkingStorage
hocuspocusaalfath/hocuspocus-railway-templatepublic WSSvolume at /data
VariablePurpose
HOCUSPOCUS_JWT_SECRETShared secret your backend signs client tokens with
HOCUSPOCUS_JWT_ISSUEROptional; when set, tokens must carry this iss
WEBHOOK_URL, WEBHOOK_SECRETOptional change notifications to your backend
HOCUSPOCUS_URLwss:// for your clients

Issue a token in your backend and connect:

const token = await new SignJWT({ docs: ["notes/*"] }).setProtectedHeader({ alg: "HS256" })
  .setSubject(user.id).setExpirationTime("1h").sign(new TextEncoder().encode(HOCUSPOCUS_JWT_SECRET))
new HocuspocusProvider({ url: HOCUSPOCUS_URL, name: "notes/42", token })

Add readOnly: true to a token for view-only access. Keep the secret on your server only.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by Tiptap (ueberdosis).

Why Deploy Hocuspocus 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 Hocuspocus 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.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51