Deployment guide

ONLYOFFICE DocSpace

Overview

ONLYOFFICE DocSpace is an open source, room-based document collaboration platform. Every room opens files in the ONLYOFFICE Docs editors, so word processing, spreadsheets, presentations, forms and PDF work happen in the browser with real-time co-editing, comments, track changes and version history. This guide covers the deployment and configuration of ONLYOFFICE DocSpace on Ubuntu 24.04 on Azure, using SecureAnyCloud Azure Marketplace images.

Work is organized into rooms. Collaboration rooms are for co-editing, public rooms publish content through links, form-filling rooms collect responses, and custom rooms combine the rules you need. Virtual data rooms add watermarks, file lifetimes and download controls.

What you get:

  • ONLYOFFICE DocSpace Community 3.7.2, installed from the official ONLYOFFICE apt repository as the docspace package set, with every component pinned to 3.7.2.577
  • ONLYOFFICE Docs Community 9.4.0, the Document Server that renders the editors, bound to loopback and reached through DocSpace. As of 9.4.0, upstream removed the Community edition's historic limit of 20 simultaneously opened documents. This image ships that build unmodified
  • MySQL 8.0, Redis 7.0 and RabbitMQ from the Ubuntu archive, OpenSearch 2.19.6 and OpenResty from their vendors, and .NET 10, Node.js 22 and OpenJDK 21 runtimes
  • A TLS front door. OpenResty terminates HTTPS on port 443 with a certificate generated for this VM's address, and redirects port 80
  • A first-time setup gate. The owner-creating wizard is reachable only through a one-time, per-VM link
  • First-boot secret generation. Database, broker and cache passwords, the Document Server JWT secret, the signing key, the identity encryption secret and the TLS certificate are all unique to each VM
  • Everything else on loopback. Only TCP 22, 80 and 443 are reachable from outside, enforced both by binding and by a default-deny host firewall
  • 24/7 SecureAnyCloud support

DocSpace is a stack of more than twenty services rather than one program. It includes a set of .NET and Node.js backends, two Java identity services, MySQL as the database, Redis as the cache, RabbitMQ as the event bus, OpenSearch for full-text search, OpenResty as the application router, and a separate ONLYOFFICE Docs 9.4 Document Server that renders the editors. The SecureAnyCloud image installs all of it from ONLYOFFICE's official native packages, pinned to exact versions. It wires the stack the way the vendor's own installer does, minus the parts that would compromise the image: no swap file, no relicensed Redis build and no logging dashboards that phone home.

Nothing in this image ships with a known secret, and nobody can claim your portal before you do. The MySQL, RabbitMQ and Redis passwords, the Document Server JWT secret, the DocSpace signing key, the identity encryption secret and the TLS certificate are all generated on the first boot of every VM. The DocSpace first-run wizard creates the owner account. It is held behind a one-time setup link that exists only in a root-readable file on your VM. The front door answers 403 to everyone else until you complete the wizard. It then unlocks itself, and the DocSpace sign-in takes over.

ONLYOFFICE is a trademark of Ascensio System SIA. This image is produced by SecureAnyCloud and is not affiliated with, sponsored by, or endorsed by Ascensio System SIA. It ships the free and open source ONLYOFFICE DocSpace Community and ONLYOFFICE Docs Community software unmodified under the GNU AGPL v3. Corresponding sources are at https://github.com/ONLYOFFICE/DocSpace and https://github.com/ONLYOFFICE/DocumentServer. No ONLYOFFICE logo is used on this page.

Prerequisites

  • An Azure subscription with permission to create virtual machines
  • An SSH key pair for VM access
  • A VM size of Standard_B4ms or larger (4 vCPU, 16 GiB RAM). Measured at idle, the DocSpace services use about 4.8 GB, OpenSearch 4.6 GB, the identity services 1.4 GB and MySQL 0.6 GB. The ONLYOFFICE installer requires 8 GB and adds a swap file below 12 GB. This image ships no swap, so 16 GiB is the minimum size
  • Inbound network security group rules for TCP 22 and 443 (and 80 if you want the redirect)
  • Optionally, a DNS name you control, if you want a trusted certificate
1

Deploy from the Azure Portal

  • In the Azure Portal, search the Marketplace for ONLYOFFICE DocSpace on Ubuntu 24.04 LTS and select the SecureAnyCloud offer.
  • Choose Standard_B4ms or larger.
  • Set the administrator username to azureuser and upload your SSH public key.
  • On the Networking tab, allow inbound SSH (22) and HTTPS (443).
  • Review and create.
2

Deploy from the Azure CLI

az vm image terms accept --urn sac1647283583153:onlyoffice-docspace-ubuntu-24-04:default:latest
az vm create \
  --resource-group my-docspace-rg \
  --name my-docspace-vm \
  --image sac1647283583153:onlyoffice-docspace-ubuntu-24-04:default:latest \
  --size Standard_B4ms \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard
