Skip to main content

Certification track: Associate Cloud Engineer (ACE) · Professional Cloud Developer (PCD)

WordPress on Google Cloud Run

WordPress on Google Cloud Run

WordPress is the world's most popular content management system, powering over 43% of all websites globally. This module deploys WordPress 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 WordPress 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 WordPress costs on RAD, and how that compares​

Running WordPress on Cloud Run in your own Google Cloud project costs about $83.61/month in Google Cloud charges, on top of a one-off 110-credit RAD module fee charged once at deploy time. WordPress needs a MySQL database and a shared NFS/cache file server for uploads and sessions, which together are most of the $83.61 above. In a RAD-managed project the module fee drops to 99 credits (10% lower) and the running cost is metered hourly in credits instead of billed directly by Google — see Pause it for free below for the one RAD-managed advantage a self-hosted VPS cannot match — or see the GKE guide if you'd rather run it on Kubernetes.

What you pay on RAD​

Own projectRAD-managed project
Module fee (one-off)110 credits99 credits (10% lower)
Build time~3-6 credits per build, either way~3-6 credits per build, either way
Google Cloud running cost$83.61/month, billed by Google at list price~32 credits/day, metered at list price plus RAD's margin

Default running cost in your own project

ResourceUS$/month (Google list price, us-central1)
Cloud Run, 1x vCPU / 2 GiB (scaleToZero)$13.16
Cloud SQL for MySQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSD$51.02
NFS/cache file server (small VM)$13.43
Cloud NAT and networking$5.00
Cloud Storage (add-ons, backups)$1.00
Total$83.61

How it compares​

  • WordPress.com, run by Automattic, is the official hosted version of the same software: its pricing page (checked 8 October 2026) lists Personal at $4/mo, Premium at $8/mo, Business at $25/mo and Commerce at $45/mo on monthly billing (cheaper on annual terms) — all under RAD's $83.61/month running cost, but on a shared multi-tenant platform with plugin/theme restrictions below the Business tier.
  • RAD's module instead gives you a dedicated Cloud Run service, your own Cloud SQL database and full plugin/theme freedom from the start, which is what the extra cost above WordPress.com buys.
  • A bare-VPS alternative also works: a DigitalOcean or Hetzner 2 vCPU/4GB box at about $24/mo, or a GCP Compute Engine e2-standard-2 at about $49/mo, can self-host WordPress and MySQL together — cheaper than either RAD or WordPress.com in cash terms, with none of the managed backups, patching or monitoring either provides.

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

This is the headline advantage of a RAD-managed project, and it costs nothing while paused. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project outright — Google's own 30-day recoverable soft delete. Unlike deleting one module, this does not tear down Cloud SQL, any VM, or the compute resource one by one: the whole project simply stops, and nothing is charged while it waits, because billing is already unlinked.

Restoring, within 30 days and only by the project's owner, 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. This costs only a handful of credits (under US$1) in total for a typical 2-3-deployment chain.

What this needs: you must own the project (not one RAD only manages billing for), you must restore it yourself within 30 days — after that Google deletes it for good — and restoring is admitted like creating a new project, so your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study/demo use fits). Google says most services are fully working again within 36 hours of a restore.

One real gap: nightly backups are written to a bucket inside the project, and that bucket has Cloud Storage's soft-delete explicitly turned off, 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 WordPress and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before deleting. For a default install with nothing irreplaceable in it, this does not matter.

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

In your own project, or once 30 days have passed on a RAD-managed one, there is no free pause — deleting removes the resources for good, and bringing WordPress back means redeploying from scratch. That costs about 113-116 credits (the 110-credit module fee plus a build).

Deleting only saves money once WordPress would otherwise sit unused long enough to clear that redeploy cost against its own running cost — for WordPress, that's about 5 days or more. Most of this running cost is usually the database and any shared file/cache VM — those stop only once nothing else in the project uses them, so deleting this app while something else shares the project saves only its own compute share.

Keep 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 the app 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 the app 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 Billing Catalog API list prices; radmodules.dev/pricing for RAD's own fees and daily-credit estimates; Google's project delete/restore documentation for the pause/restore claims. WordPress.com plan prices from wordpress.com/pricing, checked 8 October 2026.

