This repo contains docker setup of nextcloud with onlyoffice for editing office documents
Note: This repo has only been tested on ubuntu 20.04
and we recommend the same, nonetheless it should work easily on unix systems and might need few changes (mounted paths in docker-compose.yml) to work on windows.
- docker
- docker-compose
- any editor for editting the files (vim, gedit etc.)
On ubuntu 20.04 install the requirements with:
sudo apt-get update && sudo apt-get install -y docker docker-compose vim
Add current user to docker
group (ubuntu):
sudo usermod -aG docker $USER
You need to logout and login for the changes to take effect before you continue.
Meaning of the settings are below:
LE_EMAIL
: the email address used by letsencrypt to generate ssl certificates.LE_REDIRECT
(yes/no): whether to redirect http to https after installation of the certificate.PROXY_SSL
: whether you want to usessl
certificate.MYSQL_ROOT_PASSWORD
: root password for the mysql database.MYSQL_USER
: normal user account for the application.MYSQL_PASSWORD
: password for the normal user account for the application.MYSQL_DATABASE
: database name for the application.ONLYOFFICE_JWT_SECRET
: the secret that will be used to connect nextcloud and onlyoffice.ONLYOFFICE_DOMIAN
: the domain name or url that will be used to reach the onlyoffice server.APP_DOMAIN
: the main domain name that will be used to reach the nextcloud application.
Make sure the ONLYOFFICE_DOMIAN
and APP_DOMAIN
domain names are correctly pointing to the server running the app for the letsencript and the application to work.
Open the sites-available/app
and change the server_name fields to match the ONLYOFFICE_DOMIAN
and APP_DOMAIN
values.
- change
<APP-URL>
(on line 7) to the value you entered above forAPP_DOMAIN
; - change
<ONLYOFFICE-URL>
(on line 41) to the value you entered above forONLYOFFICE_DOMIAN
;
Note:
- Care must be take NOT to remove the
;
at the end of lines 7 and 41. This will make the file unusable.
- For the local urls to work you need to add them to your
hosts
file and point them to the IP address of the server.
Starting and stoping the application using docker-compose
Start : docker-compose up -d
Stop : docker-compose down
Alternative on ubuntu and other linux servers you can use the start.sh
and stop.sh
scripts to start and stop the application respectively.
To start the application: bash start.sh
To stop the application: bash stop.sh
You can also install the application so that it starts automatically when you boot your system.
bash install.sh
In case you have errors which have to do with permission it might be that your user account does not belong to the docker
group.
To connect nextcloud and onlyoffice you need to install the onlyoffice connector app in nextcloud and configure the app.
You can follow the documentation here.
Note:
secret
field refers to the value set for ONLYOFFICE_JWT_SECRET
in the .env
file.
- Since in the setup nextcloud is behind an nginx proxy you may need to set the values below in the
/var/www/html/config/config.php
in theapp
overwritehost
: set this to the value ofAPP_DOMAIN
overwriteprotocol
: set this to the request protocol (http/https) depending on whether you have enabled ssl or not.allow_local_remote_servers
: set this to (true/false) to allow connection from nextcloud to local servers like onlyoffice if you have a local setup.skeletondirectory
: set this to the directory which contains the default files and folder which every new user inherits. NB set to empty string to disable this.
You can have a look at theconfig.php
file in the repo to guide you.