├── libreoffice-online ├── .gitignore ├── .env.sample └── docker-compose.yml ├── nextcloud ├── .env.sample └── docker-compose.yml ├── LICENSE └── README.md /libreoffice-online/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /nextcloud/.env.sample: -------------------------------------------------------------------------------- 1 | MYSQL_ROOT_PASSWORD= 2 | MYSQL_PASSWORD= 3 | MYSQL_DATABASE=nextcloud 4 | MYSQL_USER=nextcloud 5 | -------------------------------------------------------------------------------- /libreoffice-online/.env.sample: -------------------------------------------------------------------------------- 1 | NEXTCLOUD_DOMAIN=my.domain 2 | LO_ONLINE_USERNAME=admin 3 | LO_ONLINE_PASSWORD= 4 | LO_ONLINE_EXTRA_PARAMS=--o:ssl.enable=false 5 | -------------------------------------------------------------------------------- /libreoffice-online/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | online: 5 | image: libreoffice/online:master 6 | environment: 7 | domain: ${NEXTCLOUD_DOMAIN} 8 | username: ${LO_ONLINE_USERNAME} 9 | password: ${LO_ONLINE_PASSWORD} 10 | extra_params: ${LO_ONLINE_EXTRA_PARAMS} 11 | DONT_GEN_SSL_CERT: 1 12 | volumes: 13 | - config-volume:/etc/loolwsd 14 | cap_add: 15 | - MKNOD 16 | ports: 17 | - "9980:9980" 18 | restart: 19 | unless-stopped 20 | 21 | volumes: 22 | config-volume: 23 | 24 | -------------------------------------------------------------------------------- /nextcloud/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | volumes: 4 | nextcloud: 5 | db: 6 | 7 | services: 8 | db: 9 | image: mariadb 10 | restart: always 11 | volumes: 12 | - db:/var/lib/mysql 13 | environment: 14 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 15 | - MYSQL_PASSWORD=${MYSQL_PASSWORD} 16 | - MYSQL_DATABASE=${MYSQL_DATABASE} 17 | - MYSQL_USER=${MYSQL_USER} 18 | 19 | app: 20 | image: nextcloud 21 | ports: 22 | - 80:80 23 | links: 24 | - db 25 | volumes: 26 | - nextcloud:/var/www/html 27 | restart: 28 | always 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Samuel Mehrbrodt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nextcloud with LibreOffice Online 2 | 3 | This docker configuration help with setting up Nextcloud with LibreOffice Online 4 | for testing purposes. 5 | It keeps things as simple as possible (no https e.g.). 6 | 7 | ## Preparations 8 | 9 | To get started, you need two virtual machines with two different hostnames. 10 | Install some recent Linux distro on them, e.g. Ubuntu 18.04 (64bit required). 11 | 12 | Install docker and docker-compose on them. 13 | 14 | Then clone this repo. You need the folder `nextcloud` on one machine and 15 | the folder `libreoffice-online` on the other machine. 16 | 17 | ## Setup Nextcloud 18 | 19 | Go to the folder `nextcloud`. If you want to set up nextcloud with a MariaDB database, copy the `.env.sample` to `.env` and set the environment variables accordingly. 20 | Note that the database host is called 'db'. 21 | 22 | If you want to use sqlite instead, you can skip this step. 23 | 24 | Run `docker-compose up -d`. 25 | This will setup Nextcloud and the database for you. 26 | 27 | Now configure Nextcloud in your web browser. It's available on http://yourhost:80 28 | You can change the port in docker-compose.yml. 29 | 30 | When nextcloud is set up, install the App "Collabora Online". Then go to Configuration->Collabora Online 31 | and enter the domain name of your other VM, e.g. http://libreoffice.yourhost:9980 32 | 33 | ## Setup LibreOffice Online 34 | 35 | On your other VM, go to the folder "libreoffice-online". 36 | 37 | Copy the `.env.sample` to `.env` and set the environment variables accordingly. 38 | 39 | * `NEXTCLOUD_DOMAIN` must be set to the domain where your nextcloud is running, e.g. `yourhost` in this example. 40 | * `LO_ONLINE_USERNAME` and `LO_ONLINE_PASSWORD` are used to access the LibreOffice Online dashboard (not absolutely necessary). 41 | 42 | Once set, run `docker-compose up -d`. 43 | This will start LibreOffice online with SSL disabled. 44 | 45 | ### Configuration changes 46 | 47 | The configuration is stored in a docker volume. This way LibreOffice Online can be configured on the host system 48 | and the config will not be overwritten when updating the docker container. 49 | 50 | The volume is created by docker-compose. You can find the volume name via: `docker volume ls` (eg. `libreoffice-online_config-volume`). Finally, find the location of the config file with `docker volume inspect `. 51 | You should see the mount point, for example: `/var/lib/docker/volumes/libreoffice-online_config-volume/_data`. The file `loolwsd.xml` in that directory is the main config file. 52 | 53 | Edit it to your liking, then restart the container: `docker-compose restart` 54 | 55 | ## Using it 56 | 57 | You should now be able to edit documents in your nextcloud with LibreOffice online. 58 | Create a document using the '+' button or upload some. 59 | 60 | To access the LibreOffice Online admin dashboard, visit http://libreoffice.yourhost:9980/loleaflet/dist/admin/admin.html and use the credentials from your .env file. 61 | 62 | To test just LibreOffice Online without using Nextcloud, visit http://libreoffice.yourhost:9980/loleaflet/dist/loleaflet.html?file_path=file:///opt/libreoffice/share/template/common/internal/idxexample.odt . 63 | Note that you have to allow local file access for this to work. Look for storage/filesystem in the [config](#configuration-changes). 64 | 65 | ## Updating 66 | 67 | To get the latest version, run the following two commands: 68 | 69 | ```bash 70 | docker-compose pull 71 | docker-compose up -d --build 72 | ``` 73 | 74 | ## Troubleshooting 75 | 76 | If it doesn't work, look at the logs from your docker containers, easiest with: 77 | `docker-compose logs` 78 | 79 | ## Professional support 80 | 81 | If you want to deploy LibreOffice Online in your company/organization, please contact us at https://libreoffice.cib.de/ to get professional support. 82 | --------------------------------------------------------------------------------