1. Overview​

WordPress runs as a PHP/Apache container on Cloud Run v2. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2PHP/Apache service, 1 vCPU / 2 GiB by default, request-based autoscaling
DatabaseCloud SQL for MySQL 8.0Required — WordPress does not support PostgreSQL
Shared filesFilestore (NFS)wp-content directory (uploads, plugins, themes) shared across all instances
Object storageCloud StorageA dedicated wp-uploads media bucket
CacheRedisOptional object cache; enabled by default to reduce database load
SecretsSecret ManagerAuto-generated database password and eight WordPress authentication keys and salts
IngressCloud Run URL / Cloud Load BalancingDefault run.app URL, optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • MySQL 8.0 is mandatory. Selecting PostgreSQL or NONE breaks startup.
  • NFS is required for a functional site. WordPress stores uploaded media, installed plugins, and active themes under wp-content/. Without a shared NFS volume, each Cloud Run revision wipes all plugins, themes, and uploads — making WordPress on Cloud Run non-functional for any real site.
  • The startup probe is TCP, not HTTP. WordPress may not yet respond to HTTP requests during database initialisation on first boot; a TCP probe only checks that Apache's port is open.
  • WP_HOME and WP_SITEURL are auto-set from the predicted Cloud Run service URL (CLOUDRUN_SERVICE_URL), so WordPress generates correct absolute links and avoids redirect loops.
  • Database migrations run on each instance start via the db-init job; version upgrades apply schema changes automatically.
  • The WordPress authentication keys and salts are auto-generated and stored in Secret Manager; you never set them in plain text.
  • Cloud Run gen2 is required for NFS volume mounts.

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 WordPress service​

WordPress runs as a Cloud Run v2 service that autoscales by request load between the minimum and maximum instance counts. Each deployment creates an immutable revision; traffic can be split across revisions for safe rollouts.

  • 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 MySQL 8.0​

WordPress stores all site data (posts, users, settings, comments) in a managed Cloud SQL for MySQL 8.0 instance. The service connects privately through the Cloud SQL Auth Proxy over a Unix socket (no public IP). On first deploy an initialisation Job creates the application database and user.

  • 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> --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. Filestore (NFS) and Cloud Storage​

WordPress's wp-content directory is mapped onto a Filestore (NFS) share mounted into the service so all instances share the same plugins, themes, and uploaded media. A dedicated Cloud Storage bucket (wp-uploads) is also provisioned for media assets.

  • Console: Filestore → Instances; Cloud Storage → Buckets.
  • CLI:
    gcloud filestore instances list --project "$PROJECT"
    gcloud storage buckets list --project "$PROJECT"
    gcloud storage ls gs://<media-bucket>/ # bucket name is in the Outputs

See App_CloudRun for the NFS mount, GCS Fuse, and CMEK.

D. Redis object cache​

Redis backs WordPress's object cache via the WP Redis plugin, storing the results of expensive database queries in memory. When redis_host is left empty and NFS is enabled, the NFS server IP is used as the Redis endpoint (the default shared deployment model).

  • Console: Memorystore → Redis (if using a managed instance).
  • CLI:
    redis-cli -h <redis-host> ping
    redis-cli -h <redis-host> info keyspace

E. Secret Manager​

