Document Server is available in Snapcraft store as a snap package. A snap contains all the dependencies to run the application. To use it, all you need is snapd, a system to install and manage snaps. Snapd is included into most of modern distributions. You only need to either enable or install it. See the official snap project page for the snapd installation instructions.
sudo apt update sudo apt install snapd
sudo snap install onlyoffice-ds
To remove the snap containing Document Server use the following command:
sudo snap remove onlyoffice-ds