Skip to main content

OnlyOffice on Google Cloud Run

OnlyOffice on Google Cloud Run

ONLYOFFICE Document Server is an open-source collaborative online office suite for real-time co-editing of text documents, spreadsheets, presentations, PDFs, and forms — a self-hosted alternative to Google Docs / Microsoft Office Online. It is not usually opened directly by end users; instead it is embedded by a host application (Nextcloud, ownCloud, Seafile, or a custom integration) via its API and a shared JWT secret. This module deploys ONLYOFFICE Document Server on Cloud Run v2 on top of the App_CloudRun foundation, which provisions and manages the shared Google Cloud infrastructure.

This guide focuses on the cloud services OnlyOffice uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics common to every Cloud Run application — service identity, ingress and load balancing, scaling and concurrency, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_CloudRun foundation guide rather than repeating them here.


What OnlyOffice costs on RAD, and how that compares​

OnlyOffice on RAD's Cloud Run module costs about US$102 a month, with the module fee charged once in RAD credits. Need OnlyOffice to stay up continuously, scale across pods, or run beside other Kubernetes workloads — or see the GKE guide for that option. If you only need it occasionally — a demo, a seasonal project, something you're evaluating — a RAD-managed project can be deleted and restored within 30 days for a handful of credits (under US$1) instead of paying for it to sit idle. See Pause it for free, below. Figures are as at 8 October 2026; sources are listed at the end of this section.

What you pay on RAD​

RAD deploys OnlyOffice, which is open source, so there is no licence fee per user. You pay for three things:

In a Google Cloud project you ownIn a project RAD manages for you
Module fee, once per deployment110 credits (US$11 at the top-up price)99 credits (10% lower)
Build timeAbout 3-6 credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$102 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 32 credits a day, about 960 a month (about US$96 at the top-up price, US$77 at the Scale plan's rate)
Who owns whatYou own the project and its billing; RAD deploys and updates itRAD owns the project, with guardrails, quotas and budget alerts; you get console access, and a minimum purchased balance is held in reserve

10 credits cost US$1 on a one-off top-up, and less on a monthly plan. In a project RAD manages, the database, file server and network are shared by every application in the project, so a second application does not add a second set of them.

Default running cost in your own project (us-central1, Google list prices):

Resource (module default)Per month
Cloud Run, 2x vCPU / 4 GiB (scaleToZero)US$31.53
Cloud SQL for PostgreSQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSDUS$51.02
NFS/cache file server (small VM)US$13.43
Cloud NAT and networkingUS$5
Cloud Storage (add-ons, backups)US$1
Totalabout US$102

How it compares​

OptionPriceWho runs it
ONLYOFFICE DocSpace, StartupFreeONLYOFFICE's own hosted cloud. Up to 3 admins, 2 GB storage, unlimited free users
ONLYOFFICE DocSpace, Business$20/admin/monthONLYOFFICE's own hosted cloud. 250 GB per admin, unlimited rooms
RAD, Cloud Run, your own projectAbout US$102, plus US$11 once per deploymentRAD's automation, in your project
RAD, Cloud Run, a RAD-managed projectAbout 960 credits (US$77–96)RAD
RAD, GKE AutopilotSee the GKE guideRAD

ONLYOFFICE's own DocSpace is priced per admin, not per editing user, which is the fairer comparison to RAD's flat infrastructure cost. For a small team that needs only one or two admins, DocSpace's free Startup tier or its $20/month Business plan can be cheaper in cash than RAD's own-project running cost — the difference is that this module deploys the Document Server you embed into your own application, rather than ONLYOFFICE's bundled workspace, which matters if you're already running a document platform (Nextcloud, ownCloud, a custom app) that only needs the editing engine.

Pause it for free: delete a RAD-managed project, restore it when you need it​

If OnlyOffice runs in a project RAD manages for you, you have a second option that goes well beyond scaling to zero: delete the whole project, and restore it within 30 days for close to nothing. This suits OnlyOffice you only need occasionally — a demo, an evaluation, a seasonal project — far better than running it continuously.

  • How it works. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project. Google does not remove the project immediately: it keeps it, recoverable, for 30 days. Because billing is already unlinked, nothing is charged while it waits. Unlike deleting one module, this does not tear down the database, the VM or the compute resource one by one — the whole project, and everything in it, simply stops.
  • Restoring costs a few credits, not a rebuild. Within 30 days, the project's owner can restore it. RAD asks Google to undelete the project and reattaches its billing account, then asks you to run Update on each deployment to confirm everything came back. Because nothing was individually destroyed, that Update finds the same resources already there — it is a check, not a rebuild, and an Update never charges the module fee again. That costs roughly a handful of credits (under US$1) in total for a typical 2-3-deployment chain.
  • So a month of occasional use can cost a few dollars, not US$102. Deploy OnlyOffice, use it for a while, delete the project. Restore it next time you want it, confirm with Update, and delete it again when you're done. You pay only for the module fee once, the builds, and whatever time OnlyOffice was actually live.
  • What this needs. You must own the project (not a bring-your-own one RAD only manages billing for), and you restore it yourself within the 30 days — after that, Google deletes it for good. Restoring is admitted like creating a new project: your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study and demo use fits). Google says most services are fully working again within 36 hours of a restore.
  • One real gap: nightly backups don't survive. Backups are written to a bucket inside the project, and that bucket is not protected by Cloud Storage's soft-delete, so it is very likely gone as soon as you delete the project — even though the project itself is recoverable for 30 days. If you've customised OnlyOffice and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before you delete. For a default installation with nothing irreplaceable in it, this does not matter.

