OnlyOffice: The Self-Hosted Document Editor That Gives Enterprises a Third Path
Why More and More People Are Using OnlyOffice?
Preface
Developers working on enterprise projects have all run into this kind of requirement.
The business department asks: the system needs online Word editing; customers don't want to download, edit, then upload the file back.
You think the requirement is straightforward, then start hunting for a solution and find every path is blocked.
The first unavoidable thing is private deployment.
Customers are state-owned enterprises or financial institutions; data cannot leave the intranet, so it must be deployed on their own servers or private cloud.
SaaS solutions die at the first step, because the data-export requirement can't be met.
The second thing: the business system needs embedded document editing.
Not sending users to a separate platform to edit, but opening, editing, and saving directly within your own system, then returning to the business workflow.
The third thing: development cost must be manageable.
Buying a commercial SDK that charges per seat: 500 users for a year costs enough to support half a front-end team. That won't pass budget review.
Building it yourself: just rendering .docx in the browser to look close to Word takes a small team half a year, not to mention collaboration algorithms and format compatibility.
All three paths were tried and none really worked.
So what can you do?
This article is dedicated to discussing OnlyOffice, which can help solve these problems.
2. What is OnlyOffice?
OnlyOffice is a privately deployable online document editing engine that supports viewing and editing Word, Excel, PPT, PDF, and forms, and can be embedded into your own system via API.
It is not a cloud drive, nor a collaboration platform meant to replace your business system.
Think of it as a "document editing capability" building block.
Users, permissions, file storage, and business workflows remain managed by your own system. It only handles opening a .docx in the browser, letting people edit, and notifying you to save it back.
It comes in three version tracks: open-source community edition, enterprise edition, and developer edition.
The core editing functionality of the three is essentially the same; the differences lie in licensing and advanced features.
The community edition is free under the AGPL v.3 license, suitable for small teams and testing.
The enterprise edition is a commercial license for internal enterprise deployment, adding an admin panel, advanced security configuration, and technical support.
The developer edition is also commercial, with its core difference being white-labeling: you can replace the logo, change theme colors, and swap the "About" page with your own brand.
3. Four Developer-Relevant Capabilities
3.1 API Integration
This is OnlyOffice's core capability and the first door developers encounter.
The integration model is simple, three things: backend generates config, frontend loads the editor, document service calls back your endpoint to save.
Config mechanism.
Your backend generates a JSON that describes everything about the document: file type, document URL, permissions, user info, interface language, callback URL. This JSON goes to the frontend, which uses it to initialize the editor.
What goes into config and what doesn't is entirely under your control. In the official integration example, config is the editor's "instruction manual".
Frontend loading.
Put a div in your page, include ONLYOFFICE's api.js, then new DocsAPI.DocEditor("div-id", config), and the editor renders in that div.
Users see a page in your system; behind the scenes ONLYOFFICE renders the document.
Callback save.
When the user finishes editing, ONLYOFFICE sends a POST request to your callbackUrl at save time, with a status code and document download URL in the body.
Your backend receives it, downloads the new file, overwrites storage, and returns success. The loop is complete.
50+ connectors.
The official set includes over 50 ready-made connectors covering common systems like Nextcloud, Moodle, Odoo, WordPress, and SharePoint.
If your system happens to be one of these, integration is fast.
But more practically: you can ignore connectors entirely and embed into your own system from scratch using the API directly. The official connectors are essentially working examples of this API; understand one and writing your own isn't hard.
Config in, file pulled, callback on save: a three-step loop.
3.2 Private Deployment
This capability is the immediate reason many people try OnlyOffice for the first time.
Deployment forms.
OnlyOffice Docs supports deployment on local servers, private cloud, and fully offline intranet environments.
The official download page offers Windows and Linux installers, as well as Docker images.
The enterprise product page is explicit: self-hosted deployment, data remains inside your own infrastructure, no third-party data access.
One Docker line to start. The fastest way is Docker:
docker run -i -t -d -p 8080:80 onlyoffice/documentserver
Mount a data directory, configure JWT, and the service runs on your machine.
Local, private cloud, offline intranet: they all use this same setup.
Why this matters.
With data in your own hands, compliance requirements from finance, medical, and government customers become satisfiable.
Documents, user data, audit logs all live in your infrastructure; OnlyOffice's official side never touches your data.
SaaS cannot offer this guarantee, and self-building can't bear the cost; private deployment sits in the middle.
Document service, file storage, and logs sit inside your infrastructure; the official side does not touch data.
3.3 Collaboration
Collaboration is built in, not an external plugin.
Real-time editing.
Multiple people open the same document simultaneously and see each other's cursors, selections, and online status.
Two co-editing modes: fast mode shows everyone's changes in real time; strict mode locks paragraphs so you can focus on writing without interference.
Comments.
Select text and add a comment, @-mention collaborators.
Comments and revisions can coexist, suited for review workflows.
Version history.
The editor shows historical versions of the document, with diff comparison and rollback.
For business scenarios that require an audit trail (contracts, reports, approval drafts), this capability is a must.
Multiple browser windows side by side, different accounts editing the same document, seeing each other's colored cursors and avatars.
3.4 White-Labeling
White-labeling is the developer edition's core difference, and the thing SaaS builders care about most.
What you can change.
Through editorConfig.customization, you can replace the editor interface's logo, dark theme logo, the URL the logo clicks to, and the company name, address, email in the About page.
Theme colors can also be changed.
Customers see your brand, not "Powered by OnlyOffice".
Why it matters.
When selling a SaaS product, brand consistency is part of the product experience.
If a third-party logo suddenly appears inside your product, customers ask "Who is this?" and trust takes a hit.
White-labeling turns OnlyOffice into an "invisible engine" inside your product.
One extra note: OnlyOffice supports offline AI, but it is not on by default after self-hosting. You need to deploy a local model and configure it; that's a separate engineering effort.
4. Hands-on Demo: Spring Boot Integration
The flow has four steps: Docker deployment, backend generates config, frontend loads the editor, handle the save callback.
First, let's clarify the example project structure.
The code that follows comes from onlyoffice-springboot, which uses Spring Boot 3.4.5 and Java 17, with no additional JWT framework; signing and verification use the JDK's HmacSHA256 directly:
onlyoffice-springboot/
├── config/OnlyOfficeProperties.java
├── controller/
│ ├── DocumentController.java
│ ├── FileController.java
│ └── OnlyOfficeController.java
├── service/
│ ├── DocumentStorageService.java
│ ├── FileAccessService.java
│ ├── JwtService.java
│ └── OnlyOfficeCallbackService.java
└── resources/static/
├── index.html
└── editor.html
Step 1: Docker deployment with JWT config.
docker run -i -t -d -p 8080:80 \
-e JWT_ENABLED=true \
-e JWT_SECRET=susantest123456 \
-v /data/onlyoffice/data:/var/www/onlyoffice/Data \
onlyoffice/documentserver
Keep JWT_SECRET in mind; both the backend config generation and callback validation will use it.
Not setting one, or using a weak secret, is equivalent to leaving the document service naked on the public internet. Don't do that.
After Docker is up, don't rush into code. Take two minutes to confirm the service is truly ready.
First check the actual container name or ID:
docker ps
More rigorously, check the version info inside the container:
docker exec 3eff4ef3b2b6 curl -s http://127.0.0.1:8000/info/info.json | grep buildVersion
Normally it returns something like "buildVersion":"10.0.0".
Note: don't curl the container's 8000 port from the host; that port isn't mapped out, so not finding it is normal.
The most direct way is to open http://你的服务器IP:8080/welcome/ in a browser. When you see the "ONLYOFFICE Docs Community Edition installed" welcome page, the main service is up.
If the page won't open, first docker ps to see if the container is Up, then docker logs to look for errors.
Also confirm the JWT config took effect:
docker exec 3eff4ef3b2b6 documentserver-jwt-status.sh
This command shows the current JWT enabled state and secret. Compare it with the JWT_SECRET set in docker run; if they match, the config is correct.
The backend generates config and validates callbacks using this same secret. If they don't match, the editor will white-screen with a message about an incorrect document security token.
The project's configuration entry is as follows; here's a snippet from application.yml:
server:
port: ${SERVER_PORT:8081}
address: 0.0.0.0
onlyoffice:
docs-url: ${ONLYOFFICE_DOCS_URL:http://localhost:8080}
public-app-url: ${APP_PUBLIC_URL:https://your-app.example.com}
jwt-secret: ${ONLYOFFICE_JWT_SECRET:}
storage:
directory: ${DOCUMENT_STORAGE_DIR:./data/documents}
A special reminder here: docs-url is the address the browser uses to load api.js, while public-app-url is the address the ONLYOFFICE server uses to download files and send callbacks.
In local debugging, don't casually set public-app-url to http://localhost:8081.
The remote document service can't reach localhost on your machine; you'll get "This file cannot be saved" at save time.
Here's the core JwtService code snippet, responsible for signing HS256 tokens for config and file download URLs, and verifying callback requests:
@Service
public class JwtService {
private static final Base64.Encoder BASE64_URL_ENCODER =
Base64.getUrlEncoder().withoutPadding();
private static final Base64.Decoder BASE64_URL_DECODER =
Base64.getUrlDecoder();
private static final TypeReference<Map<String, Object>> MAP_TYPE =
new TypeReference<>() {};
private final ObjectMapper objectMapper;
private final OnlyOfficeProperties properties;
public JwtService(ObjectMapper objectMapper, OnlyOfficeProperties properties) {
this.objectMapper = objectMapper;
this.properties = properties;
}
public String sign(Map<String, Object> claims) {
if (!properties.jwtEnabled()) {
throw new IllegalStateException("onlyoffice.jwt-secret 未配置");
}
try {
Map<String, Object> payload = new LinkedHashMap<>(claims);
long now = Instant.now().getEpochSecond();
payload.putIfAbsent("iat", now);
payload.putIfAbsent("exp", now + 3600);
String header = encodeJson(Map.of("alg", "HS256", "typ", "JWT"));
String body = encodeJson(payload);
String signingInput = header + "." + body;
return signingInput + "."
+ BASE64_URL_ENCODER.encodeToString(hmac(signingInput));
} catch (Exception exception) {
throw new IllegalStateException("生成 JWT 失败", exception);
}
}
public Map<String, Object> verify(String token) {
if (!properties.jwtEnabled()) {
return Map.of();
}
if (token == null || token.isBlank()) {
throw new IllegalArgumentException("请求缺少 JWT");
}
try {
String[] parts = token.split("\\.");
if (parts.length != 3) {
throw new IllegalArgumentException("JWT 格式错误");
}
String signingInput = parts[0] + "." + parts[1];
byte[] expected = hmac(signingInput);
byte[] actual = BASE64_URL_DECODER.decode(parts[2]);
if (!MessageDigest.isEqual(expected, actual)) {
throw new IllegalArgumentException("JWT 签名无效");
}
Map<String, Object> claims = objectMapper.readValue(
BASE64_URL_DECODER.decode(parts[1]), MAP_TYPE);
Number expiresAt = (Number) claims.get("exp");
if (expiresAt != null
&& expiresAt.longValue() < Instant.now().getEpochSecond()) {
throw new IllegalArgumentException("JWT 已过期");
}
return claims;
} catch (IllegalArgumentException exception) {
throw exception;
} catch (Exception exception) {
throw new IllegalArgumentException("JWT 校验失败", exception);
}
}
private String encodeJson(Map<String, Object> value) throws Exception {
return BASE64_URL_ENCODER.encodeToString(
objectMapper.writeValueAsBytes(value));
}
private byte[] hmac(String input) throws GeneralSecurityException {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(
properties.jwtSecret().getBytes(StandardCharsets.UTF_8),
"HmacSHA256"));
return mac.doFinal(input.getBytes(StandardCharsets.UTF_8));
}
}
Two key points in this code.
First, signature comparison uses MessageDigest.isEqual, not plain string comparison.
Second, config and file download use separate tokens. The config token is for ONLYOFFICE to validate the editor configuration; the download token carries fileId and purpose and only allows the document service to pull a specific file. The two permission scopes are not mixed, which also makes debugging clearer.
Step 2: Backend generates config.
Two things matter here: how document.key is generated, and how file access works.
@GetMapping("/config/{fileId}")
public Map<String, Object> getConfig(@PathVariable Long fileId) {
StoredFile file = fileRepository.mustFind(fileId);
// key 用 文件ID + 版本号
String documentKey = file.getId() + "_" + file.getVersion();
Map<String, Object> document = new LinkedHashMap<>();
document.put("fileType", "docx");
document.put("key", documentKey);
document.put("title", file.getOriginalName());
// 这个 url 是 ONLYOFFICE 服务端去拉的,不是浏览器
document.put("url", "https://your-app.com/api/files/" + fileId + "/download");
Map<String, Object> editorConfig = new LinkedHashMap<>();
editorConfig.put("callbackUrl", "https://your-app.com/api/office/callback/" + fileId);
editorConfig.put("lang", "zh-CN");
editorConfig.put("user", Map.of("id", currentUserId(), "name", currentUserName()));
Map<String, Object> config = new LinkedHashMap<>();
config.put("document", document);
config.put("editorConfig", editorConfig);
config.put("token", jwtSigner.sign(config));
return config;
}
document.key uses "file ID + version number". After a successful save, the version increments, so the next open naturally has a new key.
Don't casually piece together a key from the filename or timestamp; that leads to problems.
The project fills out the config generation logic as above.
Here is the core OnlyOfficeController code snippet, where permissions, users, callbacks, and config signing are all gathered:
@GetMapping("/config/{id}")
public Map<String, Object> config(
@PathVariable String id,
@RequestParam(defaultValue = "demo-user") String userId,
@RequestParam(defaultValue = "演示用户") String userName,
@RequestParam(defaultValue = "edit") String mode) {
DocumentInfo file = storageService.get(id);
String normalizedMode = "view".equalsIgnoreCase(mode) ? "view" : "edit";
Map<String, Object> document = new LinkedHashMap<>();
document.put("fileType", file.fileType());
document.put("key", file.documentKey());
document.put("title", file.name());
document.put("url", fileAccessService.createDownloadUrl(file.id()));
document.put("permissions", Map.of(
"edit", "edit".equals(normalizedMode),
"download", true,
"print", true
));
Map<String, Object> customization = new LinkedHashMap<>();
customization.put("autosave", true);
customization.put("compactHeader", false);
customization.put("comments", true);
customization.put("feedback", false);
customization.put("forcesave", false);
customization.put("help", false);
customization.put("hideRightMenu", false);
Map<String, Object> editorConfig = new LinkedHashMap<>();
editorConfig.put("mode", normalizedMode);
editorConfig.put("lang", "zh-CN");
editorConfig.put("callbackUrl", properties.publicUrl(
"/api/office/callback/" + file.id()));
editorConfig.put("user", Map.of(
"id", safeUserValue(userId, "demo-user"),
"name", safeUserValue(userName, "演示用户")
));
editorConfig.put("customization", customization);
editorConfig.put("coEditing", Map.of("mode", "fast", "change", true));
Map<String, Object> config = new LinkedHashMap<>();
config.put("type", "desktop");
config.put("documentType", documentType(file.fileType()));
config.put("document", document);
config.put("editorConfig", editorConfig);
config.put("width", "100%");
config.put("height", "100%");
if (properties.jwtEnabled()) {
config.put("token", jwtService.sign(config));
}
Map<String, Object> response = new LinkedHashMap<>(config);
response.put("docsApiUrl", properties.docsApiUrl());
response.put("documentInfo", file);
return response;
}
private String documentType(String fileType) {
return switch (fileType) {
case "xls", "xlsx", "csv" -> "cell";
case "ppt", "pptx" -> "slide";
case "pdf" -> "pdf";
default -> "word";
};
}
There is an ordering constraint: first fill document and editorConfig completely, then sign the whole config.
The signed content must match exactly what the frontend receives.
For file access, the url is requested by the ONLYOFFICE server, not the browser.
If the file is on an intranet, the document service container must be able to reach that address; otherwise the browser can download but the editor keeps spinning with a download failure.
The project doesn't expose /api/files/{id}/download naked; instead it issues the document service a 15-minute download token.
Here is the FileAccessService implementation:
@Service
public class FileAccessService {
private final JwtService jwtService;
private final OnlyOfficeProperties properties;
public FileAccessService(
JwtService jwtService,
OnlyOfficeProperties properties) {
this.jwtService = jwtService;
this.properties = properties;
}
public String createDownloadUrl(String documentId) {
String path = "/api/files/" + documentId + "/download";
if (!properties.jwtEnabled()) {
return properties.publicUrl(path);
}
Map<String, Object> claims = new LinkedHashMap<>();
claims.put("fileId", documentId);
claims.put("purpose", "document-download");
claims.put("iat", Instant.now().getEpochSecond());
claims.put("exp", Instant.now().plusSeconds(900).getEpochSecond());
String token = jwtService.sign(claims);
return UriComponentsBuilder.fromUriString(properties.publicUrl(path))
.queryParam("access_token", token)
.build(true)
.toUriString();
}
public void verifyDownload(String documentId, String token) {
if (!properties.jwtEnabled()) {
return;
}
Map<String, Object> claims = jwtService.verify(token);
if (!documentId.equals(claims.get("fileId"))
|| !"document-download".equals(claims.get("purpose"))) {
throw new IllegalArgumentException("下载令牌与文档不匹配");
}
}
}
When the document service actually pulls the file, it requests something like:
https://your-app.example.com/api/files/welcome-word/download?access_token=eyJ...
The download endpoint verifies the token first, then reads the file from storage:
@GetMapping("/{id}/download")
public ResponseEntity<byte[]> download(
@PathVariable String id,
@RequestParam(name = "access_token", required = false)
String accessToken) {
fileAccessService.verifyDownload(id, accessToken);
DocumentInfo document = storageService.get(id);
byte[] content = storageService.read(id);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(mediaType(document.fileType()));
headers.setContentDisposition(ContentDisposition.attachment()
.filename(document.name(), StandardCharsets.UTF_8)
.build());
headers.setCacheControl(CacheControl.noStore().cachePrivate()
.maxAge(Duration.ZERO));
return ResponseEntity.ok().headers(headers).body(content);
}
A request without access_token will get a 400 response straight away.
This way, even if a browser knows the file ID, it can't get the document content; only a short-lived token signed by the backend lets the document service complete the pull.
Step 3: Frontend loads the editor.
<div id="office-editor" style="width:100%; height:100vh;"></div>
<script src="https://your-docserver/web-apps/apps/api/documents/api.js"></script>
<script>
const config = await fetch(`/api/office/config/${fileId}`).then(r => r.json());
new DocsAPI.DocEditor("office-editor", config);
</script>
The project doesn't hard-code api.js in the page; it first requests config, then dynamically loads the script from the docsApiUrl returned in config.
Here is the core editor.js snippet:
async function startEditor() {
const query = new URLSearchParams({ userId, userName, mode });
const response = await fetch(
`/api/office/config/${encodeURIComponent(documentId)}?${query}`,
{ cache: "no-store" }
);
const config = await response.json();
if (!response.ok) {
throw new Error(config.message || "无法获取编辑器配置");
}
await loadDocsApi(config.docsApiUrl);
config.events = {
onAppReady: () => {
loadingPanel.hidden = true;
},
onDocumentReady: () => {
setStatus("saved", "文档已加载");
},
onDocumentStateChange: event => {
const changed = Boolean(event?.data);
setStatus(
changed ? "changed" : "idle",
changed ? "有未保存修改" : "编辑器内已同步"
);
},
onError: event => {
const code = event?.data?.errorCode ?? "unknown";
const description =
event?.data?.errorDescription || "ONLYOFFICE 返回未知错误";
showError(`错误码 ${code}:${description}`);
},
onRequestClose: () => {
window.location.href = "/";
}
};
new DocsAPI.DocEditor("office-editor", config);
}
function loadDocsApi(url) {
return new Promise((resolve, reject) => {
const script = document.createElement("script");
script.src = url;
script.async = true;
script.onload = resolve;
script.onerror = () => reject(
new Error("无法加载 ONLYOFFICE api.js,请检查文档服务地址。")
);
document.head.appendChild(script);
});
}
Note that onDocumentStateChange(false) only means the editor's internal state is synced; it does not mean Spring Boot has received status=2 and flushed the file to disk. The real save result must be checked via the server's callback logs.
Step 4: Handle the save callback.
On status=2 or 6, download the new file, update storage, and refresh the key.
@PostMapping("/callback/{fileId}")
public Map<String, Integer> callback(@PathVariable Long fileId,
@RequestBody Map<String, Object> body) {
if (!jwtVerifier.verify(body)) return Map.of("error", 1);
int status = (int) body.get("status");
if (status == 2 || status == 6) {
String downloadUrl = (String) body.get("url");
byte[] newContent = restTemplate.getForObject(downloadUrl, byte[].class);
fileStorage.update(fileId, newContent);
fileRepository.incrementVersion(fileId); // 刷新 key
}
return Map.of("error", 0);
}
The code above preserves the main callback flow. The project splits "signature verification, download, write file, bump version" across OnlyOfficeCallbackService and DocumentStorageService. Here is the core OnlyOfficeCallbackService snippet:
public Map<String, Integer> receive(
String documentId,
Map<String, Object> body) {
try {
Object token = body.get("token");
jwtService.verify(token == null ? null : token.toString());
int status = statusOf(body);
log.info("OnlyOffice callback: document={}, status={}, key={}",
documentId, status, body.get("key"));
if (status == 2 || status == 6) {
Object downloadUrl = body.get("url");
if (!(downloadUrl instanceof String url) || url.isBlank()) {
throw new IllegalArgumentException(
"OnlyOffice 回调缺少保存地址");
}
byte[] content = restClient.get()
.uri(url)
.accept(MediaType.APPLICATION_OCTET_STREAM)
.exchange((request, response) -> {
if (!response.getStatusCode().is2xxSuccessful()) {
throw new IllegalStateException(
"下载 OnlyOffice 文件失败: "
+ response.getStatusCode());
}
byte[] bytes = response.getBody()
.readNBytes(MAX_DOWNLOAD_BYTES + 1);
if (bytes.length > MAX_DOWNLOAD_BYTES) {
throw new IllegalArgumentException(
"OnlyOffice 文件超过 50 MB");
}
return bytes;
});
var updated = storageService.updateContent(documentId, content);
log.info(
"OnlyOffice document saved: document={}, version={}, size={}",
documentId, updated.version(), updated.size());
}
return Map.of("error", 0);
} catch (Exception exception) {
log.error(
"OnlyOffice callback failed: document={}",
documentId, exception);
return Map.of("error", 1);
}
}
private int statusOf(Map<String, Object> body) {
Object value = body.get("status");
if (value instanceof Number number) {
return number.intValue();
}
if (value instanceof String text) {
return Integer.parseInt(text);
}
throw new IllegalArgumentException("OnlyOffice 回调缺少 status");
}
The RestClient here sets a 10-second connection timeout, 60-second read timeout, and limits the download to 50 MB max, so callback threads aren't hung up by anomalous addresses.
For status codes, just track the following ones:
| Status | Meaning | Handling |
|---|---|---|
1 |
Document being edited | Log it |
2 |
Document closed, needs save | Download file and update version |
4 |
Closed without changes | Return success |
6 |
Force save | Download file and update version |
7 |
Force save error | Log it, don't overwrite original |
Finally, when writing to disk, the project doesn't write directly to the target file; it writes a temporary file first, then atomically replaces it:
public synchronized DocumentInfo updateContent(
String id,
byte[] content) {
if (content == null || content.length == 0) {
throw new IllegalArgumentException("OnlyOffice 返回了空文件");
}
DocumentInfo current = get(id);
DocumentInfo updated = current.withContent(content.length);
try {
writeContent(updated, content);
documents.put(id, updated);
persistMetadata();
return updated;
} catch (IOException exception) {
throw new IllegalStateException("更新文档内容失败", exception);
}
}
private void writeContent(
DocumentInfo document,
byte[] content) throws IOException {
Path target = contentPath(document);
Path temporary = storageDirectory.resolve(document.id() + ".tmp");
Files.write(temporary, content);
Files.move(
temporary,
target,
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.ATOMIC_MOVE
);
}
withContent generates a new version number:
public DocumentInfo withContent(long newSize) {
return new DocumentInfo(
id,
name,
fileType,
version + 1,
newSize,
Instant.now()
);
}
The next open uses id + "_" + version as a new document.key, so old cache is not reused.
Pitfall reminders, said in advance.
If the key isn't updated, collaboration breaks.
If the file has changed but the old key is still used, users will see a cached old version, or collaboration state becomes chaotic.
If the callback doesn't save, users think "content was lost".
If the callback returns non-zero or times out, ONLYOFFICE treats the save as failed, and next time users open the document they see the version before editing.
If JWT mismatches, the editor fails to load.
If the backend has JWT configured but the Docker environment variable is missing or different, the editor white-screens with "incorrect document security token format".
The actual running effect of the project:
Online Word editing effect:
Online Excel editing effect:
5. Scenario Quick Reference
After covering the four capabilities and the hands-on demo, the remaining question for selection is simply: your scenario decides the version.
The three feature tiers are not much different; what differs is licensing, concurrency, and brand control.
This table summarizes version selection:
| Scenario | Choose | Key constraints |
|---|---|---|
| Small team, testing | Community | AGPL v.3 copyleft; concurrency cap was 20, removed since 9.4 |
| Internal enterprise deployment, keep brand | Enterprise | ≥50 concurrent; yearly or perpetual license |
| Providing SaaS service, need white-label | Developer | White-label; yearly license only |
| Deploying separately for each customer | Depends on brand need | Choose Developer for white-label, Enterprise to keep brand |
6. Final Thoughts
Looking back at the three initial problems: SaaS can't let data leave the intranet, commercial SDKs charge per seat and can't be afforded, and self-building has hidden costs that are too high. With all three dead ends, people start looking for a "third path".
OnlyOffice's answer is to turn "document editing" from a service into a component you can install inside your own system.
Data sits on your own server, capability embeds into your business flow via API, licensing chosen by scenario, budget controlled.
It's not perfect: the community edition has AGPL constraints and concurrency limits, white-labeling only comes with the developer edition, and offline AI requires you to deploy a model separately. But in the coordinate system of "private, integrable, cost-controlled", it does clear the blocked path.
So the "third choice" for document collaboration is not cheaper SaaS, nor yet another self-built wheel.
It's an editing engine where data stays in your hands and capability can be embedded into your own system.
When making a choice, first answer two questions: does data need to stay in your hands, and does the brand need to be yours?
The answers to those two basically decide whether you look at the community, enterprise, or developer edition.
The rest is left to a one-line Docker command and a config.
7. Get Links
- Online trial: https://www.onlyoffice.com/zh/signup
- Local deployment: https://www.onlyoffice.com/zh/download
- Open source repo: https://github.com/ONLYOFFICE/DocumentServer
Learn more:
- Enterprise edition overview: https://www.onlyoffice.com/zh/docs-enterprise
- Developer edition overview: https://www.onlyoffice.com/zh/for-developers
- Pricing and version comparison: https://www.onlyoffice.com/zh/pricing
- Help center: https://helpcenter.onlyoffice.com/zh/
- API documentation: https://api.onlyoffice.com/zh-CN/