OnlyOffice
Preparing the Install
Document Server uses Node.js (version 8.12.0), NGINX and PostgreSQL as database. Dependencies found in the system repository will be installed automatically at Document Server installation using the apt-get install command.
Adding the repository containing the up-to-date Node.js package versions:
Add repository:
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
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
Ubuntu 18.04 will require to install npm and nginx-extras. This is done using the command:
sudo apt-get install npm nginx-extras
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
Rebuilding spellchecker (Ubuntu 18.04)
For the spellchecker to work correctly under Ubuntu 18.04 you will need to rebuild it. This is done the following way:
Update npm:
sudo npm install -g npm
Stop Document Server services:
sudo supervisorctl stop all
Install the components necessary for the build:
sudo apt-get install build-essential git
Switch to the spellchecker folder:
cd /var/www/onlyoffice/documentserver/server/SpellChecker/
Delete the older build:
sudo mv node_modules/ node_modules_old/
Install the dependencies:
sudo npm install
And finally start back Document Server services:
sudo supervisorctl start all
Restrict OnllyOffice to one NextCloud server
1. Edit /etc/onlyoffice/documentserver/local.json file as follow:
{
"services": {
"CoAuthoring": {
"sql": {
"type": "postgres",
"dbHost": "localhost",
"dbPort": "5432",
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice"
},
"redis": {
"host": "localhost"
},
"token": {
"enable": {
"request": {
"inbox": true,
"outbox": true
},
"browser": true
},
"inbox": {
"header": "<header>"
},
"outbox": {
"header": "<header>"
}
},
"secret": {
"inbox": {
"string": "<secret>"
},
"outbox": {
"string": "<secret>"
},
"session": {
"string": "<secret>"
}
}
}
},
"rabbitmq": {
"url": "amqp://guest:guest@localhost"
}
}
NOTE: The "secret' can be generated using this command:
openssl rand -base64 16
2. Restart the service:
sudo supervisorctl restart all
3. Add the following lines to /var/www/nextcloud/config/config.php on NexctCloud server
'onlyoffice' =>
array (
"jwt_secret" => "gLEOw4DQCmTLgRL2igTAQ",
"jwt_header" => "opnuknc"
),
4. Restart the service:
sudo apache2ctl graceful
5. On Nextcloud web interface go Settings-Onlyoffice and complete the configuration as follow:
