CryptPad: Collaborative Documents That Stay on Your Server
Real-time editing, spreadsheets and whiteboards without handing the plaintext to anyone

Contents
I spent years assuming that “self-hosted Google Docs” was a contradiction in terms. Real-time collaborative editing needs a server that can see the document — that’s how operational transforms and conflict resolution work, or so I thought. Then I actually read how CryptPad does it, and the answer is more interesting than “trust the server less”: the server never sees the document at all.
CryptPad encrypts everything client-side before it ever leaves your browser. Your server stores encrypted blobs it cannot read, and the encryption keys live in the URL fragment (the part after #), which browsers never send to the server by design. Multiple people can edit the same encrypted document in real time, and the server just relays encrypted deltas between them without knowing what a single one contains. That’s a genuinely different model to Nextcloud’s collaborative editing, where the server (and the ONLYOFFICE or Collabora backend it talks to) sees plaintext by necessity.
What it actually does
CryptPad isn’t just a document editor. It’s a full office suite: rich text, spreadsheets (a real formula engine, not a toy), presentations, a Kanban board, a whiteboard, a code editor with syntax highlighting, and a form builder. There’s also a file drive that acts as a home for everything, with folders and sharing links. If you’ve used any self-hosted alternative to Google Workspace, the surface area will feel familiar — the difference is entirely in what the server is allowed to know.

Sharing works through links, each carrying its own key. You can generate view-only links, edit links, and — for documents you want to lock down further — password-protected links where the password itself becomes part of the key derivation. There’s no user directory to manage for casual sharing; you send someone a link and they’re in, no account required (though CryptPad also supports registered accounts for people who want persistent drives and access control).
How the encryption actually works
It’s worth understanding the mechanism, because it explains every design decision downstream. When you create a document, your browser generates a random symmetric key. That key encrypts the document contents before any network call happens, and it gets embedded into the share URL after the # character — a URL fragment. Browsers treat everything after # as purely client-side; it’s used for scrolling to page anchors, it’s never included in the HTTP request sent to a server, and it doesn’t show up in server access logs, proxy logs, or browser history sync unless you’ve explicitly synced bookmarks somewhere.
So when your server logs GET /pad/abc123, it has genuinely no way to know what abc123#key=... actually decrypts to. Real-time collaboration then happens over CryptPad’s own protocol (built on a variant of the Netflix-derived Chainpad operational-transform library) where each client encrypts its own deltas with the shared key before sending them, and the server’s job is purely to order and relay encrypted messages to every other connected client.
This has one practical consequence worth knowing before you deploy: the key never touches the server, which means the server can never recover it either. There’s no “forgot your document link” support ticket that ends well. If you lose the URL and never registered the document to an account (which stores an encrypted copy of the key, itself protected by your account password), the document is genuinely irretrievable — there’s no admin override, because nobody, including you as the operator, holds a spare key.
Running it
CryptPad ships an official Docker image, and the fastest correct way to get a working instance is docker compose with a reverse proxy in front for TLS. CryptPad is picky about how it’s proxied — it expects specific headers and, for the “sandbox” iframe architecture it uses to isolate untrusted content, a second domain or subdomain pointing at the same instance.
| |
The two domains matter more than they look. CPAD_SANDBOX_DOMAIN is where CryptPad renders the actual document content, inside an iframe, isolated from the domain that holds your login session and API keys. If content on the sandbox domain were ever compromised (a malicious embed, a bug in the document renderer), it can’t reach across to steal your session on the main domain. Skip the sandbox domain and CryptPad will nag you in the admin panel, and rightly so — that separation is the thing standing between “someone pastes a booby-trapped ODF file” and “someone pastes a booby-trapped ODF file that also steals your cookies.”
I run mine behind a reverse proxy the same way I front most things in the lab — see my notes on Nginx location blocks and try_files for the kind of config CryptPad’s websocket upgrade paths need, since real-time collaboration is carried over a persistent WebSocket connection that has to survive the proxy hop cleanly. If that upgrade path is misconfigured you’ll see something that looks exactly like a 502 from Nginx the moment two people try to edit the same document at once, even though a single-user session loads fine.
The parts that trip people up
Two domains, two certificates. If you’re using Let’s Encrypt, you need a cert covering both the main and sandbox domains (a SAN cert or two separate certs). Forgetting the sandbox domain’s certificate is the single most common “why is my document blank” report in CryptPad’s own issue tracker — the iframe silently fails to load over a broken TLS handshake and the main page just shows an empty canvas with no obvious error.
Storage grows differently than you’d expect. Because CryptPad stores encrypted blobs, it can’t deduplicate or compress the way a plaintext-aware system might. A drive full of encrypted spreadsheets and pinned files will use noticeably more disk than the equivalent Office documents sitting on a plain file share. Budget for it, and set up the built-in storage quota system (CPAD_LIMIT config) per user if you’re running this for more than yourself. Unpinned documents also get garbage-collected after a configurable retention window, which surprises people who assumed “I made a pad” meant “it’s permanent” — it isn’t, until someone pins it to an account.
Recovery has a hard floor. Because the server never has the keys, there’s no “admin resets your password and you’re back in” flow for lost recovery phrases on registered accounts. CryptPad gives you a recovery phrase at account creation specifically because losing your password with no phrase means the drive’s plaintext is gone — permanently, by design, because that’s what “the server can’t read it” actually costs. Tell people this clearly before they onboard, or they’ll blame you when it happens. I keep a printed copy of my own recovery phrase in the same fireproof folder as my backup encryption keys, treating it with the same seriousness as a disk-encryption recovery key.
The admin panel needs admin.js wired up manually. Unlike most self-hosted apps where the first user becomes an admin automatically, CryptPad requires you to grab your public signing key from your own account settings and paste it into a config file, then redeploy. It’s a deliberate friction point — admin status shouldn’t be something a compromised database row can grant.
Backups that actually work
Because everything is encrypted at rest, backing up CryptPad’s data directories is unusually low-risk from a confidentiality standpoint — an attacker who steals your backup archive still needs the per-document keys, which never live on the server. Keep backing up anyway: the win is that the backup itself doesn’t have to be protected as fiercely as the live system. A nightly archive of the data, blob, and block volumes, shipped off-box, covers you. Test the restore path occasionally: spin the image up against a copy of the volumes on a throwaway host and confirm a known pad still opens and decrypts. A backup you haven’t restored from is a hypothesis, not a backup.
CryptPad versus the alternatives
Nextcloud with ONLYOFFICE or Collabora gets you tighter integration with a broader file-management platform and server-side full-text search across document contents, at the cost of the server being able to read everything it stores. Etherpad is lighter-weight for plain collaborative text but has no spreadsheet, presentation, or whiteboard modules, and no client-side encryption story at all. Google Docs and Microsoft 365 solve the collaboration problem better than either, at the cost of the data living permanently on someone else’s infrastructure under someone else’s terms of service.
CryptPad’s niche is specific: real-time collaboration where the operator — even a well-intentioned one — genuinely cannot read the content. That’s a narrower promise than “self-hosted,” and it’s the reason I reach for it over Nextcloud’s editor for anything sensitive, while still using Nextcloud for the bulk file storage and sync that CryptPad was never trying to replace.
Troubleshooting
If real-time sync stalls or documents “un-sync” and show a merge conflict banner, it’s almost always the WebSocket path getting mangled by a proxy that isn’t passing Upgrade and Connection headers through, or a load balancer with too aggressive an idle timeout closing the long-lived connection. Check your access log for repeated 101 → connection reset patterns during active editing sessions; that’s the tell.
If the sandbox iframe just shows a spinner forever, open the browser console — nine times out of ten it’s a Content-Security-Policy mismatch between what your reverse proxy is stripping or adding and what CryptPad’s own headers expect. CryptPad sets fairly strict CSP headers itself; don’t let an upstream proxy override them with something looser or, worse, something that conflicts and gets rejected outright by the browser.
If uploads fail past a certain size, check both CPAD_MAX_UPLOAD_SIZE in CryptPad’s own config and your reverse proxy’s client body size limit — both have to agree, and the smaller one wins silently, usually producing a generic “upload failed” toast with no further detail in the UI.
If the admin panel reports the instance is unregistered or refuses to show usage statistics, double check that the public key you pasted into customize/application_config.js matches exactly what your account settings display — a single truncated character from a copy-paste is enough to break it, and CryptPad won’t tell you which character.
Is it worth running
If you already trust your own infrastructure enough to self-host anything, CryptPad’s pitch is subtle: it protects the data even from you, or from anyone who compromises your server after the fact. That’s a genuinely different guarantee than Nextcloud’s “at least it’s not Google,” and it matters if you’re handling anything where a server breach shouldn’t mean a data breach — shared passwords in transit before they land in a proper vault, draft contracts, notes you don’t want sitting in plaintext in a database backup.
The trade-off is real: no server-side search across document contents, no server-side thumbnail generation for previews, and a support burden shifted onto users remembering recovery phrases. For a household or small team that wants a genuinely private shared drive and doesn’t need enterprise document management, it’s one of the more quietly impressive pieces of self-hosted software I run. For a business that needs audit logs of who read what, it’s the wrong tool — the server can’t produce logs of things it never saw.