The WordPress database password and the eight WordPress authentication keys and salts are stored in Secret Manager and injected into the service at runtime; plaintext values never appear in Terraform state.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT"
    # List all secrets belonging to this deployment:
    gcloud secrets list --project "$PROJECT" --filter="name~<resource-prefix>"
    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. An external HTTPS load balancer with a custom domain, Cloud CDN, and Cloud Armor can be layered on; ingress settings and VPC egress control connectivity.

  • 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. WordPress Application Behaviour​

  • First-deploy database setup. An initialisation Job using the mysql:8.0-debian image creates the WordPress database and user before the service starts. It runs on every tofu apply because it is idempotent — it safely skips steps that are already complete.

  • Authentication keys and salts. Eight 64-character WordPress security secrets (auth key, secure auth key, logged-in key, nonce key, and their corresponding salts) are generated automatically on first deploy and stored in Secret Manager. Rotating these secrets immediately invalidates all active browser sessions — every logged-in user will be signed out.

  • Site URL auto-resolution. CLOUDRUN_SERVICE_URL is always injected by the foundation with the correct Cloud Run URL. wp-config-docker.php reads this to set WP_HOME and WP_SITEURL so WordPress generates correct absolute links and avoids redirect loops behind Cloud Run.

  • PHP configuration baked at build time. php_memory_limit, upload_max_filesize, and post_max_size are applied to the container image at Cloud Build time. Changing them triggers a new image build and revision.

  • Health probe design. The TCP startup probe confirms Apache is listening before HTTP checks begin; the high failure_threshold (20 × 15 s = 300 s) accommodates the db-init job and WordPress's initialisation phase. The liveness probe polls /wp-admin/install.php — which returns HTTP 200 whether WordPress is freshly installed or already configured — with a 300-second initial delay.

  • WordPress scheduled tasks. Cloud Run is invoked on-demand, so wp-cron pseudo-cron may not fire on schedule if there is no traffic. For reliable scheduled execution, disable wp-cron via environment_variables and configure a cron_jobs entry:

    gcloud run jobs list --project "$PROJECT" --region "$REGION"
    gcloud run jobs executions list --job <job-name> --project "$PROJECT" --region "$REGION"

4. Configuration Variables​

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for WordPress 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_namewordpressBase name for resources. Do not change after first deploy.
display_nameWordpressFriendly name shown in the Console. Note: this module uses display_name (not application_display_name).
descriptionWordpress CMS on Cloud RunService description.
application_versionlatestWordPress image version tag. Use a pinned version (e.g. 6.7.1) in production.
php_memory_limit512MPHP memory_limit baked at build time. Increase for heavy plugin workloads.
upload_max_filesize64MMaximum size of a single file upload. Must be ≤ post_max_size.
post_max_size64MMaximum size of all POST data. Must be ≥ upload_max_filesize.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
cpu_limit1000mCPU per instance.
memory_limit2GiMemory per instance; 2 GiB recommended for WordPress with plugins.
min_instance_count0Minimum instances (scale-to-zero by default). Set to 1 to eliminate cold starts.
max_instance_count1Maximum instances. Increase only after verifying all plugins handle concurrent access correctly and NFS is enabled.
container_port80WordPress/Apache listens on port 80.
enable_cloudsql_volumetrueCloud SQL Auth Proxy for socket connections. Required.
execution_environmentgen2Cloud Run gen2 is required for NFS mounts.
traffic_split[]Split traffic across revisions for staged rollouts.
max_revisions_to_retain7How many old revisions to keep.

Group 5 — Access & Ingress Control​

VariableDefaultDescription
enable_iapfalseRequire Google sign-in via Identity-Aware Proxy.
iap_authorized_users / iap_authorized_groups[]Who may access through IAP.
ingress_settingsallWhich networks may reach the service. Consider internal-and-cloud-load-balancing when using Cloud Armor.
vpc_egress_settingPRIVATE_RANGES_ONLYHow outbound traffic is routed through the VPC connector.

Group 6 — Environment Variables & Secrets​

VariableDefaultDescription
environment_variables{}Extra non-secret settings. WORDPRESS_TABLE_PREFIX, WORDPRESS_DEBUG, and Redis vars are set automatically.
secret_environment_variables{}Map of env var → Secret Manager secret name. Eight WordPress auth secrets are injected automatically.
secret_propagation_delay / secret_rotation_period(set)Replication wait / rotation cadence.

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_uri / backup_formatrestore optionsRestore from a backup on deploy. Note: this module uses backup_uri (full GCS URI or Drive file ID).

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. See App_CloudRun.

Group 10 — Domain, CDN, Cloud Armor & Image Retention​

VariableDefaultDescription
application_domains[]Custom hostnames for the external load balancer.
enable_cdnfalseEnable Cloud CDN on the LB backend. Requires enable_cloud_armor = true.
enable_cloud_armor / admin_ip_rangesoffAttach a WAF policy / restrict privileged access. Strongly recommended for public WordPress sites.
max_images_to_retain / delete_untagged_images / image_retention_days(set)Artifact Registry cleanup policy.

