Your Nextcloud stores the files but cannot edit documents properly. The OnlyOffice Document Server is the missing editing engine — here is the full Docker install plus the connector setup that joins the two, with the one secret-key mistake that breaks most first attempts.
Nextcloud alone gives you storage and sharing, but opening a Word or Excel file inside it needs a real editor. That editor is the OnlyOffice Document Server — a second service you host yourself, which Nextcloud talks to through a small connector app. This guide walks the exact route from the video: install the Document Server with Docker, then connect it to Nextcloud. One honest warning before we start — the Document Server is a heavyweight service, not a tiny plugin. Give it a proper server and its own address, and the rest of this page goes smoothly.
There are two separate servers in this setup, and most confusion comes from mixing them up. Nextcloud stores your files, users and sharing — it never edits a document itself. The OnlyOffice Document Server (also called OnlyOffice Docs) is the editing engine — it renders the document editor in the browser, applies every keystroke, and sends the finished file back to Nextcloud for saving.
The connector app inside Nextcloud is the bridge between them. It tells Nextcloud where the Document Server lives and proves, with a shared secret key, that the two servers are allowed to talk to each other. When a user clicks a Word or Excel file, the editor actually loads from the Document Server while the file stays stored in Nextcloud.
The Document Server needs its own subdomain or server address, for example office.example.com, separate from your Nextcloud address like cloud.example.com. Create the DNS record first and let it point to the machine that will run OnlyOffice. Trying to hide both services under one address with paths is where most first installs get stuck, so keep it simple: one name for Nextcloud, one name for the Document Server.
The route shown in the video is the Docker install on a Linux server, which is also the route OnlyOffice documents officially. One command starts everything:
sudo docker run -i -t -d -p 80:80 --restart=always -e JWT_SECRET=your-own-secret-here -v /app/onlyoffice/logs:/var/log/onlyoffice -v /app/onlyoffice/data:/var/www/onlyoffice/Data -v /app/onlyoffice/lib:/var/lib/onlyoffice onlyoffice/documentserver
Setting JWT_SECRET yourself is not optional decoration. If you skip it, the container generates a random secret — and since version 7.2 that secret is regenerated on every reboot, which silently breaks the Nextcloud connection after the first restart. The three -v volume mounts keep logs, certificates and cache outside the container so an update does not wipe them.
Give the container a couple of minutes to start, then open http://office.example.com in a browser. You should see the OnlyOffice Docs welcome page confirming the services are running. You can also check on the server with sudo docker ps — the onlyoffice/documentserver container should be listed as up. Do not move to Nextcloud until this page loads; connecting a dead server only creates confusing errors later.
Now switch to Nextcloud. Log in as an admin, open the Apps section, search for ONLYOFFICE, and install and enable the official connector app. This app is free and is published in the Nextcloud app store — there is nothing to upload manually.
Open Settings → ONLYOFFICE in Nextcloud and fill in two things:
https://office.example.comJWT_SECRET when starting the container. One character different and the connection is refusedIf the save succeeds, the integration is live. If it fails, the error message tells you which side to investigate — an address problem, or a secret mismatch (the JWT error has its own detailed guide linked from our case pages).
Finish with a real test, not just a green tick. Upload a Word or Excel file to Nextcloud, click it, and confirm the OnlyOffice editor opens. Type something, close the document, wait a few seconds for the save to complete, and download the file to check your edit is inside. Also try opening the same document in a second browser profile — co-editing should show both cursors. If all of that works, your self-hosted office is ready for the team.
JWT_SECRET in the Docker command and the secret key in the Nextcloud connector settings must be identical, character for character. Mismatch is the number one reason a fresh install refuses to connect — and if you let the container generate a random secret instead of setting your own, the connection will break by itself at the next server reboot.
The full OnlyOffice Document Server install and Nextcloud integration, shown live step by step.
▶️ Watch Full VideoThe Community Edition of OnlyOffice Docs and the Nextcloud connector app are free to install and use. The free edition is built for small teams and has limits compared with the paid Enterprise editions — check the current limits page of your version before planning a large rollout.
Yes, many small setups run both on one machine, with the Document Server in Docker and its own subdomain. Just remember the Document Server is resource-hungry: the machine needs enough spare RAM and CPU for both services, or editing will feel slow for everyone.
The secret signs the requests between Nextcloud and the Document Server (JWT), so a random website cannot ask your Document Server to open or convert files. Both sides must hold the same secret — that shared value is what proves the two servers trust each other.