Installing dependencies
First install the dependencies necessary for Document Server correct work:
sudo apt-get update
sudo apt-get install adduser redis-server rabbitmq-server nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2
Copying Document Server to its folder
Switch to the server folder of Document Server and build and install it using the command:
cd ../server && sudo make install
The built Document Server will be copied to the /var/www/onlyoffice/documentserver/
folder, the onlyoffice user will be created. Also Document Server work folders will be created, the font list and the font thumbnails will be created automatically.
Installing and configuring NGINX
- Install NGINX:
sudo apt-get install nginx
- Disable the default website:
sudo rm -f /etc/nginx/sites-enabled/default
- Now you need to set up the new website. To do that create the
/etc/nginx/sites-available/onlyoffice-documentserver
file with the following contents:
map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
location /spellchecker/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
}
}
- Ad the symlink to the newly created website to the
/etc/nginx/sites-available
directory:
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
- And restart NGINX to apply the changes:
sudo nginx -s reload
Installing and configuring PostgreSQL
Install PostgreSQL using the following command:
sudo apt-get install postgresql
Once PostgreSQL is installed, run the following commands to create the PostgreSQL database and user:
The created database must have onlyoffice both for user and password.
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;"
Run the following command to configure the database:
psql -hlocalhost -Uonlyoffice -d onlyoffice -f /var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
Upon that, you will be asked to provide a password for the onlyoffice
PostgreSQL user. Please enter the onlyoffice
password.