Why self-host Excalidraw instead of using the public version
The public version at excalidraw.com works fine for quick solo sketches. It routes real-time collaboration sessions through a server managed by Excalidraw s.r.o. That is acceptable for an ad-hoc brainstorm. It is much less so when the boards contain client flow mockups, internal system architecture diagrams or wireframes covered by an NDA.
Self-hosting Excalidraw shifts the control boundary to your own infrastructure. Real-time traffic goes through your WebSocket server, on your domain; what a standard installation still leaves with a third party (the saved scene, share links) is detailed below. You decide who connects — via IP allowlist, OIDC SSO or HTTP Basic Auth in front of nginx. And since both components are published under the MIT licence, no commercial restriction applies regardless of how many clients or collaborators work on the instance.
Concrete benefits
- Zero software subscription — both components (interface and collaboration server) are MIT. You pay for the VPS, nothing else.
- Mockup confidentiality — live drawing stays on your infrastructure. The saved scene and a room's images still need handling (Firebase by default): see “What really works when self-hosting”.
- Access under your control — IP allowlist, OIDC SSO or HTTP Basic Auth in front of nginx depending on the required isolation level.
- Sessions and members scale with VPS RAM — no per-plan cap; the only limit is server RAM, and
excalidraw-roomis a lightweight Node.js service. - Optional persistence — mount a Docker volume or connect an S3-compatible bucket to archive boards exported as JSON.
- Integration into a self-hosted stack — an Excalidraw instance alongside Penpot, Mattermost or Docmost closes the SaaS perimeter for an entire agency.
Architecture: two containers, distinct roles
Excalidraw splits what most people consider a single tool into two independent components:
- excalidraw/excalidraw — the compiled React interface, served as a static site by nginx inside the container. It runs no application server. Its service addresses (room, Firebase, sharing) are VITE_APP_* variables read at compile time and baked into the JavaScript bundle: changing them on a running container has no effect.
- excalidraw/excalidraw-room — a Node.js Socket.IO server that relays drawing events in memory between participants in the same session. It is stateless: it persists nothing and forgets everything on restart. A room's saved scene does not go through it (see below). Its Docker Hub image has not been republished since December 2023 and its upstream Dockerfile starts from Node 12: keep it behind nginx, on the Docker network, with no published port.
Practical consequence: the official Docker image was built with excalidraw.com's addresses. To target your own excalidraw-room, you must build your own image after editing VITE_APP_WS_SERVER_URL in .env.production.
Prerequisites
The ServOrbit VPS Solo (2 vCPU, 4 GB RAM) covers the standard case: the static interface is nearly zero-load, and excalidraw-room consumes less than 256 MB under normal traffic. With ten concurrent collaborators, you will stay well under half the available RAM.
What you need before starting:
Prerequisites checklist
- A VPS with at least 1 vCPU and 512 MB RAM (1 GB recommended for a team).
- Docker Engine and Docker Compose Plugin installed (
docker compose versionto verify). - A domain name pointed at the VPS IP — without TLS, WebSockets are blocked by modern browsers.
- Root SSH access or a user with
sudorights. - A valid TLS certificate — ServOrbit configures Let's Encrypt automatically.
Deploy Excalidraw in 5 steps
Create the VPS and install Docker
Provision an Ubuntu 24.04 VPS from your ServOrbit dashboard. Once connected over SSH, if Docker is not yet installed, run:
curl -fsSL https://get.docker.com | shVerify Docker Compose Plugin responds before continuing:
docker compose versionBuild the image with your collaboration URL
Clone the official repository, then set the room address in the repository's
.env.productionfile before building. Replacecollab.yourdomain.comwith the subdomain you allocate toexcalidraw-room:git clone https://github.com/excalidraw/excalidraw.gitcd excalidrawsed -i 's|^VITE_APP_WS_SERVER_URL=.*|VITE_APP_WS_SERVER_URL=https://collab.yourdomain.com|' .env.productiondocker build -t my-excalidraw:latest .Why not
--build-arg? The upstream Dockerfile declares noARGfor theVITE_APP_*variables: a--build-arg VITE_APP_WS_SERVER_URL=…never reaches the build command, the image builds normally and keeps pointing at Excalidraw's server. The upstream.dockerignorealso admits only.env.developmentand.env.production, so a.env.production.localwould be ignored. The address is baked into the bundle, so changing domain means rebuilding.Check the result:
docker run --rm --entrypoint sh my-excalidraw:latest -c "grep -rl oss-collab.excalidraw.com /usr/share/nginx/html || echo clean"must printclean. The officialexcalidraw/excalidrawimage is fine for local trials, but it targets Excalidraw's public services.Write the docker-compose.yml file
Create a working directory and write the following file. Both services listen internally; nginx (next step) is the only public entry point:
mkdir ~/excalidraw-stack && cd ~/excalidraw-stackdocker-compose.ymlcontents:services: excalidraw: image: my-excalidraw:latest restart: unless-stopped networks: - excalidraw excalidraw-room: image: excalidraw/excalidraw-room:latest environment: - CORS_ORIGIN=https://draw.yourdomain.com restart: unless-stopped networks: - excalidraw networks: excalidraw:Start the stack:
docker compose up -dConfigure nginx with WebSocket headers
This is the step where most deployments silently fail: without the
UpgradeandConnectionheaders, the browser opens a plain HTTP connection instead of a WebSocket, and collaboration appears not to work with no visible error message.nginx block for the Excalidraw frontend (
draw.yourdomain.com):server { listen 443 ssl; server_name draw.yourdomain.com; location / { proxy_pass http://excalidraw:80; proxy_set_header Host $host; } }nginx block for the room server (
collab.yourdomain.com):server { listen 443 ssl; server_name collab.yourdomain.com; location / { proxy_pass http://excalidraw-room:80; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_read_timeout 86400s; } }Reload nginx (
nginx -s reload) after placing the blocks.Test real-time collaboration
Open
https://draw.yourdomain.comin two tabs or two different browsers. In the toolbar, click Live collaboration and create a session. Copy the session link into the second tab.Draw something in the first tab: the stroke should appear in the second in real time. If it does not, check the WebSocket headers in nginx first (browser network devtools show whether the connection upgraded to
101 Switching Protocols). A200status on the WebSocket request means nginx did not pass theUpgradeheaders.Then open the browser's network tab: the real-time connection must target
collab.yourdomain.com, never oss-collab.excalidraw.com. What Firebase receives is covered in the next section.
What really works when self-hosting
Let us be precise: “two containers and you are done” is the shortcut this kind of guide repeats most often. The upstream umbrella thread (excalidraw/excalidraw, issue no. 1772, open since June 2020 and still active in October 2026) sums up three walls, which we cross-checked against the code and the repository's .env files.
Wall 1 — addresses are fixed at build time. The addresses of the collaboration server, the sharing service and the Firebase project are VITE_APP_* variables read by Vite during the build. The official excalidraw/excalidraw image was built with the values from .env.production: it therefore still talks to excalidraw.com's services. A variable passed to docker run changes nothing, and the upstream Dockerfile declares no ARG to relay one into the build.
Wall 2 — collaboration is half local. Real-time traffic (who draws what, live) goes through excalidraw-room, which you host. But the saved scene and the images pasted into a room go to Firebase: the code calls saveToFirebase and saveFilesToFirebase, using the configuration in VITE_APP_FIREBASE_CONFIG. As long as that variable keeps the upstream value, this data (encrypted in the browser with the room key) is stored in Excalidraw's Firebase project, not with you. That reconciles the contradictory reports in the thread: one finds that collaboration fails with VITE_APP_FIREBASE_CONFIG='{}', another that Jitsi Meet removed the Firebase part and real-time works with the room alone. Live drawing can do without Firebase; saving and resuming cannot.
Wall 3 — share links need a storage server the project does not publish. A #json= link is created by a request to VITE_APP_BACKEND_V2_POST_URL and read back through VITE_APP_BACKEND_V2_GET_URL, by default json.excalidraw.com. The thread mentions community rewrites (one in Next.js on S3, another on S3-compatible storage) but names none as official.
Three possible setups, and what each leaves with a third party
- Setup A — room only (the one in this guide). You change
VITE_APP_WS_SERVER_URLand nothing else. Live drawing goes through your server; the saved scene and the rooms' images are still written to Excalidraw's Firebase. Acceptable for low-sensitivity boards, not to be presented as “nothing with a third party”. - Setup B — room + your own Firebase project. You create a Firebase project of your own and put its JSON configuration in
VITE_APP_FIREBASE_CONFIG. The code reads only that variable; we have not deployed this end to end, and Firebase remains a Google service, not self-hosting in the strict sense. - Setup C — solo instance. You serve the interface alone, with no room and no link: everyone draws, exports to
.excalidrawor an image, and archives the files with you. Nothing goes to a third party for collaboration, since there is none. - What does not exist on the official side. No open storage server for
#json=links, and no option that moves the whole perimeter to your domain through a single runtime variable. If your requirement is “no data with a third party” with collaboration and sharing, the honest answer is adaptation or fork work, not an installation.
Variable → function → what breaks without it
Scroll the table
| Variable | Function | What breaks without it |
|---|---|---|
| `VITE_APP_WS_SERVER_URL` (build time) | Address of the Socket.IO real-time server (`excalidraw-room`). | Upstream value kept: your sessions go through oss-collab.excalidraw.com. Unreachable address: collaboration does not start. |
| `VITE_APP_FIREBASE_CONFIG` (build time) | JSON configuration of the Firebase project: a room's saved scene and pasted images. | Upstream value: that data stays with Excalidraw. Empty or invalid (`{}` included): saving and resuming a room fail, and according to one report in the thread so does collaboration. Unreadable JSON logs `Error JSON parsing firebase config`. |
| `VITE_APP_BACKEND_V2_POST_URL` (build time) | Creating a `#json=` share link (upload of the encrypted scene). | Upstream value: the link is created at json.excalidraw.com. Address without a compatible server: link creation fails. |
| `VITE_APP_BACKEND_V2_GET_URL` (build time) | Reading back a `#json=` link when it is opened. | Upstream value: the link is read from Excalidraw. Address without a compatible server: opening the link fails. |
| `VITE_APP_DISABLE_SENTRY` (build time) | Disables sending error reports to Sentry. | Nothing breaks; without it, the app may send error reports to a third party. The upstream `build:app:docker` script already sets it to `true`. |
| `VITE_APP_DISABLE_PREVENT_UNLOAD` (build time) | Removes the warning before leaving a room whose saving is not finished. | Nothing breaks, but closing the tab no longer warns. Keep it for debugging. |
| `CORS_ORIGIN` (runtime, `excalidraw-room`) | Origin allowed to open a connection to the room server. | Absent: the default is `*`, any web page can connect. Set `https://draw.yourdomain.com`. |
| `PORT` (runtime, `excalidraw-room`) | Listening port of the room server. | Absent: listens on port 80 outside development mode, which is what this guide's nginx blocks assume. If you change it, `proxy_pass` must follow. |
Checking who receives what
The only way to know what leaves your instance is to look. Open the browser's network tab, start a collaboration session, draw, paste an image, then create a share link. Three families of destinations can be read: your room subdomain (real time, expected); Firebase's googleapis.com domains (saved scene and images, expected with the upstream configuration, to be eliminated if you thought otherwise); json.excalidraw.com (link sharing). This inspection is the acceptance test of the setup you chose: without it, “on my server” remains a hypothesis.
Finally, remember that the room server authenticates nobody: CORS_ORIGIN limits which web pages may connect to it, not which people. Participant identity is handled in front of the interface (Basic Auth, SSO), as described further down.
Troubleshooting: collaboration will not start, or remembers nothing
The symptoms below follow from the code and the upstream thread; no message is reproduced other than those read in the repository.
Symptoms, causes, remedies
- The session goes to oss-collab.excalidraw.com (network tab) although you built your own image. Cause: the address was not picked up at build time (
--build-arghas no effect,.env.production.localis ignored by the.dockerignore). Remedy: edit.env.production, rebuild, replay thegrepcheck from step 2. A domain change follows the same rule. - The browser's connection to the room is refused. Frequent cause after setting
CORS_ORIGIN: the origin does not exactly match the page's (httpscheme instead ofhttps, port, trailing slash). Remedy: the value must be the interface's exact origin, for examplehttps://draw.yourdomain.com. - Strokes appear live, but a participant who joins later, or after a room restart, does not find the content or the images. Cause: the scene and images are saved through Firebase, not by
excalidraw-room, which retains nothing. IfVITE_APP_FIREBASE_CONFIGis empty or unreachable, nothing is read back. Remedy: choose setup A or B above. - Warning
Error JSON parsing firebase config. Supplied value:in the browser console. Cause:VITE_APP_FIREBASE_CONFIGis not valid JSON, most often because of badly protected quotes or a line break in the file. Remedy: JSON on a single line, in single quotes in.env.production, as in the upstream file. - Link sharing fails, or the link produced points to json.excalidraw.com. Cause:
VITE_APP_BACKEND_V2_POST_URLandVITE_APP_BACKEND_V2_GET_URLwere not changed, or point to a server that does not implement the expected API. Remedy: keep the default knowingly, or exchange.excalidrawfiles. - Encryption or key-generation error on a local network over
http://. Cause: the browser's encryption API (window.crypto) is only exposed in a secure context; the upstream thread flags this trap for local-network self-hosting. Remedy: serve the interface over HTTPS (or onlocalhost), as the TLS prerequisite above requires.
Board persistence: what is actually saved
By default, excalidraw-room is fully stateless: if the server restarts, the relay starts from scratch. A room's saved scene lives elsewhere (Firebase, see above), and each participant also keeps their drawing in their browser's localStorage.
Option 1 — Manual export of .excalidraw files. The interface's export menu produces a .excalidraw file (or an image) that can be re-imported at any time. Excalidraw exposes no export API to call from a cron job: it is a gesture made in the browser, whose file you then drop into a volume or a git repository.
Option 2 — S3-compatible bucket for archiving. ServOrbit offers S3-compatible object storage. Copy the exported files there with the tool of your choice (rclone, aws s3 cp); restoring means re-importing the last file. Excalidraw itself does not write to S3.
Self-hosted Excalidraw vs SaaS alternatives
Scroll the table
| Criteria | Excalidraw (self-hosted) | Miro | FigJam |
|---|---|---|---|
| Cost per user | None (VPS only) | Paid per seat | Paid per seat |
| Data hosted at | Your infrastructure (real-time); Excalidraw's Firebase by default for the saved scene | Miro Inc. | Adobe / Figma |
| Concurrent members | RAM-bound | Plan-limited | Plan-limited |
| Software licence | MIT (open source) | Proprietary | Proprietary |
| Self-hostable | Partly: two containers, plus Firebase and share links to deal with | No | No |
| Access control | IP / SSO / Basic Auth | SSO (Pro plans) | SSO (Edu+ plans) |
Going further: SSO and IP allowlists
For an agency whose clients have strict confidentiality requirements, exposing Excalidraw on a public subdomain is not always acceptable. Two common configurations harden access without modifying Excalidraw itself.
HTTP Basic Auth via nginx. Add an auth_basic directive in front of the frontend location / block. Anyone attempting to open the interface must authenticate before the React app even loads. Simple to set up, sufficient for internal projects.
IP allowlist. If collaborators connect from fixed IPs or a corporate VPN, an allow/deny block in nginx is enough to close the instance to the rest of the Internet:
allow 203.0.113.0/24;
allow 198.51.100.42;
deny all;OIDC SSO via an authenticating reverse proxy. For teams that already have an identity provider (Keycloak, Authelia, Authentik), an authenticating proxy such as Oauth2-Proxy or Authelia placed in front of nginx delegates authentication to the existing SSO. Excalidraw does not need to know that an additional auth layer exists.
Integration in a self-hosted stack
Excalidraw integrates naturally into a self-hosted tool stack. If you have already deployed Mattermost for team communication, you can paste an Excalidraw session link into a channel and invite collaborators to join the board directly. If Penpot covers high-fidelity design, Excalidraw handles upstream work — quick wireframes, flow diagrams and brainstorming sessions — before designs enter Penpot.
This complementarity is the real argument against SaaS: each tool stays within its area of expertise, without a platform subscription billing for features you do not need.