Technical Anshu
Tutorials Blog
📄 OnlyOffice + Nextcloud Setup

Install OnlyOffice Document Server and Connect It to Nextcloud

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.

✍️ Technical Anshu🐧 Linux Server + Docker⏱️ One sitting setup
🎥 Watch the full installation and integration process in the video above, step by step

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.

Nextcloud — Settings — ONLYOFFICE (connector app)
Document Server addresshttps://office.example.com
Secret keymust match JWT_SECRET on the server
Connection check on SaveOK
Editor opens inside NextcloudDocs, Sheets, Slides
The connector settings panel inside Nextcloud — illustrative values shown as an example.
1

First Understand the Two Pieces

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.

2

Give the Document Server Its Own Address

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.

3

Install the Document Server with Docker

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:

  1. Make sure Docker is installed and running on the server
  2. Choose a long random secret — this becomes the shared key between the two servers
  3. Run the container with your secret set explicitly:

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.

4

Check the Document Server Is Alive

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.

5

Install the Connector App in Nextcloud

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.

6

Enter the Address and the Secret Key

Open Settings → ONLYOFFICE in Nextcloud and fill in two things:

  1. Document Server address — the address from step 2, for example https://office.example.com
  2. Secret key — exactly the same value you passed as JWT_SECRET when starting the container. One character different and the connection is refused
  3. Press Save — the connector immediately tests the connection and reports whether it succeeded

If 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).

7

Open a Document and Test a Real Edit

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.

🔴 The whole integration stands on one secret. The 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.

🎥 Watch the Complete Setup in the Video

The full OnlyOffice Document Server install and Nextcloud integration, shown live step by step.

▶️ Watch Full Video
❓ Common Questions (FAQ)

Is the OnlyOffice Document Server free to self-host?

The 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.

Can OnlyOffice and Nextcloud run on the same server?

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.

Why does the connector ask for a secret key?

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.

This guide is based on the Technical Anshu video on installing OnlyOffice Document Server with Nextcloud • Stuck on a step? Ask in the video comments — you will get an answer there 🙏