Skip to content

Instantly share code, notes, and snippets.

@tavinus
Last active January 17, 2025 16:49

Revisions

  1. tavinus revised this gist Nov 8, 2022. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,15 @@
    #!/bin/bash
    # this is a work in progress, use at your own risk

    ##########################################################################
    # 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"
  2. tavinus revised this gist Nov 7, 2022. 1 changed file with 0 additions and 7 deletions.
    7 changes: 0 additions & 7 deletions onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -11,13 +11,6 @@ apt update
    apt upgrade -y
    apt install -y sudo nano htop gnupg2

    # reconfigure timezone
    dpkg-reconfigure tzdata

    # reconfigure locales
    # dpkg-reconfigure locales
    # NOTE: you will only get the default language in terminal after rebooting

    # postgresql
    apt install -y postgresql
    sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
  3. tavinus revised this gist Nov 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ apt install -y sudo nano htop gnupg2
    dpkg-reconfigure tzdata

    # reconfigure locales
    dpkg-reconfigure locales
    # dpkg-reconfigure locales
    # NOTE: you will only get the default language in terminal after rebooting

    # postgresql
  4. tavinus revised this gist Nov 7, 2022. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,18 @@ if [ "$EUID" -ne 0 ]
    exit
    fi

    # initial setup
    apt update
    apt upgrade -y
    apt install -y sudo nano htop gnupg2

    # reconfigure timezone
    dpkg-reconfigure tzdata

    # reconfigure locales
    dpkg-reconfigure locales
    # NOTE: you will only get the default language in terminal after rebooting

    # postgresql
    apt install -y postgresql
    sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
  5. tavinus revised this gist Nov 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ fi

    apt update
    apt upgrade -y
    apt install sudo nano htop gnupg2
    apt install -y sudo nano htop gnupg2

    # postgresql
    apt install -y postgresql
  6. tavinus created this gist Nov 7, 2022.
    49 changes: 49 additions & 0 deletions onlyofficeInstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/bin/bash
    # this is a work in progress, use at your own risk

    if [ "$EUID" -ne 0 ]
    then echo "Please run as root"
    exit
    fi

    apt update
    apt upgrade -y
    apt install 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