Pay only while you use it, the other way: delete and redeploy​

The option above only applies to a RAD-managed project; in your own project, or once the 30-day window has passed, the way to stop paying is to delete the deployment and deploy it again when you need it.

  • What a redeploy costs. The module fee again plus the builds: about 115 credits (US$11.50) in your own project, or 104 credits in a RAD-managed one. Deleting saves money once OnlyOffice would otherwise sit unused for about 3 days or more in your own project (about US$3.40 a day), or about 3 days or more in a RAD-managed one (32 credits a day).
  • Most of the running cost is usually the database and any shared file/cache VM. They stop only when nothing else in the project uses them, so deleting OnlyOffice while something else shares the project saves only this app's own compute part.
  • Keep your data first. Nightly backups go to a bucket inside the deployment and are deleted with it, so copy the latest backup out before deleting if you want to keep it.

Lab sessions and Managed Environments​

  • Lab sessions, for training. A trainer runs a session for a class. Each participant gets OnlyOffice in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place, or each participant pays for their own. Everything is deleted when the session ends and unused credits go back to the trainer.
  • Managed Environments, for consultancies. A partner runs OnlyOffice for a client from a ring-fenced wallet it funds, and settles with the client directly. If the wallet runs low, billing pauses and the data is kept, so nobody receives an unexpected charge. At the end the partner hands the project over and the deployments become the client's own.
  • Credits can be bought in more than 20 currencies, including XAF, XOF, NGN, GHS, KES and ZAR, by card, bank transfer or mobile money.

Sources (8 October 2026): Google Cloud list prices from the Cloud Billing Catalog API; Delete and restore projects for the 30-day recovery window and what it says about Cloud Storage objects without soft delete; RAD fees and the daily-credit estimates from radmodules.dev/pricing; ONLYOFFICE DocSpace pricing. Prices change; check each source before relying on a figure.

1. Overview​

