Collaboration with Nextcloud documents
ONLYOFFICE allows you to edit documents in the browser. To use ONLYOFFICE, you will need an ONLYOFFICE Document Server. This article describes how to install the open source Community Edition of ONLYOFFICE Document Server, using Docker, which could be deployed in-house or on AWS.
You Docker server will need the following:
- CPU: dual core 2 GHz or better
- RAM: 2GB or more
- HDD: at least 2GB of free space
- Swap: at least 4GB of swap
If you are building an AWS EC2 Docker instance, t3a.small is a good starting point.
It is best practice to store data outside the container, so that you can upgrade ONLYOFFICE with minimal disruption. By default the data is stored at the following locations inside the container:
- /var/log/onlyoffice for Document Server logs
- /var/www/onlyoffice/Data for certificates
- /var/lib/onlyoffice for file cache
- /var/lib/postgresql for database
We will create four Docker Volumes to support the above directories:
Install Document Server
Start by logging on to Docker. Note that when performing a Snap install of Docker on Ubuntu, volumes are mounted in /var/snap/docker/common/var-lib-docker/volumes and not /var/lib/docker as referenced below.
- Run the following command.
sudo docker run --name=onlyoffice -i -t -d -p 443:443 -p 80:80 --restart=always \
-v /var/lib/docker/volumes/onlyoffice_logs:/var/log/onlyoffice \
-v /var/lib/docker/volumes/onlyoffice_db:/var/www/onlyoffice/Data \
-v /var/lib/docker/volumes/onlyoffice_lib:/var/lib/onlyoffice \
-v /var/lib/volumes/onlyoffice_db:/var/lib/postgresql onlyoffice/documentserver
This command will name your container, it will open ports 443 and 80, which are both needed for SSL certificate installation. The Container will always try to run, except if you stop it manually. Finally, the onlyoffice directories will be mounted to the Docker Volumes.
You will need to create two DNS A records (e.g. onlyoffice.yourschool.org and www.onlyoffice.yourschool.org) and point them to the IP address of your host.
- Access your Docker host via Portainer.
- Access the onlyoffice container via the exec console.
- Install Certbot for NGINX.
Certbot is an application for using Let's Encrypt SSL certificates.
To finish this installation, you need to log on to your Nextcloud instance.
- Click your Avatar > Apps.
- Select the Office & text category in the left pane.
- Click the Download and enable button for the ONLYOFFICE connector.
- Click your Avatar > Settings.
- Select ONLYOFFICE in the left pane.
- Enter the URL for your new Document Editing Service address.
You should now find that you can edit documents inside Nextcloud.
Here are some further Nextcloud settings that you can make:
- Restrict access to ONLYOFFICE for a selection of Nextcloud groups.
- Select file formats to automatically open in ONLYOFFICE.
- There's even a security watermarking feature.
Please see this article for further information on how to perform these steps.
Thanks for visiting.