3

Connect to your VM

ssh azureuser@<vm-ip>
4

Wait for first boot and confirm the services are running

onlyoffice-docspace-firstboot is a one-shot unit that runs once, on the first boot. It generates every secret this VM needs, issues the TLS certificate, arms the setup gate, and only then releases the DocSpace and Document Server services. Until it finishes, the web address answers HTTP 503 rather than serving a half-configured portal.

sudo systemctl status onlyoffice-docspace-firstboot.service --no-pager | head -5

The stack then takes two to three minutes to warm up on a fresh boot, because more than twenty services compile and start at once. Confirm that the core services are active:

systemctl is-active mysql redis-server rabbitmq-server opensearch openresty nginx ds-docservice \
  docspace-api docspace-studio docspace-files docspace-people-server docspace-login docspace-doceditor \
  docspace-socket docspace-identity-api docspace-identity-authorization | sort | uniq -c

Expected output:

16 active

Confirm that the DocSpace API answers through the loopback front:

curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1/api/2.0/settings

Expected output:

200

Then confirm that the Document Server behind it is healthy:

curl -s http://127.0.0.1/ds-vpath/healthcheck; echo

Expected output:

true
5

Retrieve your per-instance credentials and the setup link

Everything unique to this VM is written to a root-only file on first boot:

sudo cat /root/onlyoffice-docspace-credentials.txt

This file contains:

  • DOCSPACE_URL: the address to open in a browser, https://<your VM address>/
  • SETUP_URL: the one-time setup link that unlocks the first-run wizard, and SETUP_KEY, the key inside it
  • MYSQL_PASSWORD, RABBITMQ_PASSWORD, REDIS_PASSWORD: the per-VM passwords of the onlyoffice database, broker and cache accounts, all on loopback
  • JWT_SECRET: the secret that authenticates every request between DocSpace and the Document Server
6

Understand the setup gate

DocSpace creates its owner account through a wizard that upstream serves to anyone who reaches the portal first. On a public IP, that is a race you could lose. This image closes it. Until the wizard is complete, every request to the front door is answered with 403 unless it carries a cookie that only the setup link can set.

sudo onlyoffice-docspace-setup-gate status

Expected output on a freshly deployed VM:

armed (waiting for the owner to complete the setup wizard)

Prove it from the VM itself. Without the cookie, the portal is closed:

curl -ks -o /dev/null -w '%{http_code}\n' https://127.0.0.1/

Expected output:

403

A wrong key is refused in the same way. The real setup link answers with a redirect and sets the cookie:

SETUP_KEY=$(sudo grep '^SETUP_KEY=' /root/onlyoffice-docspace-credentials.txt | cut -d= -f2-)
WRONG=$(curl -ks -o /dev/null -w '%{http_code}' 'https://127.0.0.1/sac-setup?key=not-the-key')
RIGHT=$(curl -ks -o /dev/null -w '%{http_code}' "https://127.0.0.1/sac-setup?key=${SETUP_KEY}")
echo "wrong key -> ${WRONG}; setup link -> ${RIGHT}"

Expected output:

wrong key -> 403; setup link -> 302

A timer on the VM polls DocSpace every ten seconds and opens the gate as soon as the wizard reports complete. To open the gate by hand, run sudo onlyoffice-docspace-setup-gate lift.

7

Create the owner account

Open the SETUP_URL from Step 5 in a browser. The image ships a self-signed certificate generated for this VM, so your browser warns you on the first visit. Accept the warning, or install a trusted certificate as described below. The link sets the setup cookie and takes you to the DocSpace wizard, where you choose the owner email address and password.

Within seconds of the wizard finishing, the gate opens and the same address serves the DocSpace sign-in page to everyone. From then on, the portal is protected by DocSpace accounts, roles and sharing rules, as upstream designed them.

8

Create a room and edit a document

Sign in as the owner and use Rooms to create your first room. A collaboration room suits a team that co-edits files. Inside the room, select Create new to start a document, spreadsheet, presentation or form, and select Upload to bring in existing files.

Opening a document launches the ONLYOFFICE Docs editor in the same tab. The Document Server on this VM serves the editor through the front door under /ds-vpath/, and every editing session is authenticated with the per-VM JWT secret from Step 5. Text you type is saved back into the room automatically.

9

Invite people

Contacts lists members, guests and admins. To invite people by email, first configure an SMTP server under Settings > Integration > SMTP settings. Alternatively, generate an invitation link and share it yourself, which needs no mail server.

10

Understand the security model

List every socket bound to an address other than loopback, so that anything unexpected shows up:

