##########################################################
####### Ubuntu OnlyOffice Installation for Cloud #########
##########################################################
#### Database Installation ####
sudo apt install postgresql
sudo -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -u postgres psql -c "CREATE USER onlyoffice WITH password '*********';"
sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
#### NodeJS Installation ####
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
apt-cache policy nodejs
sudo apt-get install nodejs
#### Redis und Rabbitmq Server Installation ####
sudo apt install redis-server
sudo apt install rabbitmq-server
systemctl status redis-server
systemctl status rabbitmq-server
#### Webserver Installation ####
sudo apt install nginx nginx-extras libcurl3
#### Onlyoffice Document Server Installation ####
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
sudo apt update && sudo apt install onlyoffice-documentserver