How to Integrate OnlyOffice with NextCloud on Ubuntu

As you may probably know, Nextcloud is a self-hosted cloud storage solution and OnlyOffice is a self-hosted online office document server. This tutorial will be showing you how to integrate OnlyOffice with Nextcloud, so you will be able to edit office documents (DOCX, XLSX, PPTX, etc.) right from the NextCloud web interface.

Feature of the Nextcloud OnlyOffice Integration App

  • Full-featured text editor available online with all the functionality of desktop editors.
  • 100% view, conversion, print and pagination fidelity.
  • It allows you to add links, tables, charts, insert images, auto shapes, formulas, text objects and manipulate them, create bulleted or numbered lists.
  • Real-time collaborative editing with your teammates: show changes instantly or after saving only. Use commenting and built-in chat to review and track changes.
  • Supports DOCX, XLSX, PPTX, TXT file editing and saving. You can also save the file in other formats like ODT, ODS, ODP, DOC, XLS, PPT, PPS, EPUB, RTF, HTML, HTM.
  • Fully compatible with Office Open XML formats: .docx, .xlsx, .pptx
  • Auto save your files, so you won’t lose your work.
  • Supports Latin, CJK (Chinese, Japanese, Korean) characters.

Prerequisites

OnlyOffice document server requires at least a 2 core CPU and 2GB RAM. To make it run smoothly with Nextcloud, I recommend using a server with a 4 core CPU and 4GB RAM. You can buy a powerful VPS from Contabo with very little cost. If there’re many users, you should consider upgrading the server specs.

Contabo has data centers in Germany only. If you need a VPS hosted in the US, I recommend Turnkey Internet, which offers a 4 core CPU, 8GB RAM VPS for 9.99 USD/month.

To complete this guide, you need to have a working Nextcloud server. If you haven’t already done so, please read the following article to set up Nextcloud server first.

Then read the following instructions to integrate OnlyOffice and Nextcloud. The OnlyOffice document server and Nextcloud server can be installed on two different hosts Let’s get started.

Step 1: Install ONLYOFFICE Document Server on Ubuntu

OnlyOffice document server depends on PostgreSQL, Node.js, Redis Server, RabbitMQ server and Nginx. The following steps are tested on a Ubuntu 18.04 server but should also be applicable to Linux distributions in the Debian family.

Install PostgreSQL from Ubuntu repository

sudo apt install postgresql

Then create the onlyoffice database.

sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"

Create the onlyoffice user.

sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"

Grant permission.

sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"

Note: Both the username and password must be onlyoffice.

Install NodeJS from official repository

OnlyOffice document server requires nodejs version 8.12.0+, but the version in Ubuntu repository is outdated, so we will need to install the latest LTS version (12.13.1) of Node.js from upstream repository.

Add Node.js repostiory.

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

Install Node.js.

sudo apt install nodejs -y

Check Node.js version.

node -v

Sample output:

v12.13.1

Install Redis server and Rabbitmq

sudo apt install redis-server rabbitmq-server

Check their status.

systemctl status redis-server

systemctl status rabbitmq-server

You should see they are active (running).  If rabbitmq-server failed to start, that’s mostly because of low memory on the machine or invalid hostname. Redis server listens on 127.0.0.1:6379. RabbitMQ listens on 0.0.0.0:25672 and 0.0.0.0:4369

Install OnlyOffice document server

Add OnlyOffice repository with the following command.

echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list

Import OnlyOffice public key.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

Update local package index and install OnlyOffice document server. Note that the onlyoffice-documentserver package will install nginx-extras as a dependency, so if an Apache web server is running, you need to stop it first.

sudo apt update

sudo apt install onlyoffice-documentserver

During the installation process, you will be asked to enter PostgreSQL password for onlyoffice. Enter “onlyoffice” (without double quotes).

onlyoffice document server install

You also need to accept the Microsoft license terms in order to install TrueType core fonts from Microsoft.

install onlyoffice document server on ubuntu 16.04

A Nginx server block will be installed as /etc/nginx/conf.d/ds.conf. (It’s actually a symbolic link to /etc/onlyoffice/documentserver/nginx/ds.conf.) The OnlyOffice document server is a nodejs web application and Nginx acts as the reverse proxy.  /var/www/onlyoffice/documentserver/ is the web root directory.

