Skip to content

Instantly share code, notes, and snippets.

@tavinus
Last active January 17, 2025 16:49
Show Gist options
  • Save tavinus/64b89730e8deb5253e66cce3b5a6b21f to your computer and use it in GitHub Desktop.
Save tavinus/64b89730e8deb5253e66cce3b5a6b21f to your computer and use it in GitHub Desktop.
Install OnlyOffice 7.2.4 on Debian 11 Bullseye
#!/bin/bash
##########################################################################
# Tavinus Nov 2022
#
# https://gist.github.com/tavinus/64b89730e8deb5253e66cce3b5a6b21f
# This is a work in progress, use at your own risk
#
# The POSTGRES password is 'onlyoffice' and
# it will be asked during install
##########################################################################
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# initial setup
apt update
apt upgrade -y
apt install -y sudo nano htop gnupg2
# postgresql
apt install -y postgresql
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
# rabbitmq
apt install -y rabbitmq-server
# nginx
apt install -y nginx-extras
# add gpg key
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
chmod 644 /tmp/onlyoffice.gpg
chown root:root /tmp/onlyoffice.gpg
mv /tmp/onlyoffice.gpg /etc/apt/trusted.gpg.d/
# add repo
echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
apt update
# add ms fonts
apt install -y ttf-mscorefonts-installer
# install only office
apt install -y onlyoffice-documentserver
# Show JWT info
documentserver-jwt-status.sh
echo
echo "ALL DONE"
exit 0
@master-mcfly
Copy link

Its not possible to connect Office to Nextcloud. My Office is installing well with your script into Proxmox LXC container. But this container tell me 502 Bad Gateway nginx. I didnt touch nginx configs for now! The Welcome page is working!

@kacenka49
Copy link

Had the same issue as @master-mcfly. After digging into problem i found out that "ds-docservice.service" had errors mentioning "DB table "task_result" does not exist". Also there was nothing running on port 8000.
To fix that:
Set the onlyoffice to be the DB owner sudo -i -u postgres psql -c "ALTER DATABASE onlyoffice OWNER TO onlyoffice;"
Import the schema psql -h localhost -U onlyoffice -d onlyoffice -f /var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
Restart the service systemctl restart ds-docservice.service
The ss -tuln | grep 8000 should now return the doc server listening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment