Nextcloud and Onlyoffice on the same server

Hallo everyone

I have a problem connection to my Onlyoffice Documentserver from Nextcloud.
After 30 hours of trying I give up - please help!

I tryed 7 documentations to run onlyoffice and nextcloud on the same server (with and without docker)

The last one I tried was this one:

But after saving the setting in my Nextcloud I get this error:
Error when trying to connect (Error occurred in the document service: Invalid token)

I also did:

‘onlyoffice’ =>
array (
‘verify_peer_off’ => true,
in my nextcloud.conf

BTW: The Onlyoffice-Document Server is running
I checked the link in my browser

My Nextcloud is running perfectly :wink:
!!! Thanks guys for this awesome software !!!

sorry for bad englisch

Nextcloud version 15.02:
Operating system and version Ubuntu 18.04:
Apache or nginx version _Apache/2.4.29
PHP version _7.2


The error message

indicates, that there is an issue with the security token. This token is some security token you can define to forbid others to use your onlyoffice server. So you define some kind of password which then needs to be entered and sent by every server who tries to use your Onlyoffice server.
In Nextcloud as admin user (in admin settings) you can define this token here:

You probably defined your own security string in Onlyoffice. Make sure you enter the same security string here as well.

Thanks that was fast :wink:

now I purged all container an images in docker und did:

docker run -i -t -d -p -e JWT_ENABLED=‘true’ -e JWT_SECRET=‘hereIdidPW’ --restart=always onlyoffice/documentserver
-v /var/app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice
-v /var/app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data
-v /var/app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice
-v /var/app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver

now I get

Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.)

Okay, that seemed to fix the issue with the secret and the next step is performed. Unfortunately, I’m stuck at that point as well and opened another thread for it:

wow nice of you

thank you very mutch!!

@Schmu hi please let me know if there will be a solution to this problem


it’s not (yet) working with selfsigned certificates.
but you can setup nc & onlyoffice in 20min with three lines on your cli.
(+ some changes in the inventory file. see readme.)

don’t run this on your existing server. that wouldn’t work. for sure. @ your own risk.

1 Like


Thanks for the response!
The problem is that the cloud is in use, so it has to be online.

So I have to hope onlyoffice is fixing this.

I don’t use docker but I do run OnlyOffice and Nextcloud on the same hardware. If you can’t get this to work then maybe my preferred option is worth evaluating: I use LXC, which is Ubuntu’s built-in container hypervisor. So I run two seperate LXC instances on my physical server, and they both work flawlessly (until I break them, usually with an update or something). I connect via Letsencrypt SSL certs which are free and I couldn’t be happier with the performance.

However, if you have never used LXC it’s something new to learn… Basically it’s like Docker but different - and almost certainly much faster, as LXC runs at near metal speed. If all else fails, try LXC…?

Good luck

lets try!!