Once the installation is finished, enter your server’s public IP address in web browser, you should see “Document Server is running”

onlyoffice document server

To check the version number of document server, you can use the following command.

apt search onlyoffice-documentserver

Sample output.

onlyoffice-documentserver/squeeze,now 5.4.1-39 amd64 [installed]
  online viewers and editors for text, spreadsheet and presentation files.

Step 2: Enabling HTTPS for the Document Server

To connect NextCloud to OnlyOffice document server, the latter must be running in HTTPS mode (Both the Nextcloud server and user browsers will need to make contact with document server). The following steps show how to obtain and install Let’s Encrypt TLS certificate.

First, we need to edit the OnlyOffice Nginx server block file.

sudo nano /etc/nginx/conf.d/ds.conf

We add a server_name directive like below. Don’t forget to set DNS A record for onlyoffice.your-domain.com.

include /etc/nginx/includes/http-common.conf;
server {
  listen 0.0.0.0:80;
  listen [::]:80 default_server;
  server_tokens off;
  server_name onlyoffice.your-domain.com;

  include /etc/nginx/includes/ds-*.conf;
}

Save and close the file. Reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Then install certbot (Let’s Encrypt) client and the Nginx plugin.

sudo apt install certbot python3-certbot-nginx

Next, run the following command to obtain a free TLS certificate using the Nginx plugin.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d onlyoffice.your-domain.com

Where:

  • --nginx: Use the nginx plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

Within a few seconds, you shall see a message like below, which means the TLS certificate is successfully obtained.

onlyoffice document server https

Visit https://onlyoffice.your-domain.com in web browser to verify OnlyOffice document server is running correctly in HTTPS mode.

onlyoffice nextcloud

Step 3: Install Nextcloud OnlyOffice Integration App

Log into Nextcloud web interface as an admin, then go to Nextcloud Apps page, click the Office & Text tab on the left pane. You will find the OnlyOffice app. Download and enable it.

onlyoffice connector for nextcloud

 

After that, go to Nextcloud Settings page, select ONLYOFFICE tab on the left pane and enter the domain name for OnlyOffice in Document Editing Service Address field.

onlyoffice connector app for nextcloud

After saving the above setting, you should be able to create documents, spreedsheets and presentation files within Nextcloud by clicking the plus (+) button. A separate tab will be opened for editing.

nextcloud onlyoffice

You will also see a new item called “Open in OnlyOffice” in the context menu of office documents.

Installing OnlyOffice Document Server and Nextcloud on the Same Host

The OnlyOffice Document server uses Nginx as web server.

If you have an existing Nextcloud server running with Nginx, then there’s no damage to your Nextcloud server when installing OnlyOffice on the same machine. It will remove nginx-core and install nginx-extras package, so there’ll be a little downtime, but your configurations will be intact.

If you have an existing Nextcloud server running with Apache web server, and you want to install OnlyOffice on the same machine, then you have two choices:

  1. Stop/remove Apache, use Nginx as the web server for both Nextcloud and OnlyOffice. You can use the Nextcloud Nginx config in this tutorial.
  2. Configure Nginx as a reverse proxy for Apache.

Configuring Nginx as a Reverse Proxy for Apache

If you choose the second route, then you should first change the port number of Apache before you install OnlyOffice document server.

Edit the ports.conf file.

sudo nano /etc/apache2/ports.conf

Find the line:

Listen 80

Change it to a different port number like 8180. Note that you shouldn’t use 8080 here because OnlyOffice document server needs port 8080 to start its docservice.

Listen 8180

You should also change the SSL port number because later Nginx will do the SSL termination. Find the line:

Listen 443

Change the port number to something like 4433.

Listen 4433

Save and close the file. Next, edit the virtual host file for Nextcloud.

sudo nano /etc/apache2/sites-enabled/nextcloud.conf

The first line should be like this:

<VirtualHost *:80>

Change the port number to 8180.

<VirtualHost *:8180>

We should also disable redirecting HTTP to HTTPS by adding comment characters before the following lines. (Your Nextcloud server is using HTTPS connection, right?)

#RewriteEngine on
#RewriteCond %{SERVER_NAME} =nextcloud.your-domain.com
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

And change the SSL listening port.

<VirtualHost *:443>

Change the above port to 4433. Save and close the file. Reload Apache configuration.

sudo systemctl reload apache2

