====== Install OnlyOffice Document Server on Ubuntu ====== ===== Preequites to OnlyOffice Document Server Community Edition ===== Dependencies for OnlyOffice document server are Nginx webserver, PostgreSQL database server, Node.js, Redis Server, and RabbitMQ server. ==== Install PostgreSQL ==== sudo apt install postgresql ==== Create OnlyOffice Database, Username and Password in PostgreSQL ==== **Both the username and password are required to be 'onlyoffice'** Create Only Office database within PostgreSQL (Not MySQL): sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;" Create the OnlyOffice user. sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';" Grant Permissions for the user on the OnlyOffice database: sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" ===== Install NodeJS ===== OnlyOffice document server requires nodejs version 8.12.0+, but the version in Ubuntu repository is outdated, so we will need to install the latest LTS version (12.13.1) of Node.js from upstream repository. ==== Add Node.js repostiory ==== curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - **Install Node.js.** sudo apt install nodejs -y **Check Node.js version.** node -v **Sample output:** v12.18.0 Install Redis server and Rabbitmq sudo apt install redis-server rabbitmq-server Check their status. systemctl status redis-server systemctl status rabbitmq-server Status should show these are active (running). If rabbitmq-server failed to start, that’s mostly because of low memory on the machine or invalid hostname. Redis server listens on 127.0.0.1:6379. RabbitMQ listens on 0.0.0.0:25672 and 0.0.0.0:4369 ====== Install OnlyOffice document server ====== **Add OnlyOffice repository with the following command.** echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list **Import OnlyOffice public key.** sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 Update local package index and install OnlyOffice document server. Note that the onlyoffice-documentserver package will install nginx-extras as a dependency, so if an Apache web server is running, you need to stop it first. sudo apt update sudo apt install onlyoffice-documentserver During the installation process, you will be asked to enter PostgreSQL password for onlyoffice. Enter the password: onlyoffice A Nginx server block will be installed as /etc/nginx/conf.d/ds.conf. (It’s actually a symbolic link to /etc/onlyoffice/documentserver/nginx/ds.conf.) The OnlyOffice document server is a nodejs web application and Nginx acts as the reverse proxy. /var/www/onlyoffice/documentserver/ is the web root directory. Once the installation is finished, enter your server’s public IP address in web browser, you should see “Document Server is running”