Published June 19, 2018 by

Integrate OnlyOffice Document Server in NextCloud

Installing OnlyOffice Document Server for Linux on Debian, Ubuntu, and derivatives


Adding the repository containing the up-to-date Node.js package versions:

Add repository:

curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install -y nodejs

Installing and configuring PostgreSQL:

Install the PostgreSQL version included in your version of Ubuntu:

sudo apt-get install postgresql

After PostgreSQL is installed, create the PostgreSQL database and user:

sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"

Installing Redis:

sudo apt-get install redis-server

Installing rabbitmq:

sudo apt-get install rabbitmq-server

Installing Document Server

Add GPG key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

Add Document Server repository:

sudo echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list

Update the package manager cache:

sudo apt-get update

Install Document Server

sudo apt-get install onlyoffice-documentserver

Now go to a browser and try to access server_ip OR localhost


Document Server is running now.


Integrate OnlyOffice Editor in NextCloud

Download onlyoffice editor

cd /tmp

wget https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases/download/v1.3.0/onlyoffice-nextcloud.tar.gz

tar xzf onlyoffice-nextcloud.tar.gz
cp -r onlyoffice /var/www/html/nextcloud/apps/
cd /var/www/html/nextcloud/apps/

Then run the commands below to set the correct permissions for onlyoffice to function.

sudo chown -R www-data:www-data onlyoffice

Edit config.php for onlyoffice permission.

sudo vim /var/www/html/nextcloud/config/config.php

Insert below data

'onlyoffice' => array(
'verify_peer_off' => true
)

Save and Exit.

Access Nextcloud, Go to Admin icon and click on ‘+ Apps’ button.


Click on ‘Disabled apps’ and  do ‘Enable onlyoffice


Here it asks for an admin password. give a Password and Confirm.


Now, Go to Settings.


Click on Additional Settings in Left Panel bottom.

Scroll down to ONLYOFFICE options and give Document Server address and click on Save as per below Screenshot.


Now it's done and let's start to create documents.