Cannot get nextcloud => Collabora to work (docker)

Hi,

I have issues to get nextcloud => Collabora to work
I have this setup:

  1. I created the network nginx-proxy
  2. Installed the base - reverse proxy (nginx-proxy) and letsencrypt (docker-letsencrypt-nginx-proxy-companion) with docker-compose and the following

.

version: '2'
    services:
      proxy:
        image: jwilder/nginx-proxy
        container_name: proxy
        ports:
          - 80:80
          - 443:443
        volumes:
          - ./proxy/conf.d:/etc/nginx/conf.d
          - ./proxy/vhost.d:/etc/nginx/vhost.d
          - ./proxy/html:/usr/share/nginx/html
          - ./proxy/certs:/etc/nginx/certs:ro
          - /var/run/docker.sock:/tmp/docker.sock:ro
        networks:
          - proxy-tier
        restart: always

      letsencrypt-companion:
        image: alastaircoote/docker-letsencrypt-nginx-proxy-companion
        container_name: letsencrypt-companion
        volumes_from:
          - proxy
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - ./proxy/certs:/etc/nginx/certs:rw
        restart: always

    networks:
      proxy-tier:
        external:
          name: nginx-proxy

3.Installed nextcloud using a postgreSQL DB (already existing)
.

sudo docker run --restart=always -d \
	-v /data/disk1/nextcloud:/var/www/html \
	--link postgres:postgres \
	--net nginx-proxy \
	-e VIRTUAL_HOST=nextcloud.mydomain.com \
	-e VIRTUAL_NETWORK=nginx-proxy \
	-e VIRTUAL_PORT=80 \
	-e LETSENCRYPT_HOST=nextcloud.mydomain.com \
	-e LETSENCRYPT_EMAIL=joacim@mydomain.com \
	-e POSTGRES_DB=nextcloud \
	-e POSTGRES_USER=nextcloud \
	-e POSTGRES_PASSWORD=************ \
	-e POSTGRES_HOST=192.168.1.20 \
	-p 8080:80 \
	nextcloud

nextcloud works fine (some finetuning still needed)

  1. Then I install Collabora with

.

sudo docker run --restart=always -t -d \
	--name=collabora \
	--net nginx-proxy \
	--cap-add MKNOD \
	-e domain=nextcloud.mydomain.com \
	-p 9980:9980 \
	collabora/code
  1. Then I enable Collabora app in nextcloud and set the URL to https://nextcloud.mydomain.com:9980

When accessing an office dokument in nextclooud I get “Internal Server Error” but cannot see any valuable info in logs.
Do you have any hints on what could be wrong?

First you may wish to configure Nextcloud for logging if it isn’t already so. In config/config.php you can add lines such as:

‘loglevel’ => 2,
‘logfile’ => ‘/var/log/nginx/nextcloud/nextcloud.log’,

The file is in json format so it is not that easy to read. There is a notepad++ plugin I found useful. I was getting internal server error also due to:

cURL error 60: Peer’s certificate has an invalid signature.

My certificate was self-signed. I tried various means to get curl to recognize my root authority without luck. And I suspected that curl was incapable of using SAN certificates. I didn’t feel like mucking about any more and reconfigured my nginx virtual host for both http and https. But the plugin will complain when you use http. It would have been good if there was a configuration option for the colabora App to tell curl to ignore certificate errors.

I still don’t have it working but I hope this helps you get past this problem.

Thanks for your reply @jonw

I made another try where I had better luck earlier - using nextcloud-fpm instead of apache. The following steps was performed.

  1. Created docker network nginx-proxy
  2. Installed the base - reverse proxy (nginx-proxy) and letsencrypt (docker-letsencrypt-nginx-proxy-companion) with docker-compose and with the following content in docker-compose.yml

.

version: '2'
services:
  proxy:
    image: jwilder/nginx-proxy
    container_name: proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /data/disk1/nginx/proxy/conf.d:/etc/nginx/conf.d
      - /data/disk1/nginx/proxy/vhost.d:/etc/nginx/vhost.d
      - /data/disk1/nginx/proxy/html:/usr/share/nginx/html
      - /data/disk1/nginx/proxy/certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy-tier
    restart: always

  letsencrypt-companion:
    image: alastaircoote/docker-letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-companion
    volumes_from:
      - proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /data/disk1/nginx/proxy/certs:/etc/nginx/certs:rw
    restart: always

networks:
  proxy-tier:
    external:
      name: nginx-proxy
  1. Executed # sudo docker-compose up and let it settled (created all stuff)
  2. Created a nginx.conf file at /data/disk1/nginx-nextcloud/nginx.conf (in my setup) with the content taken from this https://github.com/nextcloud/docker/blob/master/.examples/nginx.conf
  3. Created another docker-compose.yml for nextcloud + collabora with the following content (note that the database was created before):

.

version: '2'
services:
  web:
    image: nginx
    container_name: nextcloud_webserver
    volumes:
      - /data/disk1/nginx-nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
      - collabora
    volumes_from:
      - app
    environment:
      - VIRTUAL_HOST=office.mydomain.com
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=office.mydomain.com
      - LETSENCRYPT_EMAIL=joacim@mydomain.com
    networks:
      - proxy-tier
    restart: always

  app:
    image: nextcloud:fpm
    container_name: nextcloud_fpm
    volumes:
      - /data/disk1/nextcloud/apps:/var/www/html
    environment:
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=MyTopSecretDBPassword
      - POSTGRES_HOST=192.168.1.20
    networks:
      - proxy-tier
    restart: always

  collabora:
    image: collabora/code
    container_name: collabora
    cap_add:
      - MKNOD
    environment:
      - domain=office.mydomain.com
    networks:
      - proxy-tier
    restart: always

networks:
  proxy-tier:
    external:
      name: nginx-proxy
  1. Executed # sudo docker-compose up on that
  2. Waited a little bit and then started browser to “office.mydomain.com” and it redirected to https://office.mydomain.com
  3. Created an admin account
  4. Went to Settings => Apps => Integration and enabled “Collabora Online”
  5. Went to Settings => Admin => Collabora Online and entered the Collabora Online Server: https://office.mydomain.com and saved
  6. Tested to open the default document About.odt and it works :slight_smile:

Regards Joacim

1 Like