Caution
Project is archived. As tldraw is proprietary and requires a license to use in production, it has some unacceptable implications for any Nextcloud instance in production to utilize this. As such, the work has been ended and the repository archived.
_ _ _ _ _
| \ | | _____ _| |_ ___| | ___ _ _ __| |
| \| |/ _ \ \/ / __/ __| |/ _ \| | | |/ _` |
| |\ | __/> <| || (__| | (_) | |_| | (_| |
|_| \_|\___/_/\_\\__\___|_|\___/ \__,_|\__,_|
_ _ _
| |_| | __| |_ __ __ ___ __
| __| |/ _` | '__/ _` \ \ /\ / /
| |_| | (_| | | | (_| |\ V V /
\__|_|\__,_|_| \__,_| \_/\_/
This application integrates tldraw into Nextcloud, allowing users to create, edit, and collaborate on whiteboards in real-time. Drawings are stored natively as .tldr files within your Nextcloud instance.
- Real-Time Collaboration: Multiple users can edit the same drawing simultaneously.
- Native Integration:
.tldrfiles appear in Nextcloud Files with custom icons and previews. - Secure Architecture: Uses short-lived JWTs (60s) and authenticated uploads.
- Dockerized Backend: Production-ready
docker composesetup with Traefik support.
To deploy this application you need:
- A Nextcloud 28+ server (PHP 8.2+).
- A server running Docker and Docker Compose v2, with a dedicated domain (e.g.
tldraw.example.com).
git clone https://github.com/larkly/nextcloud-tldraw.git
cd nextcloud-tldrawThe Collab Server is the Node.js backend that handles real-time sync. Its container image is published to the GitHub Container Registry:
ghcr.io/larkly/nextcloud-tldraw:latest
-
Create a Service User in Nextcloud:
- Create a new user (e.g.
tldraw-bot) and add them to theadmingroup. - Log in as that user, go to Settings > Security > Devices & sessions, and generate an App Password named
Collab Server. Copy it — it is shown only once. - See docs/DEPLOYMENT.md for full details on why admin access is needed.
- Create a new user (e.g.
-
Configure the environment:
cp .env.example .env
Edit
.envand fill in your values:JWT_SECRET_KEY— generate withopenssl rand -hex 32NC_URL— your Nextcloud instance URL (no trailing slash)NC_USER/NC_PASS— the Service User username and App Password from Step 1TLDRAW_HOST— the domain for the collab server
-
Pull and start:
docker compose pull docker compose up -d
-
Verify: open
https://tldraw.example.com/health— you should see{"status":"ok"}.
See docs/DEPLOYMENT.md for Traefik configuration, pinning to a specific version, and building from source.
-
Build the release archive:
bash scripts/make-release.sh
This produces
nextcloud-tldraw-<version>.tar.gz. -
Extract it into your Nextcloud apps directory:
tar -xzf nextcloud-tldraw-<version>.tar.gz -C /var/www/nextcloud/apps/
-
Enable the app:
php occ app:enable tldraw
-
In Nextcloud, go to Administration Settings > tldraw and set:
- Collab Server URL →
https://tldraw.example.com - JWT Secret → the same value as
JWT_SECRET_KEYin.env
- Collab Server URL →
- Navigate to the Files app in Nextcloud.
- Click + New and select New tldraw drawing.
- Name your file (e.g.
brainstorming.tldr) and press Enter. - Click the file to open the editor.
- Share the file with other users to collaborate in real-time.
See docs/USAGE.md for a full user guide.
| Guide | Contents |
|---|---|
| User Guide | Creating drawings, collaboration, exporting, inserting images |
| Deployment Guide | Collab Server setup, Traefik, GHCR image tags |
| Administration Guide | Updates, configuration reference, troubleshooting |
| Architecture | System design, data flow, security model |
# Frontend (watches for changes and rebuilds)
npm install
npm run dev
# Collab Server
cd collab-server && npm install && npm run dev
# Backend (PHP): symlink this directory to your local Nextcloud apps/ folder
# and enable debug mode in Nextcloud to disable caching- Tokens: WebSocket connections use short-lived JWTs (60s expiry) for the initial handshake.
- Uploads: Asset uploads require a valid JWT in the
Authorizationheader. - Permissions: Write access is enforced server-side via the JWT
canWriteclaim.
This project would not be possible without the excellent work of the tldraw team.
- tldraw — the whiteboard library powering the editor.
- @tldraw/sync — the real-time collaboration primitives used by the collab server.
Important
tldraw is not distributed under an OSI-approved open-source license. Its custom license permits free use in development environments only. Production deployment requires a separate commercial license from tldraw, Inc. Review the tldraw license before deploying this app to production.
The code in this repository is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Note on third-party dependencies: The core drawing library, tldraw, is distributed under a proprietary license that is not OSI-approved. Production use of tldraw requires a separate commercial license from tldraw, Inc. The AGPL-3.0 license of this repository does not grant any rights to tldraw's code. See docs/LEGAL.md for a full dependency licence summary and operator obligations.