LibrOffice? How install?


I’m running CE version and I want to edit office documents, but how do I do that from the WebGUI?
If I understand it correctly I need a second server (or service) so I can edit it trough that?
Is that correct?


LibreOffice works pretty same like OfficeOnly setup. You have second server (or docker container) running and seafile using this server to open it. But I failed with setup libreoffice with seafile so don’t know exactly how to configure it right.


Ok, but you did get it to work with OfficeOnly?


You can run both (LibreOffice and OnlyOffice docker containers) on same server. Don’t know what seahub will do, but by what the manual saying you can setup Seahub which file type should open by LO or OO.

So you should be able to setup open MS Office documents by OO and OpenDocument files by LO.

ONLYOFFICE_APIJS_URL = 'http{s}://{your OnlyOffice server domain or IP}/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

OFFICE_SERVER_TYPE = 'CollaboraOffice'
OFFICE_WEB_APP_BASE_URL = 'https://{your LibreOffice server domain}/hosting/discovery' # LibreOffice needs valid SSL\TSL certification, there is no workaround
OFFICE_WEB_APP_FILE_EXTENSION = ('odp', 'ods', 'odt')
OFFICE_WEB_APP_EDIT_FILE_EXTENSION = ('odp', 'ods', 'odt')


I run Seafile CE 6.2.3 on Ubuntu 16.04 and a completely separate OnlyOffice CE server on Docker also under Ubuntu 16.04. I have no issues with either server (knock on wood) and can access files in OnlyOffice via WebDAV to Seafile. In other words OnlyOffice picks Seafile up as a cloud storage device (as expected).

I cannot access/open office format files on Seafile using OnlyOffice, however. When I attempt to open/preview a file it opens to a white page. Previously (in the default setup) it offered to download the file.

I’m wondering if the ONLYOFFICE_APIJS_URL string is correct as shown in the Seafile Manual or even if it applies to the OnlyOffice CE server.

Any ideas?


Check the file permission of the nginx temp/cache folder on Seafile server.


Is it possible to run it just localy or does it need to be outside the LAN?
I’m wondering because maybe (long shot) that I don’t need to open up for one more machine to the internet.


If you want to access it via Internet, the onlyoffice server has to be available outside the LAN.


Can you direct me to where the cache directory is located? It is not my impression that Nginx caches by default and I have not enabled it in the configuration. My Nginx configuration pretty much follows the garden-variety https setup found in the manual and various posts on this forum.

Is there another cache directory that Seafile keeps specifically for the collaborative documents like OnlyOffice and LibreOffice?

-Thanks very much


$ chown nginx:nginx /var/cache/nginx/ -R
$ chown www-data:www-data /var/cache/nginx/ -R


My instance of Nginx runs as www-data. I see no nginx cache directory in /var:

chown: cannot access ‘/var/cache/nginx/’: No such file or directory

$sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

nginx version: nginx/1.10.3 (Ubuntu)


Please post your nginx config (as codeblock) and the part that is meant for OnlyOffice.
Do you use a signed certificate for OnlyOffice/Seafile?


If I want to have it on the same server I guess that I need to have some kind of nginx stand alone that will send the office req to the right VM and then the seafile req to the seafile vm.
Is that correct?

    server {
    listen       80;
    rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
server {
    listen 443 ssl http2;
    ssl_certificate /etc/ssl/cert_chain.crt;
    ssl_certificate_key /etc/ssl/sfmydomain.key;

    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:5m;

    # Diffie-Hellman parameters
    ssl_dhparam /etc/nginx/ssl/dhparam.pem;


    ssl_prefer_server_ciphers on;

    proxy_set_header X-Forwarded-For $remote_addr;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Frame-Options "DENY" always;
    add_header Referrer-Policy "strict-origin" always;
    add_header Content-Security-Policy "default-src 'none'; script-src blob: '$
    server_tokens off;

 location / {
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
    proxy_read_timeout  1200s;
    proxy_request_buffering off;
    proxy_http_version 1.1;

    # used for view/edit office file via Office Online Server
    client_max_body_size 0;

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

location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    client_max_body_size 0;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    proxy_request_buffering off;
    proxy_http_version 1.1;

    send_timeout  36000s;
location /seafdav {
    fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
    fastcgi_param   PATH_INFO           $fastcgi_script_name;

    fastcgi_param   SERVER_PROTOCOL     $server_protocol;
    fastcgi_param   QUERY_STRING        $query_string;
    fastcgi_param   REQUEST_METHOD      $request_method;
    fastcgi_param   CONTENT_TYPE        $content_type;
    fastcgi_param   CONTENT_LENGTH      $content_length;
    fastcgi_param   SERVER_ADDR         $server_addr;
    fastcgi_param   SERVER_PORT         $server_port;
    fastcgi_param   SERVER_NAME         $server_name;

    fastcgi_param   HTTPS               on;

    client_max_body_size 0;
    proxy_request_buffering off;

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

location /media {
    root /home/seafuser/my-seafile/seafile-server-latest/seahub;

#15 (last block in the file):

# Enable OnlyOffice
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

Signed certificates are used on both servers. The value of VERIFY_ONLYOFFICE_CERTIFICATE has been tried in both states without effect.