Group 11 — Storage & Filesystem​

VariableDefaultDescription
enable_nfstrueShared Filestore volume for WordPress wp-content (keep enabled).
nfs_mount_path/var/www/html/wp-contentMount path inside the container. The startup script symlinks wp-content here.
create_cloud_storage / storage_buckets / gcs_volumes(set)Media bucket / additional buckets / GCS Fuse mounts.
manage_storage_kms_iam / enable_artifact_registry_cmekfalseCMEK options.

Group 12 — Database Backend​

VariableDefaultDescription
database_typeMYSQL_8_0Fixed — do not change. WordPress requires MySQL.
db_namewpDatabase name. Immutable after first deploy. Note: this module uses db_name (not application_database_name).
db_userwpApplication user. Immutable after first deploy. Note: this module uses db_user (not application_database_user).
database_password_length32Generated password length (16–64).
enable_auto_password_rotation / rotation_propagation_delay_secoffDB password rotation.
db_host_env_var_name / db_name_env_var_name / db_user_env_var_name / db_port_env_var_name / service_url_env_var_name""Additional env var names for connection details.

Group 13 — Jobs & Scheduled Tasks​

VariableDefaultDescription
initialization_jobs[]Leave empty to use the built-in db-init job.
cron_jobs[]Recurring Cloud Run Jobs. Use to replace wp-cron for reliable scheduled task execution.

Group 14 — Observability & Health​

VariableDefaultDescription
startup_probeTCP, 30s delay, threshold 20TCP startup probe — avoids HTTP failures during database initialisation. Do not reduce failure_threshold below 10.
liveness_probeHTTP /wp-admin/install.php, 300s delay300-second initial delay accommodates first-boot database setup.
uptime_check_configdisabled, path /Cloud Monitoring uptime check.
alert_policies[]Metric alert policies.

Group 21 — Redis Cache​

VariableDefaultDescription
enable_redistrueUse Redis for WordPress object caching.
redis_host""Leave empty to use the NFS server IP; set explicitly for a dedicated Memorystore instance.
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 (sensitive).
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.
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).

SettingSensible valueRiskConsequence if wrong
database_typeMYSQL_8_0CriticalWordPress requires MySQL; PostgreSQL/NONE breaks startup.
enable_nfstrueCriticalWithout NFS, every new Cloud Run revision wipes all plugins, themes, and media uploads — WordPress is non-functional for any real site.
db_name / db_userset onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all WordPress data.
enable_backup_importfalse unless restoringCriticalEnabling without a valid backup_uri fails the import job.
execution_environmentgen2HighNFS mounts require Cloud Run gen2; switching to gen1 causes a volume mount error and service startup failure.
container_image_sourcecustomHighThe custom WordPress image wires the NFS symlink and Cloud SQL socket. Using prebuilt with the vanilla WordPress image breaks Cloud SQL socket connectivity.
nfs_mount_path/mnt/nfs (do not change after deploy)HighThe startup script symlinks wp-content to this path; changing it after deployment breaks the symlink.
startup_probeTCP (default)HighAn HTTP probe may fail during first-boot database initialisation. Do not reduce failure_threshold below 10.
memory_limit2GiHighWordPress with popular plugins (WooCommerce, Elementor) requires at least 2 GiB; insufficient memory causes PHP fatal errors.
enable_redistrueMediumMultiple instances with isolated in-memory caches cause redundant database queries.
redis_host"" (NFS IP) or explicitHighNo valid Redis endpoint if Redis is on, NFS is off, and no host is set.
enable_cloud_armorenable for public sitesHighWordPress login pages (/wp-login.php, xmlrpc.php) are prime brute-force targets.
php_memory_limit512MMediumMust be within memory_limit; setting it higher than the container limit causes an OOM kill instead of a PHP error.
min_instance_count1Medium0 causes cold-start delays and may cause visible errors for the first visitor after idle.
backup_retention_days7 (raise for prod)MediumToo short for e-commerce or content-heavy sites.
enable_iap / enable_cloud_armorenable for admin accessMediumThe WordPress admin panel is otherwise publicly reachable.

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. WordPress-specific application configuration shared with the GKE variant is described in Wordpress_Common.

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