Now Apache listens on port 8180 and 4433. We can then follow the above instructions to install OnlyOffice document server, which will install Nginx in the process.

Once OnlyOffice document server and Nginx are installed, create an Nginx server block file to proxy requests to Apache.

sudo nano /etc/nginx/conf.d/nextcloud-proxy.conf

Add the following lines to the file. Replace the domain name with your own. The path for ssl_certificate and ssl_certificate_key is for Let’s Encrypt issued certificates. If you use a certificate issued by another CA, then you should enter your own path.

server {
        listen 80;
        server_name nextcloud.your-domain.com;
        return 301 https://$server_name$request_uri;
}

server {
        listen 443 ssl http2;
        server_name nextcloud.your-domain.com;

        ssl_certificate /etc/letsencrypt/live/nextcloud.your-domain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/nextcloud.your-domain.com/privkey.pem;

        ssl_session_timeout 1d;
        ssl_session_cache shared:SSL:10m;
        ssl_session_tickets off;
        ssl_protocols TLSv1.1 TLSv1.2;

        add_header Strict-Transport-Security max-age=15768000;

        ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
        ssl_prefer_server_ciphers on;

        location / {
                proxy_pass http://127.0.0.1:8180;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}

The location / {...} section redirects all requests to Apache web server listening on port 8180. Save and close the file. Then test Nginx configuration.

sudo nginx -t

Reload Nginx if syntax is OK.

sudo systemctl reload nginx

Now you should be able to visit your Nextcloud server as usual, without adding a port number in the URL. If you use the following cURL command to fetch HTTP header, then you should see the front-end server is Nginx.

curl -I https://nextcloud.your-domain.com

Sample output:

HTTP/1.1 302 Found
Server: nginx/1.11.9
Date: Tue, 14 Mar 2017 08:55:30 GMT
Content-Type: text/html; charset=UTF-8

Reducing DNS and HTTPS Overhead

If Nextcloud and OnlyOffice are installed on the same host, then Nextcloud and OnlyOffice can talk to each other locally, without having to query public DNS name and establish HTTPS connection.

First, you need to create Nginx server block that listen on the local host for Nextcloud and OnlyOffice. For OnlyOffice, you can edit the /etc/nginx/conf.d/ds.conf file

sudo nano /etc/nginx/conf.d/ds.conf

And add the following server block. Note that this server block listen on 127.0.0.1:80 and uses onlyoffice-document-server as the server_name.

#HTTP host for internal services
server {
  listen 127.0.0.1:80;
  listen [::1]:80;
  server_name onlyoffice-document-server;
  server_tokens off;

  include /etc/nginx/includes/ds-*.conf;
}

Save and close the file. Then you can edit the Nextcloud Nginx configuration file.

sudo nano /etc/nginx/conf.d/nextcloud.conf

And add the following server block. It also listens on 127.0.0.1:80 and uses nextcloud as the server_name.

server {
    listen 127.0.0.1:80;
    server_name nextcloud;

    # Add headers to serve security related headers
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;
    add_header Referrer-Policy no-referrer;

    #I found this header is needed on Ubuntu, but not on Arch Linux. 
    add_header X-Frame-Options "SAMEORIGIN";

    # Path to the root of your installation
    root /usr/share/nginx/nextcloud/;

    access_log /var/log/nginx/nextcloud.access;
    error_log /var/log/nginx/nextcloud.error;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
    # last;

    location = /.well-known/carddav {
        return 301 $scheme://$host/remote.php/dav;
    }
    location = /.well-known/caldav {
       return 301 $scheme://$host/remote.php/dav;
    }

    location ~ /.well-known/acme-challenge {
      allow all;
    }

    # set max upload size
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;

    # Disable gzip to avoid the removal of the ETag header
    gzip off;

    # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;

    location / {
       rewrite ^ /index.php$uri;
    }

    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
       deny all;
    }
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
       deny all;
     }

    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
       include fastcgi_params;
       fastcgi_split_path_info ^(.+\.php)(/.*)$;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_param PATH_INFO $fastcgi_path_info;
       #Avoid sending the security headers twice
       fastcgi_param modHeadersAvailable true;
       fastcgi_param front_controller_active true;
       fastcgi_pass unix:/run/php/php7.2-fpm.sock;
       fastcgi_intercept_errors on;
       fastcgi_request_buffering off;
    }

    location ~ ^/(?:updater|ocs-provider)(?:$|/) {
       try_files $uri/ =404;
       index index.php;
    }

    # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~* \.(?:css|js)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        add_header Referrer-Policy no-referrer;
        # Optional: Don't log access to assets
        access_log off;
   }

   location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log off;
   }
}

