قالب وردپرس درنا توس
Home / How To / How to install ONLYOFFICE document server with Nginx on Debian 10

How to install ONLYOFFICE document server with Nginx on Debian 10



In this tutorial, we will show you how to install Onlyoffcie Document Server on the latest Debian Buster 10. We will install Onlyoffice Document Server with PostgreSQL, Nginx and Letsencrypt.

Prerequisites

To install Onlyoffice Document Server, at least you will need the Debian server with 2 GB RAM, 4 GB SWAP, 2 CPU and 40 GB free disk space.

What We Will Do:

  • Install Package Dependencies
  • Install and Configure PostgreSQL
  • Generate SSL Letsencrypt and DHPARAM
  • Install Onlyoffice Document Server
  • Run Onlyoffice Document Server with HTTPS
  • Testing

Step 1 – Install Package Dependency

In this first step, we will install some package dependencies required by the document server, including the RabbitMQ server, Redis and Nginx extras.

Update your Debian system layer and install the Document Server package dependencies with the apt command below. [19659014] sudo apt update
sudo apt install redis-server rabbitmq-server nginx-extras gnupg2

When all installation is complete, check the following services using the systemctl command as below.

  systemctl is-enabled nginx 
systemctl is-enabled rabbitmq-server
systemctl is-enabled redis-server

Now make sure all these services are enabled and will run automatically at system startup.

Step 2 – Install and configure PostgreSQL database

In this step, we install the PostgreSQL database in Debian Buster 10 and create a new database using Onlyoffice Document Server.

Now install the PostgreSQL database using the apt command below.

  sudo apt install postgresql 

When the installation is complete, start the PostgreSQL service and add it to the system boot. [1945596]

  systemctl start postgresql 
systemctl enable postgresql [19659015] As a result, the PostgreSQL database is running on the Debian server.

Then we create a new database and role for the installation of Document Server.

Log in to the PostgreSQL shell with the command below.

  sudo -i -u postgres psql 

Create a new database and user named & # 39; onlyoffice & # 39; with the password & # 39; onlyoffice & # 39; using the PostgreSQL queries below.

  CREATE DATABASE onlyoffice; 
CREATE USER only office office With password & # 39; onlyoffice & # 39 ;;
GIVE ALL privileges ON DATABASE onlyoffice TO onlyoffice;

As a result, the PostgreSQL database for Onlyoffice Document Server has been created. [19659013]   Install PostgreSQL

Step 3 - Generate SSL Letsencrypt and DHPARAM

For this tutorial we will run the document server on the secure HTTPS protocol, and we will generate new SSL certificates from lets encrypt and generate DHPARAM certificates .

Install the t Certbot utility to generate SSL Letsencrypt certificates with the apt command below.

  sudo apt install certbot 

Then generate new SSL certificates with the certbot command below and make sure you change the domain name and email address with your own.

  certbot certonly - standalone --agree-tos -m [email protected] -d onlyoffice.hakase-labs.io 

When the certbot command is completed, your SSL certificates will be placed on & # 39; / etc / letsencrypt / live / onlyoffice.yourhakase-labs.io & # 39; directory.

And you have successfully generated SSL Letsencrypt with certbot command line tool.

Then we generate the DHPARAM certificate with the open binary command.

Go to directory & # 39; / etc / ssl / certs & # 39; and generates the DHPARAM certificate using the openssl command below. [19659014] cd / etc / ssl / certs /
openssl dhparam -out dhparam.pem 4096

And your DHPARAM certificate is in the & # 39; / etc / ssl / certs & # 39; directory.

As a result, you have generated SSL Letsencrypt and DHPARAM for the document server. Ads

Step 4 – Installing ONLYOFFICE Document Server

In this step we will install Onlyoffice Document Server. Although the available repository is for Debian Squeeze, it works with the latest Debian Buster 10.

First add the Onlyoffice Document Server GPG key to your Debian system.

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

Now add the Document Server repository.

  sudo echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list Chapter19659015 Premium1919909058 Add Onlyoffice Repository "width =" 750 "height =" 244 "style =" display: block; margin-left: auto; margin-right: auto; "ezimgfmt =" rs rscb1 src ng ngcb1 "class =" ezlazyload "data-ezsrc =" https://www.howtoforge.com/images/how_to_install_onlyoffice_document_server_on_debian_10/3.png "/> [19659013updatetheDebianarchivelistsandinstalltheOnlyofficeDocumentServerusingtheaptcommandbelow

  sudo apt update 
sudo apt install onlyoffice-documenterver

During installation, you will be asked about the PostgreSQL database password for the document server, type the database password & # 39; onlyoffice & # 39; and select & # 39; OK & # 39; to continue.

 PostgreSQL database password for Onlyoffice

And the installation of Onlyoffice Document Server will be completed. It runs on standard HTTP port 80, accessible through the browser.

Step 5 - Run Document Server on HTTPS

In this step, we will secure the document server installation with the HTTPS protocol and use SSL Letsencry pt and dhparam.

By default, the document server provided its virtual host configuration for the Nginx web server, located in the & # 39; / etc / onlyoffice / documentver / nginx / & # 39; directory.

First stop the Nginx service with the systemctl command below.

  systemctl stop nginx 

Now go to directory & # 39; / etc / onlyoffice / documentver / nginx / & # 39; and copy the Virtual Document Server host template configuration for SSL & # 39; ds-ssl.conf. tmpl & # 39; to & # 39; ds.conf & # 39 ;.

  cd / etc / onlyoffice/documentver/nginx/ 
cp ds-ssl.conf.tmpl ds.conf

Now edit the document server configuration & # 39; ds.conf & # 39; uses the vim editor.

  vim ds.conf 

On the ssl_certificate and ssl_certificate_key options, change the path with your SSL certificate path.

  ssl_certificate /etc/letsencrypt/live/onlyoffice.hakase-labs.io/fullchain.pem; Greece  ssl_certificate_key /etc/letsencrypt/live/onlyoffice.hakase-labs.io/privkey.pem; 19871965901amd_support and change the path of the DHPARAM certificate with your own. 

  ssl_dhparam /etc/ssl/certs/dhparam.pem; ebrit19659015 ?? spa and close. 

Then test the Nginx configuration and make sure there is no error, then start the Nginx service.

  nginx -t 
systemctl restart nginx

As a result, the document server does not run on HTTPS secure connection with SSL from Letsencrypt.

 Secure Onlyoffice with SSL Letsencrypt

Step 6 - Testing

Open your browser and enter the domain for your Onlyoffice Document Server installation in the address bar. My are:

https://onlyoffice.hakase-labs.io/

Now you get the page saying that Onlyoffice Document Server is up and running according to below.

 Onlyoffice Document Server installed on Debian Buster 10

As a result, the installation of Onlyoffice Document Server with PostgreSQL and Nginx web server on Debian Buster 10 has been successfully completed.


Source link