How to Install ONLYOFFICE on Void Linux

ONLYOFFICE is a document editor, which can be used to create and edit text documents, spreadsheets and presentations. In this tutorial, we will walk you through the steps to install the ONLYOFFICE on Void Linux.

Prerequisites

Before we proceed with the installation process, make sure your system meets the following prerequisites:

Step-by-Step Guide

Follow the below-mentioned steps to install ONLYOFFICE on Void Linux:

Step 1: Install Required Packages

To install ONLYOFFICE, we need to install several packages. Execute the following command to install the requirements:

xbps-install -S mariadb mariadb-client nginx redis git rabbitmq-server

Step 2: Install Document Server

Clone the Document Server repository using the following command:

git clone https://github.com/ONLYOFFICE/DocumentServer.git

Navigate to the cloned directory and execute the following command:

bash setup.sh install

Step 3: Configure Nginx

Go to the Nginx configuration directory:

cd /etc/nginx

Open the nginx.conf file and add the following lines at the end of http section:

upstream php {
        server 127.0.0.1:9000;
}

Save and exit the file.

Now, create a new configuration file for ONLYOFFICE and paste the following content:

server {
   listen 80;
   server_name document.server;
   server_tokens off;

   access_log /var/log/nginx/document.server.access.log;
   error_log /var/log/nginx/document.server.error.log;

   location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_buffer_size 64k;
        proxy_buffers 4 64k;
        proxy_read_timeout 3m;
        proxy_send_timeout 3m;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

   location ~ ^/(web-apps|welcome|fonts|images)/ {
        proxy_pass http://127.0.0.1:8000;
        proxy_buffer_size 64k;
        proxy_buffers 4 64k;
        proxy_read_timeout 3m;
        proxy_send_timeout 3m;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

   location ~ ^/api/(2\.0|v\d\.\d)/(diagnostic|files|mail|spam)\. {
        proxy_pass http://127.0.0.1:8080; ## errorPage=? if you want to show own ONLYOFFICE error page
        proxy_buffer_size 64k;
        proxy_buffers 4 64k;
        proxy_read_timeout 3m;
        proxy_send_timeout 3m;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Once you have added the content, save and exit the file.

Step 4: Configure Database

Execute the following commands to configure the database:

mysql -u root -p

This command will allow you to log in as a root user in MariaDB.

Next, execute the following commands to create a new database and user for ONLYOFFICE:

CREATE DATABASE ONLYOFFICE_DB;
GRANT ALL PRIVILEGES ON ONLYOFFICE_DB.* TO 'onlyoffice'@'localhost' IDENTIFIED BY 'yourpassword';
FLUSH PRIVILEGES;
exit

Make sure to replace yourpassword with a strong password for your ONLYOFFICE user.

Step 5: Start ONLYOFFICE

To start ONLYOFFICE, execute the following command:

sudo systemctl start onlyoffice-documentserver

Step 6: Verify the Installation

You can verify the installation of ONLYOFFICE by accessing it using your server's IP. In your web browser, enter http://your-server-ip and see if it loads the login page.

Now, log in to ONLYOFFICE using the default username and password:

username: `admin`
password: `your-password`

Once you have logged in, you can start using ONLYOFFICE.

Conclusion

By following these steps, you have successfully installed ONLYOFFICE on Void Linux. You can now create and edit text documents, spreadsheets, and presentations using ONLYOFFICE.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!