I recently reported hastily that OnlyOffice in Nextcloud would generally no longer work properly.
However, this is generally not correct and I did premature conclusions for some points. Ascensio System also got in touch with me and did everything possible to help me with my problems – thank you!
I removed the original post because it was based on incorrect assumptions.
Document Server for Docker
The official version is the Document Server for Docker, which can be found at https://hub.docker.com/r/onlyoffice/documentserver/. In addition you need the official integration app. This version works for me without any problems.
The Docker installation was done in the following way (with a different password and port instead of 8006):
docker pull onlyoffice/documentserver docker run -i -t -d --name="onlyoffice" -p 127.0.0.1:8006:80 --restart=always -e JWT_ENABLED="true" -e JWT_SECRET="secret" onlyoffice/documentserver
This way the Docker container can be reached using HTTP on port 8006. To be able to use the service with HTTPS in Nextcloud, you need to set up a unique subdomain for OnlyOffice and use Apache as proxy with the following settings as part of the <VirtualHost>
section:
SetEnvIf Host "^(.*)$" THE_HOST=$1 RequestHeader setifempty X-Forwarded-Proto https RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e ProxyAddHeaders Off ProxyPass /.well-known ! ProxyPassMatch (.*)(\/websocket)$ "ws://127.0.0.1:8006/$1$2" ProxyPass / http://127.0.0.1:8006/ ProxyPassReverse / http://127.0.0.1:8006/
Apache will get all requests using HTTPS and forwards them locally using HTTP to the Docker container.
Also keep in mind that the following Apache modules have to be activated:
- proxy
- proxy_http
- proxy_wstunnel
- headers
- setenvif
In this configuration OnlyOffice works reliable for me.
Also see https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/minimal.conf.
The bug that had caused OnlyOffice not to work correct in the last few weeks was an additional entry ProxyTimeout 10
, which I added a long time ago to solve another problem. However, this is exactly what led to unintentional interruption of connections that were still needed. I just did not realize this earlier as I believed that the error messages in the spreadsheet editor are caused by incompatibilities with the browsers – this occurred more frequently with Firefox than with Chromium-based browsers.
“Community Document Server” by Nextcloud
Nextcloud itself offers a variant of the Document Server at https://apps.nextcloud.com/apps/documentserver_community, which is installed as a Nextcloud app and does not require Docker. I’ve never used this variant myself, but based on what I’ve learned about it so far, I wouldn’t recommend using it – just use the Docker version or your own server.
I have not yet looked at how the technical solution looks in detail, but the ratings of the current version 0.1.7 are pretty poor. Both on the app page and in Github there are numerous indications that storing data does not work reliable (also see Github #170, Github #121, Github #100, Github #12).
Why did Nextcloud develop this version when it is obviously causing so many problems?
The story was that Nextcloud and OnlyOffice had announced a closer collaboration already in October 2018. As a result, OnlyOffice was developed further to become the preferred office solution for Nextcloud, with support from the Nextcloud team.
At the beginning of 2020, OnlyOffice decided to no longer allow the editing of documents in mobile browsers in the free community version, which was not officially announced anywhere, but rather indirectly through a discussion in Github, which I had also reported on. The only way to be able to edit files on mobile devices was to buy a commercial license for 950 EUR (and that every year, if you also want updates), but this was not affordable for private users and institutions with a low budget.
The Nextcloud community did not welcome this step particularly positively and feared that further restrictions are to be expected in the future. As a result of the discussion, OnlyOffice introduced a cheaper version of the “Integration Edition”, where you can get a license for 10 simultaneous users for 90 EUR. The license is valid indefinitely, but you have to renew it every year for updates.
However, the Document Server is also open source and you can create your own version from the sources. This has led to the fact that Nextcloud has finally created a variant that can also run without Docker in order to provide “Nextcloud Hub” as a complete package including Office which can be installed very easily.
Mobile editing for Android
The problem of mobile editing has also been alleviated. The free version of OnlyOffice for Android also supports the editing of files that are opened in the Nextcloud client for a while now. It is also possible to use Nextcloud directly within the OnlyOffice app. The only restriction is that this is not done collaboratively, but the file is downloaded, edited locally and then uploaded again.
WARNING: Currently the Android-Version 4.1.0 has a problem with saving some files! Files can not be opened again after saving them! I already reported this issue along with sample files to Ascensio.
Update 2020-09-29
The problems with the Android app only occur with two test files where it is not clear what exactly happens here. With other files this error can not be reproduced. I therefore assume that this is not a general problem but an individual case which only happens with those damaged files.
Conclusion
OnlyOffice in Nextcloud is still a very good alternative to Office 365 or Google Docs and I can still recommend it. However, you should definitely use the official version for the Document Server and in case of problems check carefully that the configuration of the server is correct.
Hi,
I tried to follow your instruction, but if I put the Proxy part into my virtual host, all traffic of the nextcloud is redirected to the docker container.
The onlyoffice is reachable, but the nextcloud no longer.
Can you give me a small hint, which part of the virtual host section does redirect only the office related stuff?
Thx,
Christoph
Using OnlyOffice on the same domain with Nextcloud is not possible.
You need a separate subdomain (and thus also a separate virtual host for it which is not used for Nextcloud) – for example: nextcloud.example.com for Nextcloud and office.example.com for OnlyOffice.
Hi Arno,
thanks for that hint. I did that and it works partly (I can reach the only office welcome page), but I think I have a problem with the certificate. I do have a wildcard cert and want to use it for both subdomains.
Inside the docker I switched the cert verification off and now it works.
I tried to mount a host folder with the certs, but that did not work.
Can I inject the cert into the docker and is it update safe?
Regards,
Christoph
You don’t need to use any certificate inside Docker. Just use Apache as a proxy for the Docker container and use the certificate in Apache.
Apache will do HTTPS for public access and use HTTP to talk to the Docker container.
Hello,
I’m super interested in your successful installation as I never managed to make it work with docket on an Apache server. Could you please share your full Apache configuration file to see if it would work for me?
Thanks in advance!
The section I posted here is the full configuration.
The remaining parts are just the regular virtual host setup similar to the examples on https://httpd.apache.org/docs/2.4/vhosts/examples.html.
Hello Arno,
Following your advice, I was successful in installing it, thank you so much! I did a full article to explain the installation so that it’s useful for others. I mentioned your page at the end.
I’d be happy to receive your feedback on it: https://github.com/biva/documentation/blob/biva/admin_manual/configuration_server/onlyoffice_configuration.rst
Thanks!
Thanks for this helpful article.
Just one thing: adding the subdomain of OnlyOffice to
trusted_domains
in Nextcloud is not needed. Alsoallow_local_remote_servers
is not needed for OnlyOffice.Hi Arno,
thanks for clarifying that.
I think you have a typo: “I have not yet looked at how the technical solution looks in detail, but the ratings of the current version 0.1.7 are pretty poor. Both on the app page and in Github there are numerous indications that storing data
==> does work reliable <==". Shouldn't that be "does not work reliable" ?
Bernd
Of course you are right! I just fixed this. Sorry for the delay.
Hello Arno,
i came here from https://github.com/nextcloud/documentserver_community/issues/100#issuecomment-703323537. I’m using NC20 with OO. My OO runs on a dedicated server (virtual),
downloaded and installed from a deb package from the OO website.
What do you mean by “the official version for the Document Server” ?
Is that what i’m using “official” ?
Bernd
Just read my article:
In addition to my other reply: any version which is provided by OO itself is of course also “official”. I just tried to emphasize that there is a difference between the “Community Document Server” provided by the Nextcloud team and the versions provided by Ascensio, the creator of OnlyOffice.