Get Started

Document Editing (ONLYOFFICE)

Word, Excel, PowerPoint, and PDF files can be edited directly in the browser — no download/edit/re-upload round trip.

SmartKMS embeds an ONLYOFFICE Document Server for in-browser editing. Edits save straight back to MinIO through a callback the Document Server calls when the user hits save.

Starting It

docker compose up -d onlyoffice

The first run downloads the ONLYOFFICE image (roughly 1–1.5 GB) and can take a minute or two to become healthy.

Verify:

docker compose ps

skms_onlyoffice should show as healthy (its healthcheck hits its own /healthcheck endpoint).

How It Fits Together

  • The browser loads the editor's JS API from ONLYOFFICE_URL (http://localhost:8080 by default).
  • The ONLYOFFICE container fetches the source file directly from MinIO using ONLYOFFICE_S3_ENDPOINT, and calls the API back at ONLYOFFICE_INTERNAL_CALLBACK_URL to save edits — both of these are container-to-container addresses on the Docker network, not localhost, since from inside a container localhost means itself.
  • ONLYOFFICE_JWT_SECRET is set once, in .env. docker-compose.yml passes it to both the API and the onlyoffice container, so both sides sign and verify with the same secret. ONLYOFFICE rejects requests with a missing or wrong signature once JWT is enabled.

Resource Requirements

ONLYOFFICE is genuinely resource-hungry Its own documentation recommends at least 2 vCPU and 6 GB of RAM dedicated to just this one container. Below that, it silently falls back to running its file-conversion step embedded in the same process instead of forking dedicated workers, which can make editing feel like it's hanging rather than failing outright with an error. If documents open reliably but take a long time to render, this is the most likely cause — worth keeping in mind on lower-spec development machines.

Previewing

Opening a Word, Excel or PowerPoint document shows it in ONLYOFFICE's read-only viewer — the same rendering engine as the editor, so what you see is exactly what Edit opens — both in the Documents page and in the quick preview from AI Search results, chat citations and the Dashboard. PDFs and images use the browser's own viewer and don't need the Document Server. If the viewer can't be reached, the pane falls back to a file-type icon with a "Preview unavailable" note.

Saving and Closing

While editing, the top bar shows Save and Close:

  • Save writes your changes to SmartKMS right away (a new version, re-analyzed in the background) and keeps the editor open. ONLYOFFICE's own File → Save does the same.
  • Close with nothing changed just closes. With unsaved changes it asks Save & close, Discard changes or Keep editing. The viewer's ✕ button and closing the browser tab ask the same question.
  • Discard throws the session's unsaved edits away for good: the document reopens as it was last saved.

Edits are synced to the Document Server continuously while you type, but they only reach SmartKMS' storage on Save (or when you close and choose Save & close) — a browser crash mid-session is recovered by the Document Server's own autosave, which delivers the session's edits once it notices the disconnect.

Version History

Every save from the editor creates a new version of the document. For Word, Excel, PowerPoint and PDF files, history lives inside the editor itself: open the document with Edit, then choose File → Version History in ONLYOFFICE's menu.

  • Each version shows who saved it and when. Clicking one opens it read-only in the same editor.
  • Versions saved since 1.8.0 also carry ONLYOFFICE's change record, so the panel can highlight what changed compared with the version before it. Older versions open fine but without highlighting.
  • Restore puts that version's file back as the current document. The version you're replacing is kept as its own entry first, so a restore can always be undone, and the document is re-analyzed (summary, search index) in the background.
  • Closing the history view reopens the editor on the current version.

Behind the scenes the panel reads the same document_versions rows the rest of the app uses — see Architecture → How Editing and Version History Work.

Troubleshooting

Document editor stuck loading forever, or "SignatureDoesNotMatch" in the container logs

Check the logs for the actual error:

docker logs skms_onlyoffice --tail 100

Two known causes:

  • If it's a MinIO SignatureDoesNotMatch error: S3_ENDPOINT and ONLYOFFICE_S3_ENDPOINT must both point somewhere MinIO is actually reachable from that respective caller — a presigned URL is signed for one specific host and will be rejected if used against a different one.
  • If there's no error at all and it's just slow: see Resource Requirements above — this is usually a resource-constraint symptom, not a bug.
Adblockers can break the document editor Browser extensions like uBlock Origin, AdBlock, or Privacy Badger may block ONLYOFFICE's JavaScript API or the requests it makes to load assets. If the editor stays stuck on the loading spinner with no errors in the console, try temporarily disabling your adblocker for the SmartKMS domain or adding it to the allowlist.
On this page