sudo ss -lntH | awk '{print $4}' | grep -vE '^(127\.|\[::1\]|\[::ffff:127\.)' | sed -E 's/.*:([0-9]+)$/\1/' | sort -un | tr '\n' ' '; echo

Expected output:

22 80 443 8000

Ports 22, 80 and 443 are the public surface. Port 8000 belongs to the Document Server process. It is a compiled binary that binds every interface and offers no setting to change that, so the image closes the port with a host firewall instead. ufw runs with a default-deny inbound policy and exactly three allow rules:

sudo ufw status verbose | grep -E '^(Status|Default)|ALLOW IN'

Expected output:

Status: active Default: deny (incoming), allow (outgoing), disabled (routed) 22/tcp ALLOW IN Anywhere 80/tcp ALLOW IN Anywhere 443/tcp ALLOW IN Anywhere 22/tcp (v6) ALLOW IN Anywhere (v6) 80/tcp (v6) ALLOW IN Anywhere (v6) 443/tcp (v6) ALLOW IN Anywhere (v6)

Every backend sits on loopback: MySQL on 3306, Redis on 6379, RabbitMQ on 5672, OpenSearch on 9200, the Document Server's nginx on 8083, the DocSpace router on 8092 and the individual DocSpace services on 5000 to 5158, 8080, 8888, 9090, 9834, 9899 and 9999:

sudo ss -lntH | awk '{print $4}' | grep -E ':(3306|6379|5672|9200|8083|8092|5011|9899|9090)$' | sort -u

Expected output:

127.0.0.1:3306 127.0.0.1:5011 127.0.0.1:5672 127.0.0.1:6379 127.0.0.1:8083 127.0.0.1:8092 127.0.0.1:9899 [::1]:9200 [::ffff:127.0.0.1]:9090 [::ffff:127.0.0.1]:9200

The passwords in the credentials file are the live ones, and none of the backends answers without them:

MYSQL_PASSWORD=$(sudo grep '^MYSQL_PASSWORD=' /root/onlyoffice-docspace-credentials.txt | cut -d= -f2-)
REDIS_PASSWORD=$(sudo grep '^REDIS_PASSWORD=' /root/onlyoffice-docspace-credentials.txt | cut -d= -f2-)
mysql -uonlyoffice -p"${MYSQL_PASSWORD}" -N -e 'SELECT COUNT(*) AS tables_in_onlyoffice FROM information_schema.tables WHERE table_schema="onlyoffice"' 2>/dev/null redis-cli -a "${REDIS_PASSWORD}" --no-auth-warning ping redis-cli ping 2>&1 | grep -o NOAUTH

Expected output (the table count grows with upgrades):

86 PONG NOAUTH

The Document Server only accepts editing sessions signed with this VM's JWT secret, and DocSpace signs every one with the same value:

JWT=$(sudo grep '^JWT_SECRET=' /root/onlyoffice-docspace-credentials.txt | cut -d= -f2-)
DS=$(sudo jq -r '.services.CoAuthoring.secret.inbox.string' /etc/onlyoffice/documentserver/local.json)
APP=$(sudo jq -r '.files.docservice.secret.value' /etc/onlyoffice/docspace/appsettings.community.json) [ "${JWT}" = "${DS}" ] && [ "${JWT}" = "${APP}" ] && echo "DocSpace and Document Server share this VM's JWT secret" || echo "MISMATCH"

Expected output:

DocSpace and Document Server share this VM's JWT secret

Using your own domain and a trusted certificate

Point an A record at the VM's public IP, open port 80 in your network security group for the certificate challenge, then let the ONLYOFFICE tool obtain a Let's Encrypt certificate. The tool rewrites the OpenResty front door in the same layout this image uses and sets the DocSpace portal address to your domain:

sudo docspace-ssl-setup you@example.com docspace.your-domain.example

For a certificate you already hold, use the file form instead:

sudo docspace-ssl-setup --file docspace.your-domain.example /path/to/fullchain.pem /path/to/privkey.pem

Both forms replace the SecureAnyCloud front door configuration with the upstream one. Nothing is lost, because the setup gate is no longer needed once the owner exists. The per-VM self-signed certificate remains at /etc/sac/onlyoffice-docspace/tls/ if you want to return to it.

Updating DocSpace

The ONLYOFFICE, OpenSearch, OpenResty and Node.js repositories stay configured, so DocSpace and the Document Server update with apt. Operating system security updates are applied automatically by unattended-upgrades.

sudo apt-get update
sudo apt-get install --only-upgrade docspace onlyoffice-documentserver

If an upgrade re-runs docspace-configuration, it restores the ONLYOFFICE plain HTTP proxy layout. Put the TLS front door back with:

sudo cp /etc/sac/onlyoffice-docspace/onlyoffice-proxy.conf.sac /etc/openresty/conf.d/onlyoffice-proxy.conf
sudo systemctl restart openresty

