OnlyOffice: The Self-Hosted Document Editor That Gives Enterprises a Third Path
Regulated industries now have a viable middle ground between expensive per-seat SDK licensing and months of self-built document rendering: data stays on your infrastructure while users get a full-fidelity editor inside your own app. For SaaS vendors, the developer edition's white-labeling removes the third-party trust problem that otherwise kills embedded editing products.
Enterprise developers face a familiar dead end: SaaS editors fail data-stays-on-premises requirements, commercial SDKs charge per seat, and building a .docx renderer from scratch burns half a team for months. OnlyOffice offers a fourth alternative: a document editing engine you deploy yourself, embed via API, and control end to end.
The integration model is clean and developer-friendly. The backend generates a config JSON describing the document and editor settings; the frontend loads ONLYOFFICE's api.js and initializes the editor in a div; and the document server POSTs to your callback endpoint when saving, carrying a status and download URL. Private deployment works with a single Docker command, collaboration is built in (real-time cursors, comments, version history), and the developer edition adds white-labeling so SaaS vendors can strip all OnlyOffice branding.
A complete Spring Boot 3.4.5 + Java 17 example demonstrates the full loop: Docker deployment with JWT, config generation with a versioned document.key, short-lived download tokens for file access, callback handling with status codes 2 and 6 triggering saves, and atomic file replacement. The article also warns about key pitfalls: mismatched JWT secrets white-screen the editor, stale document keys break collaboration, and a callback returning non-zero makes users lose edits.
The three-tier licensing scheme is deliberately structured to push SaaS vendors toward the developer edition: white-labeling is the one feature that directly affects their revenue, so the article's advice to 'decide on brand needs first' is effectively a decision to pay for it.
The callback design treats document.key as the source of truth for caching; a stale key causes silent collaboration corruption, which makes version-aware key generation a correctness requirement rather than an optimization.
The article's 50 MB download cap and atomic file replacement show that production-grade integration is about defending against slow or malicious document servers, not just wiring endpoints together.