Tutorial

Self-Hosting Excalidraw on a VPS: Open Source Whiteboard

Self-hosting8 min read5 steps

Miro, FigJam, Lucidspark: SaaS whiteboards charge per seat, store your mockups on their servers and cap members by plan. Excalidraw is the open-source alternative (MIT): a hand-drawn-style collaborative whiteboard whose two components — the React interface and the WebSocket room server — self-host on a VPS in two Docker containers. This guide shows how to deploy them, wire nginx for WebSockets and enable board persistence.

Contents· Why self-host Excalidraw instead of using the public version1/10
  1. 01Why self-host Excalidraw instead of using the public version
  2. 02Concrete benefits
  3. 03Architecture: two containers, distinct roles
  4. 04Prerequisites
  5. 05Prerequisites checklist
  6. 06Deploy Excalidraw in 5 steps
  7. 07Board persistence: two approaches
  8. 08Self-hosted Excalidraw vs SaaS alternatives
  9. 09Going further: SSO and IP allowlists
  10. 10Integration in a self-hosted stack

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. Sessions travel through your WebSocket server, on your domain, without transiting a third party. 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 — drawing sessions stay on your infrastructure. No design file transits a third party.
  • 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-room is 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 only constraint is the VITE_APP_WS_SERVER_URL variable, which must point to your room server at compile time. This variable is baked into the JavaScript bundle: changing it 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. Drawings live in browser localStorage or are manually exported.

Practical consequence: the official Docker image hard-codes the Excalidraw collaboration server URL. To redirect to your own excalidraw-room, you must build your own image with VITE_APP_WS_SERVER_URL set to your domain — or use an entrypoint that patches the bundle at startup.

Prerequisites

The ServOrbit Start VPS (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 version to verify).
  • A domain name pointed at the VPS IP — without TLS, WebSockets are blocked by modern browsers.
  • Root SSH access or a user with sudo rights.
  • A valid TLS certificate — ServOrbit configures Let's Encrypt automatically.

Deploy Excalidraw in 5 steps

  1. 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 | sh

    Verify Docker Compose Plugin responds before continuing:

    docker compose version
  2. Build the image with your collaboration URL

    Clone the official repository, then build the image substituting your domain. Replace collab.yourdomain.com with the subdomain you allocate to excalidraw-room:

    git clone https://github.com/excalidraw/excalidraw.git
    cd excalidraw
    docker build \
      --build-arg VITE_APP_WS_SERVER_URL=wss://collab.yourdomain.com \
      -t my-excalidraw:latest .

    This step bakes the WebSocket server URL into the JavaScript bundle. If you change domains later, you will need to rebuild. The official excalidraw/excalidraw image works for local testing but points to Excalidraw's public server — unusable for a sovereign deployment.

  3. 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-stack

    docker-compose.yml contents:

    services:
      excalidraw:
        image: my-excalidraw:latest
        restart: unless-stopped
        networks:
          - excalidraw
    
      excalidraw-room:
        image: excalidraw/excalidraw-room:latest
        restart: unless-stopped
        networks:
          - excalidraw
    
    networks:
      excalidraw:

    Start the stack:

    docker compose up -d
  4. Configure nginx with WebSocket headers

    This is the step where most deployments silently fail: without the Upgrade and Connection headers, 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.

  5. Test real-time collaboration

    Open https://draw.yourdomain.com in 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). A 200 status on the WebSocket request means nginx did not pass the Upgrade headers.

Board persistence: two approaches

By default, excalidraw-room is fully stateless. If the server restarts, the current session is lost — but each participant retains locally what they drew in localStorage.

Option 1 — Automatic JSON export. Configure a cron job or script that calls Excalidraw's export API and saves .excalidraw files to a Docker volume. These files can be re-imported at any time from the interface.

Option 2 — S3-compatible bucket. ServOrbit offers S3-compatible object storage. Connect your bucket as the archive destination for exports; restoration after a failure is a single re-import of the last saved file.

Self-hosted Excalidraw vs SaaS alternatives

Scroll the table

CriteriaExcalidraw (self-hosted)MiroFigJam
Cost per userNone (VPS only)Paid per seatPaid per seat
Data hosted atYour infrastructureMiro Inc.Adobe / Figma
Concurrent membersRAM-boundPlan-limitedPlan-limited
Software licenceMIT (open source)ProprietaryProprietary
Self-hostableYes, two containersNoNo
Access controlIP / SSO / Basic AuthSSO (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.

One platform for your VPS, domain and backups

ServOrbit brings VPS, domain and backups together in a single agency workspace: deploy Excalidraw for your team and manage your clients' infrastructure from the same dashboard.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.

Message us on WhatsAppopens in a new tab