The onlyoffice/documentserver image is "batteries included": it bundles its own converters, nginx, and RabbitMQ (AMQP) under supervisord. This module builds a thin custom wrapper around it and externalizes PostgreSQL (Cloud SQL) and Redis; the bundled RabbitMQ stays internal on localhost.

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2Custom-built container, 2 vCPU / 4 GiB by default, serverless autoscaling; scale-to-zero supported
DatabaseCloud SQL for PostgreSQL 15Required — a plan-time guard rejects MySQL and every other engine
Cache / editing stateExternal RedisMandatory — a plan-time guard rejects enable_redis = false; defaults to the co-located NFS-VM Redis when redis_host is blank
File persistenceCloud Filestore (NFS)Enabled by default; shared attachment/document storage across instances, mounted at /opt/onlyoffice/storage
Object storageCloud StorageTwo buckets by default: a storage bucket declared by OnlyOffice_Common, plus a data bucket via storage_buckets (both gated by create_cloud_storage, which defaults true here since Cloud Run has no block-PVC option)
SecretsSecret ManagerAuto-generated 48-character JWT_SECRET; database password managed separately
IngressCloud Run URL / Cloud Load BalancingDefault run.app URL; optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • PostgreSQL 15 is mandatory. A cross-variable plan-time guard in this module's validation.tf rejects any database_type other than POSTGRES_13/14/15/NONE — MySQL and SQL Server are not supported by Document Server.
  • Redis is mandatory, not optional. A plan-time precondition fails the deployment if enable_redis = false. With redis_host left blank, enable_nfs must stay true so the co-located NFS-VM IP can serve as the default Redis host.
  • NFS is enabled by default (enable_nfs = true, unlike most other Cloud Run modules), because it doubles as shared attachment storage and the default Redis endpoint source.
  • JWT_SECRET is generated once and must never be rotated after any host application (Nextcloud, ownCloud, a custom integration) has been configured to embed the editor — rotating it breaks the trust between Document Server and every integration until all of them are updated with the new value.
  • Memory floor is 4Gi, not the platform's usual 512Mi–2Gi. The bundled Postgres-client/Redis-client/RabbitMQ/nginx/converter stack under supervisord is heavy and needs the headroom.
  • cpu_always_allocated defaults to false (cost-first, request-based billing). The core editing/conversion work runs in-request, so a cold start is survivable, but the bundled document-cache warmth and internal RabbitMQ conversion queue reset on every cold start. Set true (with min_instance_count >= 1) for an always-warm editor.
  • The image is custom-built, not prebuilt. container_image_source = "custom" wraps the Docker Hub onlyoffice/documentserver image with a cloud-entrypoint.sh that maps the Foundation's DB_*/REDIS_HOST variables onto Document Server's own convention. application_version = "latest" is pinned to 8.3.3 at build time via an app-specific ONLYOFFICE_VERSION build ARG (the Foundation's injected APP_VERSION is deliberately not used, since it would otherwise win the merge).
  • Health checks target /healthcheck, unauthenticated, with a generous first-boot budget (90s initial delay, up to 40 failures) because the bundled stack is slow to become ready.

2. Google Cloud Services & How to Explore Them​

All commands assume PROJECT and REGION are set. Service and resource names are reported in the deployment Outputs.

A. Cloud Run — the OnlyOffice service​

OnlyOffice Document Server runs as a single Cloud Run v2 service (the custom-built wrapper image) that autoscales by request load between the minimum and maximum instance counts. Each deployment creates an immutable revision.

  • Console: Cloud Run → select the service for revisions, traffic, logs, and metrics.
  • CLI:
    gcloud run services list --project "$PROJECT" --region "$REGION"
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION"
    gcloud run revisions list --service <service-name> --project "$PROJECT" --region "$REGION"

See App_CloudRun for scaling, concurrency, execution environment, and traffic splitting.

B. Cloud SQL for PostgreSQL 15​

OnlyOffice stores document metadata, versions, and application state in a managed Cloud SQL for PostgreSQL 15 instance. The service connects privately through the Cloud SQL Auth Proxy over a Unix socket; no public IP is exposed. On first deploy the built-in db-init job creates the application role, database, and grants — the Document Server then installs its own schema on first boot.

  • Console: SQL → select the instance for connections, backups, flags, metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql instances describe <instance-name> --project "$PROJECT"
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

The instance name, database, user, and password secret are in the Outputs. See App_CloudRun for the connection model, backups, and password rotation.

C. External Redis & Cloud Filestore (NFS)​

Redis holds session/editing state that must be shared across every OnlyOffice instance — the bundled RabbitMQ stays internal, but Redis is externalized and mandatory (a plan-time guard fails the deployment if enable_redis = false). With redis_host left blank, the Foundation injects the co-located NFS-VM Redis IP (enable_nfs must stay true in that case); set redis_host explicitly to point at a different Redis instance. Cloud Filestore (NFS) is enabled by default and mounted at /opt/onlyoffice/storage for shared attachment/document storage across instances — unlike the GKE variant there is no block PVC option, since Cloud Run instances are stateless and ephemeral.

  • Console: Compute Engine → VM instances (the NFS/Redis co-located VM); Filestore → Instances.
  • CLI:
    redis-cli -h <redis-host> ping
    # Confirm the resolved Redis/DB env vars in the running revision:
    gcloud run services describe <service-name> --region "$REGION" \
    --format='value(spec.template.spec.containers[0].env)'

See App_CloudRun for the NFS-VM discovery model and the Redis-host-falls-back-to-NFS-IP convention.

D. Cloud Storage​

Two buckets are provisioned by default: a storage bucket declared by OnlyOffice_Common (for the app's own storage needs) and a data bucket from this module's own storage_buckets default — both gated by create_cloud_storage, which defaults true here (unlike the GKE variant, which defaults it false because persistence there lives on a block PVC + NFS instead).

  • Console: Cloud Storage → Buckets.
  • CLI:
    gcloud storage buckets list --project "$PROJECT" --filter="name~onlyoffice"

See App_CloudRun for GCS Fuse and CMEK options.

E. Secret Manager​

One OnlyOffice-specific secret is generated automatically and stored in Secret Manager: JWT_SECRET (48 characters, no special characters), which signs every internal Document Server API request and must be presented by any host application that embeds the editor. The database password is managed separately by the foundation.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~onlyoffice-jwt-secret"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

See App_CloudRun for injection and rotation details.

F. Networking & ingress​

The service is reachable at its run.app URL by default. Because Document Server is typically called by a host application's own backend (not directly by end users), keep ingress_settings = "all" unless every caller is inside the VPC. An external HTTPS load balancer with a custom domain, Cloud CDN, and Cloud Armor can be layered on.

  • Console: Cloud Run (service URL); Network services → Load balancing.
  • CLI:
    gcloud run services describe <service-name> --region "$REGION" --format='value(status.url)'
    gcloud compute addresses list --project "$PROJECT"

See App_CloudRun.

G. Cloud Logging & Monitoring​

Container logs flow to Cloud Logging; Cloud Run and Cloud SQL metrics flow to Cloud Monitoring, with optional uptime checks and alert policies.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud run services logs read <service-name> --project "$PROJECT" --region "$REGION" --limit 50

3. OnlyOffice Application Behaviour​

  • First-deploy database setup, no separate migration job. The built-in db-init job runs using postgres:15-alpine. It resolves the Cloud SQL host (the Auth Proxy Unix-socket directory, falling back to the instance private IP), waits for PostgreSQL to be reachable, creates/updates the application role with the generated password, creates the application database, and grants full privileges — it only provisions the role/database/grants. The Document Server installs its own schema on first boot, so there is no separate migration step. The job is safe to re-run (execute_on_apply = true).
  • JWT_SECRET is immutable after integrations are wired up. Generated once (48 characters) and written to Secret Manager. JWT_ENABLED = "true", JWT_HEADER = "Authorization", JWT_IN_BODY = "true" are set automatically by OnlyOffice_Common. Rotating the secret invalidates trust with every host application embedding the editor until each is reconfigured with the new value.
  • DB and Redis env-var mapping happens in the baked cloud-entrypoint.sh. It sets DB_TYPE = "postgres" and DB_PWD from the injected DB_PASSWORD (DB_HOST/DB_PORT/DB_NAME/DB_USER already match Document Server's own names), and maps REDIS_HOST/REDIS_PORT/REDIS_AUTH onto REDIS_SERVER_HOST/REDIS_SERVER_PORT/REDIS_SERVER_PASS before exec-ing the upstream /app/ds/run-document-server.sh. Because this logic is baked into the custom image, an edit to cloud-entrypoint.sh needs a rebuild to take effect.
  • Cloud-Run-only vendor bug, patched at build time. On Cloud Run, DB_HOST is a Cloud SQL Auth Proxy Unix-socket directory (/cloudsql/<instance>), which is fine for the real DB connection — but the upstream run-document-server.sh has its own separate readiness gate, waiting_for_connection(), that unconditionally runs nc -z "$DB_HOST" "$DB_PORT". nc cannot resolve a filesystem path as a TCP host, so unpatched this loops forever (Waiting for connection to the /cloudsql/... host on port 5432 repeating in Cloud Logging) and the container never becomes Ready. The module's Dockerfile sed -i patches that gate to short-circuit successfully when $1 is an existing directory, leaving the original nc check unchanged for real TCP hosts — so GKE (whose Auth Proxy sidecar listens on 127.0.0.1) is unaffected and needs no patch. A grep -q assertion right after the sed fails the Cloud Build loudly if a future ONLYOFFICE_VERSION bump changes the upstream script's wording — see modules/OnlyOffice_Common/scripts/Dockerfile.
  • No traditional sign-up flow. Document Server is not usually opened directly by end users — it is embedded via API calls from a host application (Nextcloud, ownCloud, a custom integration) using the shared JWT secret. There is no admin account to create on first boot; readiness is confirmed via /healthcheck and by the host application successfully opening a document for co-editing.
  • Health path. Startup and liveness probes target /healthcheck — the Document Server endpoint that returns true only once nginx and the document services are up and the database is reachable, served unauthenticated. Allow several minutes on first boot (90-second initial delay, 15-second period, up to 40 failures — roughly 10 minutes of headroom while the bundled stack comes up and the schema installs).
  • WOPI is off by default. WOPI_ENABLED = "false"; enable it via environment_variables only when integrating with a WOPI host (e.g. SharePoint).
  • Inspect job execution and running config:
    gcloud run jobs list --project "$PROJECT" --region "$REGION"
    gcloud run jobs executions list --job <job-name> --project "$PROJECT" --region "$REGION"
    gcloud run services describe <service-name> --region "$REGION" \
    --format='value(spec.template.spec.containers[0].env)'

4. Configuration Variables​

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for OnlyOffice are listed; every other input is inherited from App_CloudRun with its standard behaviour.

Group 1 — Project & Identity​

VariableDefaultDescription
project_id(required)Target Google Cloud project.
regionus-central1Region for the service and regional resources.

Group 2 — Deployment Environment​

VariableDefaultDescription
tenant_iddemoShort suffix that makes resource names unique per environment.
support_users[]Emails granted project access and monitoring alerts.
resource_labels{}Labels applied to all resources.

Group 3 — Application Identity​

VariableDefaultDescription
application_nameonlyofficeBase name for resources. Do not change after first deploy.
display_nameONLYOFFICE Document ServerHuman-readable name shown in the Console.
description(set)Service description.
application_versionlatestDocument Server image tag; latest is pinned to 8.3.3 at build time via the ONLYOFFICE_VERSION build ARG.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
container_image_sourcecustomAlways custom — wraps the Docker Hub onlyoffice/documentserver image with the cloud entrypoint.
container_image""Leave blank to use the built custom image.
cpu_limit2000mCPU per instance.
memory_limit4GiMemory per instance; the bundled stack needs at least 4Gi.
cpu_always_allocatedfalseCost-first, request-based billing. Trade-off: document-cache warmth and the internal RabbitMQ conversion queue reset on cold start. Set true (+ min_instance_count >= 1) for an always-warm editor.
min_instance_count / max_instance_count0 / 5Pod/instance replica bounds.
container_port80Document Server's bundled nginx listens on port 80.
execution_environmentgen2Gen2 required for NFS and GCS Fuse mounts.
timeout_seconds300Maximum request duration (0–3600 seconds).
enable_cloudsql_volumetrueCloud SQL Auth Proxy for socket connections.
enable_image_mirroringtrueAlways true — mirrors the Docker Hub base image into Artifact Registry before the custom build.
container_build_configbuild the wrapper imageDockerfile/build-arg configuration; build_args sets ONLYOFFICE_VERSION (see Overview).
traffic_split[]Split traffic across revisions for staged rollouts.
container_protocolhttp1HTTP protocol version.
cloudsql_volume_mount_path/cloudsqlAuth Proxy socket directory.
additional_services / additional_containers[]Not used by this module — inert unless explicitly configured.
max_revisions_to_retain7Declared for convention parity; not referenced by this module's deployment.

Group 5 — Access & Ingress Control​

VariableDefaultDescription
ingress_settingsallKeep all unless every caller of the Document Server API is inside the VPC.
vpc_egress_settingPRIVATE_RANGES_ONLYRoute only RFC 1918 traffic via VPC.
enable_iapfalseRequire Google sign-in. Blocks host-application API calls if enabled.
iap_authorized_users / iap_authorized_groups[]Who may access through IAP.
network_name""VPC network to use; auto-discovers a single Services_GCP-managed network.

Group 6 — Environment Variables & Secrets​

VariableDefaultDescription
environment_variables{}Extra non-secret settings. DB_TYPE, JWT_ENABLED, JWT_HEADER, JWT_IN_BODY, WOPI_ENABLED are set automatically — do not override JWT_ENABLED/JWT_HEADER/JWT_IN_BODY here.
secret_environment_variables{}Map of env var → Secret Manager secret name.
explicit_secret_values{}Raw sensitive values written directly to Secret Manager at plan time.
secret_propagation_delay30Seconds to wait after secret creation before proceeding.
secret_rotation_period2592000sSecret Manager rotation notification frequency.
module_writable_secret_ids{}Not used by this module (no post-install hook writes secrets back).

Group 7 — Backup & Restore​

VariableDefaultDescription
backup_schedule0 2 * * *Automated backup cron (UTC).
backup_retention_days7Retention; raise for production/compliance.
enable_backup_import / backup_source / backup_file / backup_formatrestore optionsRestore from a backup on deploy.

Group 8 — CI/CD & Binary Authorization​

Standard App_CloudRun Cloud Build / Cloud Deploy integration — see App_CloudRun. Key inputs: enable_cicd_trigger, github_repository_url, github_token, enable_cloud_deploy, enable_binary_authorization.

Group 9 — Custom SQL Scripts​

enable_custom_sql_scripts, custom_sql_scripts_bucket, custom_sql_scripts_path, custom_sql_scripts_use_root — run SQL from a GCS bucket after provisioning. Not used by the default OnlyOffice deployment (schema installation is handled by the Document Server itself). See App_CloudRun.

Group 10 — Load Balancer, CDN & Image Retention​

VariableDefaultDescription
enable_cloud_armorfalseProvision Global HTTPS LB + Cloud Armor WAF.
admin_ip_ranges[]CIDR ranges exempted from WAF rules.
application_domains[]Custom domain names for the HTTPS LB.
enable_cdnfalseEnable Cloud CDN on the HTTPS LB backend.
max_images_to_retain / delete_untagged_images / image_retention_days(set)Artifact Registry cleanup policy.

Group 11 — Storage & Filesystem​

VariableDefaultDescription
create_cloud_storagetrueGates both the Common-declared storage bucket and this module's own storage_buckets list. Defaults true here (unlike GKE's false) since Cloud Run has no block-PVC persistence option.
storage_buckets[{ name_suffix = "data" }]Additional GCS bucket(s) beyond the auto-provisioned storage bucket.
enable_nfstrueEnabled by default — shared attachment storage and the fallback Redis host source.
nfs_mount_path/opt/onlyoffice/storageMount path inside the container.
nfs_instance_name / nfs_instance_base_name"" / app-nfsExisting NFS VM to use, or the base name for an inline one.
gcs_volumes[]GCS Fuse volume mounts (requires gen2).
manage_storage_kms_iam / enable_artifact_registry_cmekfalseCMEK options.

Group 12 — Database Backend​

VariableDefaultDescription
database_typePOSTGRES_15Required — a plan-time guard (validation.tf) rejects anything but POSTGRES_13/14/15/NONE. MySQL is not supported.
db_nameonlyofficePostgreSQL database name. Immutable after first deploy.
db_useronlyofficeApplication database user. Password auto-generated in Secret Manager.
database_password_length32Generated password length (16–64).
enable_auto_password_rotation / rotation_propagation_delay_secoffDB password rotation.
application_database_name / application_database_usercrappdb / crappuserFoundation-parity mirror only — this module wires the database through db_name/db_user above, not these; inert unless the module is rewired.

Group 13 — Jobs & Scheduled Tasks​

VariableDefaultDescription
initialization_jobs[]Leave empty to use the built-in db-init job (creates the role/database/grants; the Document Server installs its own schema).
cron_jobs[]Not used — OnlyOffice has no platform-scheduled recurring tasks.

Group 14 — Observability & Health​

VariableDefaultDescription
startup_probeHTTP /healthcheck, 90s delay, 15s period, 40 failuresGenerous first-boot budget for the heavy bundled stack.
liveness_probeHTTP /healthcheck, 120s delay, 30s period, 3 failuresLiveness probe.
startup_probe_config / health_check_configsame path, structured formAlternative service-level probe definitions; startup_probe/liveness_probe take effect by default.
uptime_check_config{ enabled=false, path="/healthcheck" }Cloud Monitoring uptime check; disabled by default.
alert_policies[]Metric alert policies.

Group 21 — Redis Cache & Queue​

VariableDefaultDescription
enable_redistrueRequired — a plan-time guard rejects false.
redis_host""Leave blank to use the co-located NFS-VM Redis IP (requires enable_nfs = true).
redis_port6379Redis port.
redis_auth""Optional Redis auth password (sensitive).

Group 22 — VPC Service Controls & Audit Logging​

VariableDefaultDescription
enable_vpc_scfalseEnforce a VPC-SC perimeter (requires organization_id).
vpc_cidr_ranges / vpc_sc_dry_run(set)Access level CIDRs / dry-run mode.
enable_audit_loggingfalseDetailed Cloud Audit Logs.

5. Outputs​

Returned on a successful deployment — the quickest way to locate and explore the running resources.

OutputDescription
service_nameCloud Run service name.
service_urlDefault run.app URL of the service.
service_locationRegion the service runs in.
stage_servicesStage-specific service URLs (Cloud Deploy).
load_balancer_ip / load_balancer_urlExternal HTTPS load balancer IP / URL (when enabled).
database_instance_nameCloud SQL instance name.
database_name / database_userApplication database name / user.
database_password_secretSecret Manager secret holding the DB password.
database_host / database_portDB endpoint / port.
storage_bucketsCreated Cloud Storage buckets.
network_name / network_exists / regionsVPC network, presence, regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channels / uptime_check_namesMonitoring status, channels, uptime checks.
initialization_jobsNames of the setup jobs (db-init).
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / github_repository_url / github_repository_owner / github_repository_name / cicd_configurationCI/CD status and details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.
audit_logging_enabled / artifact_registry_cmek_enabledAudit logging and CMEK status.

6. Configuration Pitfalls & Sensible Defaults​

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

Inherited plan-time validation. This module passes its configuration through the App_CloudRun foundation engine, which validates values and combinations at plan time. OnlyOffice additionally layers its own cross-variable guards in validation.tf: PostgreSQL-only database_type, mandatory enable_redis, redis_host/enable_nfs coupling, min_instance_count <= max_instance_count, and enable_cloudsql_volume vs database_type = "NONE" consistency. Invalid configuration fails the plan with a clear, named error before any resource is created, so most mistakes below are caught up front rather than at apply or runtime.

SettingSensible valueRiskConsequence if wrong
database_typePOSTGRES_15 (or 13/14)CriticalAny other engine is rejected at plan time — MySQL is not supported by Document Server.
enable_redistrueCriticalA plan-time guard rejects false — without shared Redis, session/editing state cannot be coordinated across instances.
redis_host / enable_nfsLeave redis_host blank only with enable_nfs = trueCriticalBlank redis_host with enable_nfs = false fails at plan time — there is no Redis host to resolve.
JWT_SECRET (auto-generated)Never change after integrations existCriticalRotating it breaks every host application (Nextcloud/ownCloud/etc.) embedding the editor until all are updated with the new value.
db_name / db_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and orphans all data.
enable_backup_importfalse unless restoringCriticalEnabling without a valid backup fails the import job.
memory_limit4GiHighThe bundled Postgres-client/Redis-client/RabbitMQ/nginx/converter stack under supervisord is heavy; undersizing risks OOM during startup or document conversion.
ingress_settingsall (unless all callers are in-VPC)HighDocument Server's API is normally called by a host application's backend; blocking that traffic breaks every embedded-editor integration.
enable_iaponly when no external host application calls the APIHighIAP blocks all unauthenticated requests, including the host application's Document Server API calls.
enable_cloudsql_volumetrue unless database_type = "NONE"HighA plan-time guard rejects the combination enable_cloudsql_volume = true with database_type = "NONE" — the Auth Proxy sidecar would have no instance to connect to.
cpu_always_allocatedfalse (cost-first) or true for an always-warm editorMediumWith false + scale-to-zero, the document-cache and internal RabbitMQ conversion queue reset on every cold start, adding latency to the next editing session.
min_instance_count1 to avoid cold starts on active editing sessionsMediumScale-to-zero (0) adds startup-probe-scale first-request latency after idle, felt by every collaborator opening a document.
create_cloud_storage / storage_bucketsleave defaults unless persistence needs adjustingMediumSetting create_cloud_storage = false also removes the Common-declared storage bucket, since both are gated by the same flag.
backup_retention_days7 (raise for prod)MediumToo short for compliance retention.
enable_cloud_armorenable for productionMediumThe Document Server API is publicly reachable without WAF protection.
ONLYOFFICE_VERSION build ARG (Dockerfile)Bump only after confirming the sed/grep readiness-gate patch still matches upstream wordingHighThe Dockerfile's sed -i patch to run-document-server.sh's waiting_for_connection() (making the Cloud SQL socket-directory DB_HOST short-circuit the nc -z check) is guarded by a build-time grep -q assertion. If a version bump changes the upstream script's exact text, the Cloud Build fails loudly at that step — the fix is to update the sed pattern in modules/OnlyOffice_Common/scripts/Dockerfile, not to skip the check. Left unpatched, the vendor image hangs forever on Cloud Run (repeating Waiting for connection to the /cloudsql/... host on port 5432 in Cloud Logging) because nc can never resolve a Unix-socket directory as a TCP host; GKE is unaffected since its Auth Proxy sidecar listens on a real 127.0.0.1 TCP host.

For the foundation behaviour referenced throughout — service identity, scaling and concurrency, ingress and load balancing, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_CloudRun. OnlyOffice-specific application configuration shared with the GKE variant — the JWT secret, database bootstrap, container image and entrypoint, core application settings, and health probe behaviour — is described in OnlyOffice_Common.

Need RAD to do something it does not do yet? Request it on the roadmap, or vote on what is already there.