Upgrading OpenSearch

OpenSearch needs one extra step, because its Debian package ships opensearch.yml and jvm.options as ordinary files rather than as configuration files that dpkg protects. An apt upgrade therefore overwrites both, restores the bundled security plugin, and leaves the ingest-attachment plugin built for the previous version. The node then either refuses the DocSpace plain HTTP client or does not start at all. After any OpenSearch upgrade, re-apply the ONLYOFFICE OpenSearch settings, exactly as docspace-configuration does:

sudo systemctl stop opensearch
sudo sed -i '/^plugins\.security\./,/^[^ ]/d' /etc/opensearch/opensearch.yml
sudo /usr/share/opensearch/bin/opensearch-plugin remove opensearch-security
sudo /usr/share/opensearch/bin/opensearch-plugin remove ingest-attachment
sudo /usr/share/opensearch/bin/opensearch-plugin install -b ingest-attachment
sudo systemctl start opensearch

Confirm it came back with curl -s http://127.0.0.1:9200/ | head, which should print the node's name and the OpenSearch version.

Backups

DocSpace has its own backup and restore under Settings > Backup. It packages the database and the file store together and can copy them to Azure Blob Storage or another S3-compatible target. From the shell, back up the same two things:

MYSQL_PASSWORD=$(sudo grep '^MYSQL_PASSWORD=' /root/onlyoffice-docspace-credentials.txt | cut -d= -f2-) mysqldump -uonlyoffice -p"${MYSQL_PASSWORD}" --single-transaction onlyoffice | gzip > /var/backups/docspace-$(date +%F).sql.gz
sudo tar czf /var/backups/docspace-data-$(date +%F).tar.gz -C /var/www/onlyoffice Data

Server components

Component Version Listens on Purpose

ONLYOFFICE DocSpace Community 3.7.2.577 127.0.0.1:5000 to 5158, 8080, 8888, 9090, 9834, 9899, 9999 Rooms, files, people, login, editor host, sockets, identity, backup, notifications

ONLYOFFICE Docs Community 9.4.0 127.0.0.1:8083 (nginx), 8000 (firewalled) Document, spreadsheet, presentation, form and PDF editors

OpenResty 1.31.1.1 0.0.0.0:80, 0.0.0.0:443, 127.0.0.1:8092 TLS front door, setup gate, application router

MySQL 8.0 127.0.0.1:3306 DocSpace database

Redis 7.0.15 127.0.0.1:6379 Cache and sessions, password protected

RabbitMQ 3.12 127.0.0.1:5672 Event bus between the DocSpace services

OpenSearch 2.19.6 127.0.0.1:9200 Full text search index

ufw Default deny inbound; allows 22, 80 and 443 only

Key files and directories

Path Purpose

/root/onlyoffice-docspace-credentials.txt Per VM credentials and the one time setup link, 0600 root

/etc/onlyoffice/docspace/ DocSpace configuration (appsettings.community.json, systemd.env, redis.community.json, rabbitmq.community.json)

/etc/onlyoffice/documentserver/local.json Document Server configuration, including the JWT secret

/etc/openresty/conf.d/onlyoffice-proxy.conf The TLS front door and setup gate

/etc/sac/onlyoffice-docspace/ Per VM TLS keypair, the armed setup key, and a copy of the front door configuration

/var/www/onlyoffice/Data/ Uploaded documents and room content

/var/log/onlyoffice/docspace/ Per service DocSpace logs

/var/log/onlyoffice/documentserver/ Document Server logs

/var/log/nginx/access-proxy.log Front door access log

Troubleshooting

The address answers 503. First boot has not finished. Watch sudo journalctl -u onlyoffice-docspace-firstboot -f, and allow the services two to three minutes after it completes.

The address answers 403. The setup gate is armed and you have not used the setup link. Open the SETUP_URL from /root/onlyoffice-docspace-credentials.txt, or, if you completed the wizard by other means, run sudo onlyoffice-docspace-setup-gate lift.

A page or the editor shows 502. A backend is still starting. systemctl list-units 'docspace-*' --state=activating shows which one. The identity services are the slowest to start.

A document will not open. Check curl -s http://127.0.0.1/ds-vpath/healthcheck returns true, then sudo journalctl -u ds-docservice -n 50. A JWT mismatch appears in the Document Server log as a token error. The check in Step 10 confirms that both sides share the secret.

I re-ran docspace-configuration and lost HTTPS. Restore the front door as described under "Updating DocSpace".

Support

This image is published and supported by SecureAnyCloud with 24/7 support. Contact sales@secureanycloud.com with your Azure subscription ID and the VM name.

Deploy on Azure

Launch ONLYOFFICE DocSpace on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure