Deploy Excalidraw + Live Collaboration [Self-Hosted]
Self-hosted whiteboard with real-time collab that actually works
Excalidraw
Just deployed
Deploy and Host Excalidraw on Railway
Excalidraw is an open-source virtual whiteboard for sketching hand-drawn-style diagrams — a free alternative to Miro and FigJam. This template deploys the Excalidraw client plus a working excalidraw-room collaboration server, wired together so the Live Collaboration button connects to your instance instead of Excalidraw's public servers.
That wiring is the hard part of self-hosting Excalidraw, and it's done for you here.
What This Template Deploys
| Service | Purpose |
|---|---|
| Excalidraw | The whiteboard client — a static app served on port 80 |
| excalidraw-room | WebSocket server brokering real-time updates between collaborators |
Both services deploy together. The client is patched at startup to point its WebSocket URL at your own room server, and Railway's automatic HTTPS satisfies the secure-context requirement that collaboration depends on.
About Hosting Excalidraw
Self-hosting Excalidraw looks trivial — it's a static site — until you click Live Collaboration and discover it isn't working. The published Docker image is a Vite build with the WebSocket server URL inlined at build time, hardcoded to oss-collab.excalidraw.com. Setting VITE_APP_WS_SERVER_URL on the running container has no effect, so a naive self-hosted deployment silently routes your team's collaboration sessions through Excalidraw's public infrastructure.
This template patches the built bundle at container startup so the client connects to the excalidraw-room service deployed alongside it. The patch reapplies on every start, so image updates pick up cleanly rather than reverting the fix.
The second requirement is HTTPS. Excalidraw uses the WebCrypto API to encrypt collaboration sessions, and WebCrypto only works in secure contexts — over plain HTTP you get a generateKey error and collaboration fails outright. Railway terminates TLS automatically, so this is handled with no reverse proxy or certificate setup.
Excalidraw is architecturally unusual in one important way: drawings live in your browser, in localStorage and IndexedDB. The server only delivers static files, and the room server is stateless — it relays updates between peers without storing them. There is genuinely nothing server-side to back up, and no database in this stack.
Typical cost: ~$5/month on Railway's Hobby plan for both services. Miro charges around $8–16/user/month and FigJam around $3–5/user/month, so a team of any size pays for this many times over.
How It Compares
| Excalidraw (self-hosted) | Miro | FigJam | Excalidraw+ | |
|---|---|---|---|---|
| Cost model | Flat ~$5/mo infra | Per user/month | Per user/month | Per user/month |
| Board limit | Unlimited | Plan-based | Plan-based | Unlimited |
| Real-time collab | Yes (this template) | Yes | Yes | Yes |
| Data location | Your browser | Vendor cloud | Vendor cloud | Vendor cloud |
| Self-hostable | Yes | No | No | No |
| Open source | Yes (MIT) | No | No | No |
Miro and FigJam offer richer template libraries and built-in board persistence. Excalidraw wins on cost, on the hand-drawn aesthetic people actually like for architecture sketches, and on never sending a diagram to someone else's servers.
Deploy in Under 5 Minutes
- Click Deploy on Railway — both services build automatically (~2 minutes)
- Set
VITE_APP_WS_SERVER_URLto your room service's public Railway URL - Open the Excalidraw domain — the whiteboard loads immediately, no login required
- Click Live collaboration, then share the generated link with a teammate
- Confirm both cursors appear — you're collaborating through your own server
No Traefik, no Caddy, no certificate configuration, no custom image build.
Common Use Cases
- Architecture and system diagrams — sketch service topologies with the hand-drawn look that reads as a draft rather than a spec
- Remote whiteboarding sessions — real-time collaborative sketching for distributed teams, through infrastructure you own
- Technical interviews — a shared drawing surface for system-design rounds with no account or signup for candidates
- Private-by-default diagramming — drawings stay in the browser and never touch a vendor's cloud
- Miro / FigJam replacement — unlimited boards and collaborators at a flat infrastructure cost instead of per-seat billing
- Documentation sketches — export diagrams to PNG or SVG and drop them straight into READMEs and design docs
Configuration
| Variable | Required | Description |
|---|---|---|
VITE_APP_WS_SERVER_URL | Required | Public URL of the room service — the client bundle is patched with this at startup |
PORT | Pre-set | 80 for the Excalidraw client |
SOCKET_SERVER_PORT | Pre-set | Port the excalidraw-room service listens on |
CORS_ORIGIN | Optional | Restrict room-server connections to your Excalidraw domain |
VITE_APP_DISABLE_TRACKING | Optional | Set true to disable analytics in the client |
VITE_APP_WS_SERVER_URLmust point at your room service's public URL. It is applied by patching the built bundle at startup, because the value is compiled into the image and cannot be changed by environment variable alone. If it's wrong or unset, Live Collaboration falls back to Excalidraw's public servers.
There is nothing to back up on the server. Drawings live in browser localStorage and IndexedDB; the room server is stateless. Export boards as
.excalidrawfiles if you need durable copies.
Dependencies for Excalidraw Hosting
- Railway account — Hobby plan (~$5/month) covers both services
- A modern browser (drawings are stored client-side in localStorage and IndexedDB)
- Nothing else — no database, no object storage, no external accounts
Deployment Dependencies
- Excalidraw GitHub Repository
- excalidraw-room Repository
- Excalidraw Docker Image
- Railway Networking Documentation
Implementation Details
The template runs the official excalidraw/excalidraw image alongside excalidraw/excalidraw-room. The client is a Vite single-page app in which VITE_APP_WS_SERVER_URL is inlined at build time — the published image ships with oss-collab.excalidraw.com baked into its JavaScript assets, which is why a plain container deployment connects to Excalidraw's public collaboration servers regardless of what environment variables you set.
This template resolves that by patching the built bundle at container startup, substituting your room service URL into the compiled assets. Because the patch runs on every start, pulling a newer upstream image keeps the fix intact instead of silently reverting it.
Railway's automatic HTTPS covers the second requirement: Excalidraw encrypts collaboration sessions with the WebCrypto API, which browsers expose only in secure contexts. Over HTTP, session key generation throws and collaboration fails; on Railway, TLS is terminated for you with no proxy configuration.
The stack is stateless by design. Board data lives in the browser, and the room server only relays updates between connected peers, so there is no database, no volume, and nothing to back up server-side.
Frequently Asked Questions
Does Live Collaboration actually work on this template? Yes — that's the point of it. The client bundle is patched at startup to point at the excalidraw-room service deployed alongside it. A default Excalidraw container connects to Excalidraw's public servers instead, even when you set the environment variable.
Why doesn't setting VITE_APP_WS_SERVER_URL work on a normal container? Because Excalidraw is a Vite app and that value is compiled into the JavaScript at build time. Changing it on a running container has no effect, which is why this template patches the built assets instead.
Where are my drawings stored? In your browser, via localStorage and IndexedDB. The server never sees them. Export boards as .excalidraw, PNG, or SVG files if you want copies outside the browser.
Do I need a database? No. There is no database and no volume in this stack — the client is static and the room server is stateless.
Are collaboration sessions private? Yes. Excalidraw end-to-end encrypts collaboration sessions in the browser, and with this template the relay is your own server rather than a public one.
Do drawings persist if I clear my browser data? No. Because storage is client-side, clearing site data removes local boards. Export anything you need to keep.
Why does collaboration fail over HTTP? Excalidraw's session encryption uses WebCrypto, which browsers restrict to secure contexts. Railway provides HTTPS automatically, so this doesn't affect deployments here.
Why Deploy Excalidraw 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 Excalidraw on Railway you get a private whiteboard with collaboration that genuinely works — client and room server wired together, the build-time URL problem already solved, automatic HTTPS for session encryption, and no per-seat billing. Sketch, share, and collaborate on infrastructure you own.
Template Content
Excalidraw
excalidraw/excalidraw