ONLYOFFICE Docs is a free and open-source document server for small and medium-sized organizations. This web-based collaboration suite can be used to manage documents, projects, teams and customer relations from a central location. ONLYOFFICE Docs supports several Open XML formats including .xlsx, .pptx, and .docx and enables collaborative editing in real-time. You can use the ONLYOFFICE Docs API to integrate the ONLYOFFICE Document Editor into your website to manage editors.
In this tutorial, we will show you how to install ONLYOFFICE Docs on Debian 10.
Prerequisites
- A fresh Debian 10 VPS on the Atlantic.Net Cloud Platform
- A root password configured on your server
Step 1 – Create Atlantic.Net Cloud Server
First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Debian 10 as the operating system, with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.
Once you are logged in to your Debian 10 server, run the following command to update your base system with the latest available packages.
apt-get update -y
Step 2 – Install Nginx and Other Dependencies
First, you will need to install the Nginx webserver to serve the ONLYOFFICE Dcos. You can install it with the following command:
apt-get install nginx nginx-extras -y
After installing the Nginx web server, you will need to install RabbitMQ-server and Redis in your system. You can install both using the following command:
apt-get install redis-server rabbitmq-server gnupg2 curl -y
Once both packages are installed, start the RabbitMQ and Redis service with the following command:
systemctl start rabbitmq-server systemctl start redis-server
Once you are finished, you can proceed to the next step.
Step 3 – Install and Configure PostgreSQL
ONLYOFFICE uses PostgreSQL as a database backend, so you will need to install it in your server. You can install it using the following command:
apt-get install postgresql -y
Once installed, start the PostgreSQL service with the following command:
systemctl start postgresql
Next, log into the PostgreSQL shell with the following command:
su - postgres postgres@debian10:~$ psql
Once logged in, you should get the following output:
psql (11.9 (Debian 11.9-0+deb10u1)) Type "help" for help.
Next, create a database and user for the Document server with the following command:
postgres=# CREATE DATABASE onlyoffice; postgres=# CREATE USER onlyoffice WITH password 'onlyoffice'; postgres=# GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;
Next, exit from the PostgreSQL shell with the following command:
postgres=# EXIT
Next, run exit command again to exit from the Postgres user:
exit
Step 4 – Install ONLYOFFICE Docs
By default, the ONLYOFFICE Docs package is not available in the Debian 10 default repository, so you will need to add the ONLYOFFICE Docs repository to your system.
First, download and add the GPG key with the following command:
mkdir -p -m 700 ~/.gnupg curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import chmod 644 /tmp/onlyoffice.gpg chown root:root /tmp/onlyoffice.gpg mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg
Next, add the ONLYOFFICE Docs repository with the following command:
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
Once the repository is added, update the repository with the following command:
apt-get update -y
Next, download and install the ttf-mscorefonts-installer and other packages using the following command.
wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8.1_all.deb dpkg -i ttf-mscorefonts-installer_3.8.1_all.deb apt install x11-common xfonts-encodings libfontenc1 fonts-dejavu-extra cabextract xfonts-utils libcurl4 libxml2 fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol -y
You will get some dependencies error after runnig the above commands. You can fix it with the following command.
apt install -f
Finally, install the ONLYOFFICE Docs with the following command.
apt-get install onlyoffice-documentserver -y
During the installation, you will be asked to provide the password as shown below:
Provide your ONLYOFFICE database password that you have created earlier, then hit Enter to finish the installation:
Setting up onlyoffice-documentserver (5.6.5-3) ... Generating AllFonts.js, please wait...Done Generating presentation themes, please wait...Done Congratulations, the ONLYOFFICE docs has been installed successfully!
ONLYOFFICE creates an Nginx configuration file automatically during the installation. You can check it with the following command:
cat /etc/nginx/conf.d/ds.conf
Output:
include /etc/nginx/includes/http-common.conf; server { listen 0.0.0.0:80; listen [::]:80 default_server; server_tokens off; include /etc/nginx/includes/ds-*.conf; }
Next, restart the Nginx service to apply the changes:
systemctl restart nginx
Step 5 – Access ONLYOFFICE Docs Web UI
Now, open your web browser and access the ONLYOFFICE Docs web interface using the URL http://your-server-ip. You should see the ONLYOFFICE dashboard on the following screen:
To use the integrated test example, a simple doc management system, to check if the editors are running correctly. Run the following command in your terminal.
systemctl start ds-example
Now, click on the GO TO TEST EXAMPLE. You will see your example docs on the following screen.
Conclusion
Congratulations! You have successfully installed the ONLYOFFICE Docs on Debian 10. You can now integrate ONLYOFFICE Docs API to your website and start editing your documents. For more information, visit the ONLYOFFICE documentation page. Start using ONLYOFFICE on your Alantic.Net VPS Hosting account!