This guide gets you from a fresh clone to running the Excalidraw editor locally, with notes on the repository structure, the main technical stack, and the most common “new contributor” setup issues.
Excalidraw is an open source, hand-drawn style whiteboard with collaborative editing and export options. This repository is a monorepo:
packages/*: the core component/library code published as npm packages (for example@excalidraw/common,@excalidraw/element,@excalidraw/excalidraw).excalidraw-app/: the actual web app (the editor experience you run in the browser).examples/*: smaller integration examples (for example, embedding in a browser script, or a Next.js app).dev-docs/: Docusaurus site for contributor/developer documentation.
For local development, excalidraw-app consumes the workspace packages via Vite path aliases, so editing code inside packages/* can be reflected immediately in the running app (with HMR).
flowchart TD
User[Developer] --> Repo[excalidraw monorepo]
Repo --> App[excalidraw-app (Vite dev server)]
Repo --> Packages[packages/*]
App --> Aliases[Vite aliases (@excalidraw/* -> packages/*)]
Aliases --> Packages
At a high level:
- Runtime: React 19 (
excalidraw-app) and the Excalidraw component library (packages/excalidraw). - Tooling/build: Vite (with React plugin) for the web app, and TypeScript across the repo.
- Testing: Vitest for app tests (
yarn testrunsvitestat the root). - Code quality: ESLint + Prettier (with helper scripts at the repo root).
- Documentation: Docusaurus 2 (in
dev-docs/). - Collaboration (optional for local dev):
- WebSocket client:
socket.io-client(used by the app to connect to a collab server). - Local collab server:
excalidraw-room(run separately). - Persistence: Firebase configuration is provided via environment variables for some collaboration-related functionality.
- WebSocket client:
- PWA support:
vite-plugin-pwa(enabled in certain modes/flags).
You need:
- Node.js
>= 18(the repopackage.jsondeclares>=18.0.0). - Yarn classic (this repo uses Yarn 1.22.22):
yarn. - Git.
git clone https://github.com/excalidraw/excalidraw.git
cd excalidrawFrom the repo root:
yarnThis installs workspace dependencies for excalidraw-app, packages/*, and examples/*.
The app is driven by VITE_* environment variables loaded by Vite.
- The repo contains an example development env file at:
.env.development
- Create overrides locally in:
.env.local(this file is ignored by git)
Common things you may want to override:
VITE_APP_PORT(default in this repo is set in.env.development, currently3001).VITE_APP_WS_SERVER_URL(WebSocket collab server URL; default points tohttp://localhost:3002for dev).VITE_APP_AI_BACKEND(only needed if you use the AI feature in the UI).
Tip: if you change env vars and the dev server doesn't pick them up, restart yarn start.
From the repo root:
yarn startThis runs the dev server inside excalidraw-app and opens a browser.
Then open the URL shown by the dev server output (the port is determined by VITE_APP_PORT).
- Editor dev server:
http://localhost:3001(default viaVITE_APP_PORT). - Collaboration WebSocket server:
http://localhost:3002(default viaVITE_APP_WS_SERVER_URL).
If you see an “address already in use” error or the page doesn't load, check those values.
If you want real-time collaboration locally, you need to run the collab backend separately.
- Set up the collab server:
excalidraw-room(run it locally as described in its repository). - Ensure the editor points to it using
VITE_APP_WS_SERVER_URL. - Start the editor (
yarn start) and verify the collaboration indicator in the UI.
If the collab server is not running, you will typically be able to load and edit locally, but collaboration features will fail to connect.
At the repo root:
yarn test:typecheck # TypeScript typechecking
yarn test:code # ESLint (format/lint rules)
yarn test:update # Update test snapshots (when needed)
yarn test # Vitest test run
yarn fix # Prettier + ESLint auto-fix where possibleIf your changes affect UI output or snapshots, run:
yarn test:updateAlso run:
yarn test:typecheckto catch TypeScript issues early.
To run the Docusaurus docs site locally:
yarn --cwd dev-docs startThis lets you preview changes to documentation under dev-docs/docs/*.
-
Port mismatch (
3000vs3001)- Some docs/screenshots mention
3000, but this repo's dev server is driven byVITE_APP_PORT. - If the browser doesn't load, open the correct port from your terminal output and/or check
VITE_APP_PORT.
- Some docs/screenshots mention
-
Collab WebSocket server not running
- Collaboration requires
excalidraw-roomand a correctVITE_APP_WS_SERVER_URL. - If collaboration fails, verify the backend is running and reachable from your machine.
- Collaboration requires
-
Updating env vars but not restarting
- Vite only reliably applies env changes on server restart.
-
Modifying
.env.developmentor committing local secrets- Prefer
.env.localfor local overrides (and keep secrets out of git).
- Prefer
-
Formatting/snapshots causing “it works on my machine” failures
- Run
yarn fixand/oryarn test:updatewhen UI output changes.
- Run
-
Running commands from the wrong directory
yarn startis designed to start the app from the repo root (it forwards intoexcalidraw-app).- For docs, use
yarn --cwd dev-docs start.
Start with “easy” items in the project roadmap, or pick small, well-scoped bugs/features. The repo's contributing docs encourage starting with beginner-friendly tasks and discussing bigger changes via an issue first.