Save and close the file. Test Nginx configuration, then reload Nginx for the changes to take effect.

sudo nginx -t

sudo systemctl reload nginx

Next, we need to add a local DNS record in the /etc/hosts file like below, so the server can find the address for onlyoffice-document-server and nextcloud.

127.0.0.1 localhost onlyoffice-document-server nextcloud

Save and close the file.

We also need to edit the Nextcloud config.php file.

sudo nano /usr/share/nginx/nextcloud/config/config.php

Add nextcloud in the trusted domain list like below.

  'trusted_domains' =>
  array (
    0 => 'nextcloud.linuxbabe.com',
    1 => 'nextcloud',
  ),

Save and close the file.

Now go back to the Nextcloud web interface settings pages, click the advanced server settings, enter the internal address for OnlyOffice document server and Nextcloud.

  • http://onlyoffice-document-server/
  • http://nextcloud/

 nextcloud internal requests

Click the Save button and you are done.

How to Upgrade OnlyOffice Document Server

When a new version of OnlyOffice document server comes out, you simply use the apt package manager to upgrade to the new version.

sudo apt update;sudo apt upgrade

Note that the new version will override your customizations in the /etc/nginx/conf.d/ds.conf file. I recommend backing up this file with the following command, so you will be able to easily restore your custom configurations.

cat /etc/nginx/conf.d/ds.conf | sudo tee /etc/nginx/conf.d/ds.conf.backup

Wrapping Up

I hope this tutorial helped you with integrating OnlyOffice with Nextcloud. As always, if you found this post useful, then subscribe to our free newsletter. You can also follow us on Google+Twitter or like our Facebook page.

Rate this tutorial
[Total: 18 Average: 4.1]

