From NixOS Wiki
Jump to: navigation, search

Onlyoffice Documentserver is a full-featured backend for editing different office documents like Open Document, Word, Excel, etc. online in your browser. The software is open source and can be easily deployed and integrated into existing server software. Available frontends are Nextcloud or the Onlyoffice CommunityServer. It can be also used in own software, see following examples for PHP, Nodejs, etc.


A minimal example to get a Onlyoffice Documentserver running on localhost should look like this

services.onlyoffice = {
  enable = true;
  hostname = "localhost";


Change default listening port

In case port 80 is already used by a different application or you're using a different web server than Nginx, which is used by the Onlyoffice module, you can change the listening port with the following option:

services.nginx.virtualHosts."localhost".listen = [ { addr = ""; port = 8080; } ];

Caddy web server

Warning: Onlyoffice is very particular about it headers and if there are some missing or different than what upstream expects, a seemingly completely unrelated portion of the software like font rendering can break. The module maintainer can only fully support nginx as this is the only webserver upstream supplies config files for in their docker image

Instead of using the default Nginx web server, an configuration for Caddy might look like this

services.caddy = {
  virtualHosts = {
    "".extraConfig = ''
      reverse_proxy {
        # Required to circumvent bug of Onlyoffice loading mixed non-https content
        header_up X-Forwarded-Proto https

The reverse_proxy configuration directly forwards all requests to the Onlyoffice server, ignoring the default Nginx vhost.