How to self-host Excalidraw with real-time collaboration
Run your own Excalidraw whiteboard with live, end-to-end encrypted collaboration on Railway. Covers how the two services fit together, setup, and common fixes.By chin · Oct 4, 2026 · 4 min read
Excalidraw is the hand-drawn-style whiteboard many engineering teams use for architecture diagrams, quick sketches and workshop boards. The public excalidraw.com works well, but plenty of teams want their own instance: on their own domain, under their own control, and not dependent on a third party staying online.
The catch is collaboration. The Excalidraw editor is a static web app, but live multi-user editing needs a small realtime server alongside it. The Excalidraw (with collaboration) template deploys both, already wired together.
What gets deployed
The template creates two services in one Railway project:
| Service | What it does |
|---|---|
| excalidraw | The editor itself: a static web app served to the browser |
| excalidraw-room | A small WebSocket server that relays drawing updates between people in the same room |
When you start a live session, the editor creates a room and a secret encryption key. The key lives in the fragment of the share link (the part after
#), which browsers never send to servers. Every change is encrypted in the browser before it reaches the room server, so the server only relays ciphertext it cannot read. Self-hosting keeps Excalidraw's end-to-end encryption model.Deploy it in three steps
- Click Deploy on the template page. It needs no API keys or settings to get started.
- Wait for both services to go green. Railway pulls the prebuilt editor image, builds the room server from source, and gives each service its own public domain.
- Open the excalidraw service's domain and draw. To test collaboration, click Live collaboration → Start session, then open the share link in a private window or on another device.
Check which room server your editor uses
The Excalidraw editor has its collaboration server address built in when the editor image is built. To confirm sessions go through your
excalidraw-room service, start a live session and open your browser's developer tools. In the Network tab, filter by WS (WebSocket) and check the host name of the connection. If it is not your room service's domain, the editor is still using a default server. Rebuild the editor with your room server's URL (the upstream Excalidraw repository documents the build-time variable) before relying on it for private boards.Lock the room server to your editor
The
excalidraw-room service has a CORS_ORIGIN variable that controls which websites may connect to it. Set it to the exact public URL of your editor, for example https://draw.example.com, so other sites cannot use your room server as a free relay. Redeploy the room service after changing it.Use your own domain
A custom domain makes the board easier to share and remember.
- In the excalidraw service, open Settings → Networking and add a custom domain such as
draw.example.com. - Create the CNAME record Railway shows you at your DNS provider. Railway issues the TLS certificate automatically.
- Update
CORS_ORIGINonexcalidraw-roomto the new domain.
You can give the room server its own subdomain too (for example
draw-ws.example.com), but users never see that URL, so the generated Railway domain is fine.Where your drawings are stored
This catches people out, so it is worth being clear:
- Your own scenes are saved in your browser's local storage, like on excalidraw.com. Clearing site data removes them.
- Live sessions exist only while people are connected. The room server relays updates but does not save drawings.
- To keep or share a drawing permanently, use Save to… → Save to disk to download a
.excalidrawfile, or export a PNG or SVG. You can reopen.excalidrawfiles later or commit them to a repository next to your docs.
The "shareable link" export on excalidraw.com depends on Excalidraw's own hosted storage backend, which a basic self-hosted setup does not include. Use files or live sessions instead.
Troubleshooting
The collaboration button spins or fails to connect.
Check that the
excalidraw-room service is running and that CORS_ORIGIN exactly matches the editor URL, including https:// and with no trailing slash.Collaborators see each other briefly, then get disconnected.
This is usually a sleeping or restarting room service. Check its deploy logs in Railway, and make sure it is not configured to sleep when idle while people are using it.
My drawings disappeared.
They were most likely in a browser's local storage that got cleared, or in a private window. Save important boards to disk.
Why self-host a whiteboard at all?
- Control. Your instance stays up as long as you keep it running, on a domain you own.
- Privacy. Collaboration is end-to-end encrypted, and once your editor points at your own room server, the relay is yours too.
- Low cost. Two lightweight services with no database. It is one of the cheapest useful things you can host.
Frequently asked questions
Does self-hosted Excalidraw include Excalidraw+ features?
No. Excalidraw+ is a separate commercial product. The open-source editor includes drawing, libraries, export and live collaboration.
How many people can collaborate at once?
The room server is lightweight and handles typical team sessions comfortably. For very large workshops, check the service's CPU and memory graphs in Railway during a session.
Can I embed my Excalidraw instance in other tools?
Yes. It is a normal website, so anything that can embed a URL (wikis, docs tools) can embed it. Make sure your
CORS_ORIGIN setting still allows the editor's own origin.Templates in this guide
More guides
- Build a self-hosted Perplexity alternative with Morphic, SearXNG and FirecrawlSelf-host an AI answer engine with cited sources. Compare Morphic, Open DeepResearch and Fireplexity, and add private search with SearXNG or Whoogle.
- Self-hosted ChatGPT alternatives: Open WebUI vs LibreChat vs big-AGICompare three open-source ChatGPT-style interfaces you can self-host on Railway, where each one stores your chats, and which to pick for you or your team.
- Self-hosted PDF tools: Stirling-PDF vs PDFDing vs Paperless-AIEdit, organise and auto-tag PDFs without uploading them to online converters. A practical comparison of three self-hosted PDF tools you can deploy on Railway.