35 Responses to “How to Integrate OnlyOffice with NextCloud on Ubuntu

  • Berndhard Schmitz
    5 months ago

    I got this error while installing onlyoffice-documentserver:

    All done, no errors.
    All fonts downloaded and installed.
    Traceback (most recent call last):
    File “/usr/lib/update-notifier/package-data-downloader”, line 278, in process_download_requests
    os.remove(f)
    FileNotFoundError: [Errno 2] No such file or directory: ‘/var/lib/update-notifier/package-data-downloads/partial/arial32.exe’
    Setting up ttf-mscorefonts-installer (3.4ubuntu3) …
    Setting up gconf-service-backend (3.2.6-3ubuntu6) …
    Processing triggers for libc-bin (2.23-0ubuntu9) …
    Processing triggers for systemd (229-4ubuntu20) …
    Errors were encountered while processing:
    nginx-extras
    onlyoffice-documentserver
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    How can I fix it?
    Thank you.

    • you should enable contrib and non-free comps for the debian repositories in /etc/apt/sources.list

  • Hi,

    Does somebody have an idea how to change the GUI language? In the “normal” installation of OnlyOffice there is a settings page at https://onlyoffice.domain.tld but with this integrated server there isn’t – or I can’t find it.
    What can I do to change the GUI to German language?

    Thanks and best regards

  • For future readers: the Onlyoffice install appears to require the npm package as well (at least I couldn’t get it to work until I installed npm), and some Ubuntu installations may not have it. Without npm the document server install failed for me, and it wasn’t at all obvious why.

    To fix this, just issue the command:

    sudo apt install npm

    before the “Install OnlyOffice document server” step.

    Other than this one thing, these instructions worked for me precisely.

  • $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

    affter that line I get below error

    Executing: /tmp/apt-key-gpghome.pkK8eBiyYd/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
    gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
    gpg: connecting dirmngr at '/tmp/apt-key-gpghome.pkK8eBiyYd/S.dirmngr' failed: No such file or directory
    gpg: keyserver receive failed: No dirmngr

    I am debian 9.5
    how to fix the error
    thanks

    • Xiao Guo-An (Admin)
      4 weeks ago

      You need to install dirmngr.

      sudo apt install dirmngr
  • thanks Xiao for above helps
    but I need more help
    please tack look thise errors:

    :/$ sudo apt install onlyoffice-documentserver
    ..........................................
    .......................................................
    Setting up nginx-extras (1.10.3-1+deb9u1) ...
    Job for nginx.service failed because the control process exited with error code.
    See "systemctl status nginx.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript nginx, action "start" failed.
    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2018-10-10 17:07:37 CEST; 9ms ago
         Docs: man:nginx(8)
      Process: 28831 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
      Process: 28826 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    
    Oct 10 17:07:36 tbnext nginx[28831]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
    Oct 10 17:07:36 tbnext nginx[28831]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
    Oct 10 17:07:36 tbnext nginx[28831]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
    Oct 10 17:07:37 tbnext nginx[28831]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
    Oct 10 17:07:37 tbnext nginx[28831]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
    Oct 10 17:07:37 tbnext nginx[28831]: nginx: [emerg] still could not bind()
    Oct 10 17:07:37 tbnext systemd[1]: nginx.service: Control process exited, code=exited status=1
    Oct 10 17:07:37 tbnext systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    Oct 10 17:07:37 tbnext systemd[1]: nginx.service: Unit entered failed state.
    Oct 10 17:07:37 tbnext systemd[1]: nginx.service: Failed with result 'exit-code'.
    dpkg: error processing package nginx-extras (--configure):
     subprocess installed post-installation script returned error exit status 1
    Setting up libboost-regex1.62-dev:amd64 (1.62.0+dfsg-4) ...
    dpkg: dependency problems prevent configuration of onlyoffice-documentserver:
     onlyoffice-documentserver depends on nginx-extras (>= 1.3.13); however:
      Package nginx-extras is not configured yet.
    
    dpkg: error processing package onlyoffice-documentserver (--configure):
     dependency problems - leaving unconfigured
    Setting up libboost-regex-dev:amd64 (1.62.0.1) ...
    Processing triggers for libc-bin (2.24-11+deb9u3) ...
    Errors were encountered while processing:
     nginx-extras
     onlyoffice-documentserver
    W: http://ftp.uk.debian.org/debian/pool/main/g/gconf/gconf-service_3.2.6-4+b1_amd64.deb: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    

    Thanks
    Br

    • Xiao Guo-An (Admin)
      3 weeks ago

      There’s another process using port 80 on your server (Maybe Apache?) You need to stop it or configure it to use another port so that Nginx can bind to port 80. Then reinstall onlyoffice-documentserver.

  • Hi Xiao Guo-An
    finally I installed onlyoffice documentserver
    but it is not support RTL for right to left languages as Arabic.
    can you please guide me how to solve this problem?

    thanks
    Br
    Moj

  • Mark Ellis
    5 years ago

    I currently have a Nextcloud Hosting instance through Hetzner Online (a German company); being a Microsoft Office 365 user, my comfort level is highest with that which has the greatest compatibility with the MS O365 formats, which – in my estimation – is OnlyOffice. It’s my understanding from Hetzner Online that all they do is host Nextcloud for me. I have to configure the OnlyOffice component of the Nextcloud hosting instance to connect to the OnlyOffice Document Server.

    I have a Raspberry Pi 3 B+, as well as a 13-year-old Dell Dimension E521 (1.8GHz AMD Sempron 3400+ processor & 4GB RAM); I sometimes use the Dell at home for various tasks; however, the Pi is currently unused.

    Between the Dell and the Pi, what would be the best place for the installation of the OnlyOffice Document Server?

    As a follow-up question, since my ISP (COX Communications) assigns residential customers a dynamic IP address, I assume that I could use a Dynamic DNS Service (DDNS) such as no-ip.com (which is supported by the COX router I have in my house) to make the eventual OnlyOffice Document Server accessible outside of my house, right? IF SO, would it be better to put the Server on the Pi since it’s not used currently? I do have some – not much – personal/family things on the Dell that I wouldn’t want to place at risk by it being open to the Internet, but I’m afraid that the little (but good) Pi might be overwhelmed with the OnlyOffice Document Server.

    I envision the main documents being worked on would be those compatible with MS Word and MS Excel. Formatting would be consistent with that used by homes or small businesses, so nothing advanced – like macros, links to separate files, database connections, etc.

  • Eduardo
    5 years ago

    Hello i have a problem, i dont know how to setup, Ubuntu 18.04 with two virtual servers ( both in localhost):
    nextcloud.eduardo.com -> nextcloud as told in other tutorial works well
    onlyoffice.eduardo.com -> document server should show the running installation completed
    default server -> would go to wherever just to be polite

    1- Tweaked /etc/hosts:
    127.0.0.1 localhost
    127.0.0.1 nextcloud.eduardo.com
    127.0.0.1 onlyoffice.eduardo.com

    2 – Now seems nextcloud works great: nextcloud.eduardo.com redirects to http://nextcloud.eduardo.com/index.php/apps/files/?dir=/&fileid=6 and everything works…

    3 – Installed onlyoffice app, and worked i get to make a document of word…. setting up my office sever: onlyoffice.eduardo.com

    Im using all the time http as https seems too difficult to get it to work..

    Dont know what ive changed or anything… now onlyoffice can get to document server it says an error, and if i put onlyoffice.eduardo.com it goes to nextcloud….

    https://drive.google.com/drive/folders/1I2ZiRUKqmm8u5U5TsqyoOKUvfTwY-SPA?usp=sharing

    I have uploaded my nginx configuration:

    pd: also localhost goes to nextcloud but to initial login page…

    2 –

  • Matthew
    5 years ago

    Hi LinuxBabe,

    Great tutorial, I really appreciate the good information. It looks like there’s a typo towards the end of the tutorial in this statement:

    `Next, we need to add a local DNS record in the /etc/hosts file like below, so the server can find the address for onlyoffice-document-server and nextcloud.`

    127.0.0.1 localhost onlyoffce-document-server nextcloud

    Should read:
    127.0.0.1 localhost onlyoffice-document-server nextcloud

    • Xiao Guoan (Admin)
      5 years ago

      Thanks for pointing it out. The typo is now corrected.

  • Ngoc Tang
    5 years ago

    Hi Xiao Guoan
    Can you type this post Integrate OnlyOffice with NextCloud on CentOS 8 ?
    Thanks so much

  • Ngoc Tang
    5 years ago

    Hi Xiao
    I’am install Onlyoffice and nextCloud on 2 different server
    When i connect from nextCloud Server to Document Server to be fault “Error when trying to connect (Error occurred in the document service: Invalid token) “.
    Both servers are used LetsEncrypt SSL

    I health check Document Server by link “https://localhost/healthcheck” it’s return result is “true”

    Below the log of Document Server :

    tail -f /var/log/onlyoffice/documentserver/docservice/out.log
    [2020-01-07T15:17:19.783] [WARN] nodeJS – Plugins watch exception (https://nodejs.org/docs/latest/api/fs.html#fs_availability).
    [2020-01-07T15:17:19.819] [WARN] nodeJS – update cluster with 1 workers
    [2020-01-07T15:17:19.831] [WARN] nodeJS – worker 1365 started.
    [2020-01-07T15:17:19.832] [WARN] nodeJS – update cluster with 1 workers
    [2020-01-07T15:17:20.574] [WARN] nodeJS – Express server starting…
    [2020-01-07T15:17:21.902] [ERROR] nodeJS – [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
    [2020-01-07T15:17:22.905] [ERROR] nodeJS – [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
    [2020-01-07T15:17:24.070] [WARN] nodeJS – Express server listening on port 8000 in production-linux mode

    I’am check RabbitMQ and its still running
    You have any suggestion for me ?
    Thanks so much

  • NodeJS 12 is not supported by OnlyOffice. It has to use NodeJS 8 instead. The spellchecker will not start correctly and keeps looping in trying to restart leading to high CPU usage.

    • Just sharing how I installed NodeJS 8. To prevent installing the version from the Linux distro, it has to use the downgrade option by apt. By the time of my installation, the version was 8.17.0:

      curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash –
      sudo apt-get install -y –allow-downgrades nodejs=8.17.0-1nodesource1
      nodejs -v

  • Alexander
    5 years ago

    Hi,

    Is there a limitation (number of users or similar) for this Onlyoffice version?

  • Hi.

    As of NextCloud v18, ONLYOFFICE is built-in. All you have to do is go to “Apps” and
    – search/download/install/enable “Community Document Server”
    – search/download/install/enable “ONLYOFFICE”

    that’s it….

  • i managed to have a successful Nexcloud/onlyoffice instance but my question is does onlyoffice have an administration panel? and what its url?
    tks,

    • Xiao Guoan (Admin)
      5 years ago

      No. There’s no admin panel for the onlyoffice document server.

  • Hi,

    it looks like you create separate subdomain for onlyoffice. What to do if I have my nextcloud instance already in cloud.mysite.com and I have only one public IP?

    • Xiao Guoan (Admin)
      5 years ago

      Create A record for the second subdomain to point it to the same IP address.

  • Hi!

    Thanks for this manual. I have a troubles. My Nextcloud server and Onlyoffice are on the same server (ESXi), but on the different VMs inside with different local ip and the same public ip. The Nextcloud server works on 443 and 80 ports.

    Can I change ports of Onlyoffice Server?

  • I solved problem.

    I Changed ports in /etc/nginx/conf.d/ds.conf, /etc/nginx/sites-avaiable/default from 443, 80 to 5443, 8080. Add ports to iptables. Reboot server

    In Nextcloud in “onlyoffice connector” set https://mydns.nextcloud.ex:5443
    Works fine!

  • freegate
    5 years ago
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

    After that line I get below error :

    Executing: /tmp/apt-key-gpghome.39Mvp8DpGg/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
    gpg: keyserver receive failed: No keyserver available

    That’s normal with ubuntu 18.04 LTS ?

  • ONLYOFFICE cannot be reached. Please contact admin 你好我在谷歌 ie浏览器上编辑doc xlsx文件 出现这个错误 360浏览器正常 请问这个是哪里的原因 onlyoffice服务器正常 nextcloud服务器正常

  • Luis Carlos Luna
    4 years ago

    awesome guide really helped me a lot thanks. i ahve a question i cant open office files with more than 40 Mb it says something about a file size limit is there a way to change those values so i can open heavy files

  • peacecop kalmer:
    4 years ago

    Do you have a solution for how to install Nextcloud and ONLYOFFICE on the same host so that both use “mariadb”? If I use the official “Ubuntu” installation package, it requires to remove “mariadb” and install “mysql” instead. I don’t want to use “mysql” as it’s a proprietary software now. And I need “mariadb” for lots of other web applications on the same host. I use “nginx” as reverse proxy for “apache2”. So far, I managed to run ONLYOFFICE inside “docker” but probably I lack too much of “docker” knowledge as every time the server (host) machine restarts for instance because of the power failure in the building ONLYOFFICE stops working. Last time I saw that the container wasn’t running so I started it. This time, it is running but not working. I have forwarded “docker”-s port 443 to the host’s port 5. However if I call host’s port 5, it times out or gives “502”. The “nginx” error log shows:
    “2020/07/28 01:36:12 [error] 26640#26640: *694 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: “GET /welcome/ HTTP/1.1”, upstream: “http://127.0.0.1:8000/welcome/”, host: “onlyoffice.tennis24.ee”
    2020/07/28 01:36:12 [error] 26640#26640: *694 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://127.0.0.1:8000/favicon.ico”, host: “onlyoffice.tennis24.ee”, referrer: “https://onlyoffice.tennis24.ee/welcome/”
    2020/07/28 01:36:13 [error] 26640#26640: *694 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: “GET /welcome/ HTTP/1.1”, upstream: “http://127.0.0.1:8000/welcome/”, host: “onlyoffice.tennis24.ee”
    2020/07/28 01:36:13 [error] 26640#26640: *694 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://127.0.0.1:8000/favicon.ico”, host: “onlyoffice.tennis24.ee”, referrer: “https://onlyoffice.tennis24.ee/welcome/””

  • Hello,

    I am not able to connect onlyoffice with my nextcloud server .After putting my onlyoffice server address(https://onlyoffice.my-server.com) and secret key and when I click on save after waiting for 60 seconds, it throws an error “Error when trying to connect cURL error 28 connection timed out after 6000 milliseconds.
    I tried using the demo onlyoffice document server but I get different error. Error when trying to connect (error occurred in the document service:Invalid token)

  • Hi,

    I went through and did your LEMP config, Nextcloud Config and both worked great. I tried this one and i have errors. Any chance you can help. It seems i cant do the SSL because of Nextcloud already running an ssl cert

    • Job for nginx.service failed because the control process exited with error code.
      See “systemctl status nginx.service” and “journalctl -xe” for details.

      That is my error.

  • Can i install openoffice without SSL?

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here