hi there,
as requested, little how-to
"core" setup is based to macom's How-To nextcloud letsencrypt docker compose so all pathes go back to this tutorial - if you have changed them, you know what to do
What to do?
Like nextcloud? Love the way it fit your needs? So what will you do if you need one of your office documents on the fly and you see "oh, i have to change that". Yeah, just download it, do your changes, and reup - no problem since most computers got some office program installed... but - it can be more easy;
I just open it right there from nextcloud, do my changes, and close it. cool hm?
How-To:
we need to install and integrate onlyoffice to our nextcloud installation.
Step1:
we need a self signed certificate for the communication of nextcloud and onlyoffice, just follow this steps line by line in cli: and fill in the informations needed (you can also skip most but: (Common Name (e.g. server FQDN or YOUR name)) is requiered) - here you enter your localip.
Fit line 1 to your enviorment
mkdir -p /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/data/certs
cd /srv/dev-disk-by-label-datadisk1/app/onlyoffice/DocumentServer/data/certs
openssl genrsa -out onlyoffice.key 4096
openssl req -new -key onlyoffice.key -out onlyoffice.csr
openssl x509 -req -days 3650 -in onlyoffice.csr -signkey onlyoffice.key -out onlyoffice.crt
openssl dhparam -out dhparam.pem 4096
chmod 400 onlyoffice.key
chmod 400 onlyoffice.crt
chmod 400 onlyoffice.csr
chmod 400 dhparam.pem
Step2:
open your nextcloud compose file
cd /home/docker1/nextcloud
nano docker-compose.yml
add this to the end of the file
onlyofficedocker:
image: onlyoffice/documentserver:latest
container_name: onlyofficedocker
stdin_open: true
restart: always
environment:
- JWT_ENABLED=true
- JWT_SECRET=superSecretShareKey #you will need this in nextcloud after
ports:
- 4433:443
volumes:
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/data/:/var/www/onlyoffice/Data
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/logs:/var/log/onlyoffice
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/db:/var/lib/postgresql
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten
- /srv/dev-disk-by-label-disk1/appdata/onlyoffice/DocumentServer/data/:/var/www/onlyoffice/Data onlyoffice/documentserver
Alles anzeigen
the last line looks like a dupe of line 12 - but seems to be need, otherwise my setup didn't find the cert ... so just read over
line 8 needs to set secret key - fill in what ever you want, but you will need it again like my comment say
line 12 - 18 just the default volume rework - fit it to your enviorment.
save the compose file.
Step3:
add subfolder config for onlyoffice to letsencrypt
nano /srv/dev-disk-by-label-disk1/appdata/letsencrypt/nginx/proxy-confs/onlyoffice.subfolder.conf
add this to the new empty file: (thx again @Morlan )
location /onlyoffice {
return 301 $scheme://$host/onlyoffice/;
}
location ^~ /onlyoffice/ {
rewrite /onlyoffice/(.*) /$1 break;
proxy_pass https://<yourLocalIP>:4433; #need to change!
proxy_redirect off;
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 $host/onlyoffice;
proxy_set_header X-Forwarded-Proto $scheme;
}
Alles anzeigen
change line 7 to hosts ip
close and save the file.
Step4:
say the following words "abra cadabra" stand up, spin around your self 2 times and say "lets do it!"
we should be right here in /home/docker1/nextcloud directory
run: docker-compose up -d
run:docker restart letsencrypt
Open web browser and try to connect: https://your.domain/onlyoffice
you should see a page with "Document Server is running" in the middle of the page - well done general.
Step5:
bring it to nextcloud
Login to nextcloud with a admin user
go to +Apps menu and search for ONLYOFFICE (Featured) and install/enable it (if not done by default nextcloud setup)
go to Settings, scrool down until you see ONLYOFFICE in the left menu - click on it
Document Editing Service adress will be your https://your.domain/onlyoffice like we test in step 4 and remember to step2 line 8 this is the time you will need it
after adding both, just click save.
oO_nC-conf.png
Step6:
login to your normal nextcloud user
navigate to your files - just click on a office file you want - it should be open with onyloffice in your browser. you can also use the + sign in Filetab and just create a new one
hope it will work for you,
oh, and, befor i forgot .. you can sit down
p.s. you may want to backup your nextcloud? have a look