Skip to main content

Certification track: AI Tooling

OpenClaw on Google Cloud Run

OpenClaw on Google Cloud Run

OpenClaw is a multi-tenant AI agent gateway purpose-built for isolated, persistent agent deployments. It lets teams run per-tenant AI assistants backed by Anthropic models, with dedicated GCS workspaces and optional Telegram or Slack channel integration — all without shared state between agents. This module deploys OpenClaw 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 OpenClaw 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 OpenClaw costs on RAD, and how that compares​

OpenClaw on RAD's Cloud Run module costs about US$69 a month, with the module fee charged once in RAD credits. Need OpenClaw 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 OpenClaw, 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 deployment75 credits (US$8 at the top-up price)67.5 credits (10% lower)
Build timeAbout 3-6 credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$69 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 26 credits a day, about 780 a month (about US$78 at the top-up price, US$62 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, 1x vCPU / 1 GiB (scaleToZero)US$11.58
Cloud SQL for PostgreSQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSDUS$51.02
Cloud NAT and networkingUS$5
Cloud Storage (add-ons, backups)US$1
Totalabout US$69

How it compares​

  • No turnkey managed SaaS was verified for OpenClaw itself, so the honest comparison is a self-managed server: a Hetzner CPX22 (2 vCPU/4 GB) costs about $24/month, a DigitalOcean 2 vCPU/4 GB Droplet about $24/month, and a GCP Compute Engine e2-standard-2 (2 vCPU/8 GB) about $49/month.
  • This is a light workload — a cheaper, smaller VPS class than the reference boxes below would also do the job; the figures are shown for a like-for-like comparison.
  • OpenClaw is a bespoke multi-tenant AI agent gateway with no off-the-shelf SaaS equivalent to compare against. The realistic alternative is building the same per-tenant isolation (separate workspaces, secrets, channel integrations) yourself on a VPS or managed Kubernetes, which is materially more engineering effort than RAD's one-click deploy, on top of needing your own managed PostgreSQL.
  • The VPS price is not the whole cost. On a bare VPS you are also the one patching the OS, rotating backups and keeping the database (if any) healthy. RAD's managed Cloud SQL, Secret Manager and monitoring cover that for you, which is the real argument for RAD over a cheaper box — not the sticker price.

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

If OpenClaw 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 OpenClaw 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 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$69. Deploy OpenClaw, 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 OpenClaw 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 OpenClaw 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 80 credits (US$8) in your own project, or 72 credits in a RAD-managed one. Deleting saves money once OpenClaw would otherwise sit unused for about 3 days or more in your own project (about US$2.29 a day), or about 3 days or more in a RAD-managed one (26 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 OpenClaw 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 OpenClaw 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 OpenClaw 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. Prices change; check each source before relying on a figure.

1. Overview​

OpenClaw runs as a Node.js container on Cloud Run v2 (Gen2). The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2 (Gen2)Node.js service, 1 vCPU / 1 GiB by default, CPU always allocated
Workspace storageCloud Storage (GCS Fuse)Per-tenant workspace bucket mounted at /data via GCS Fuse
AI credentialsSecret ManagerAnthropic API key and gateway token always stored; Telegram and Slack secrets optional
IngressCloud Run URL / Cloud Load BalancingPublic (all) by default; optional external HTTPS LB + custom domain
SecretsSecret ManagerAll credentials injected at runtime; plaintext never in config

Sensible defaults worth knowing up front:

  • No database, no Redis. OpenClaw is a stateful Node.js gateway backed entirely by GCS Fuse at /data. Cloud SQL and Redis are never provisioned.
  • CPU is always allocated. cpu_always_allocated = true is required. WebSocket connections and async agent operations break under CPU throttling. Do not set to false.
  • Gen2 execution environment is required. GCS Fuse volume mounts are not available in Gen1 and will silently fail.
  • Custom container image is always built. The module layers an entrypoint.sh onto the upstream ghcr.io/openclaw/openclaw image.
  • GCS workspace at /data is always mounted. A dedicated <prefix>-storage bucket is always provisioned and mounted. Persistent agent state lives here across container restarts.
  • OPENCLAW_STATE_DIR is on local disk. npm staging and the XDG config home are redirected to /tmp/openclaw to avoid GCS Fuse hard-link limitations during startup.
  • min_instance_count = 0 by default (scale-to-zero). Set to 1 for latency-sensitive agent deployments to avoid 15–20 s cold starts.
  • max_instance_count = 1 per tenant. OpenClaw is stateful; multiple instances for the same tenant split state across replicas unless sticky routing is in place.
  • Ingress defaults to all (direct public access). Set ingress_settings = "internal" to restrict the service to VPC traffic when fronting it with an OpenClaw router.

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

OpenClaw runs as a Cloud Run v2 service on the Gen2 execution environment. CPU is always allocated to support WebSocket connections and async agent operations. 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 Storage — GCS Fuse workspace​

All durable agent state is stored in a dedicated Cloud Storage bucket and mounted into the service at /data by GCS Fuse. The workspace layout is:

<prefix>-storage/
├── workspace/ ← agent workspace (/data/workspace)
│ └── skill-library/ ← shared skills repo (when skills_repo_url is set)
├── agents/main/agent/ ← agent state directory
└── ...
  • Console: Cloud Storage → Buckets → select the <prefix>-storage bucket.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"
    gcloud storage ls gs://<prefix>-storage/

See App_CloudRun for the GCS Fuse mount, CMEK options, and bucket lifecycle.

C. Secret Manager — credentials​

The Anthropic API key and the gateway token are always stored in Secret Manager. When Telegram or Slack integration is enabled, the bot tokens and webhook/signing secrets are stored there as well. All credentials are injected into the service at runtime.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT"
    # Retrieve the Anthropic key (initial deploy only; manage via Secret Manager thereafter):
    gcloud secrets versions access latest --secret=<prefix>-anthropic-api-key --project "$PROJECT"
    # Retrieve the gateway token (needed to register clients):
    gcloud secrets versions access latest --secret=<prefix>-gateway-token --project "$PROJECT"

See App_CloudRun for injection and rotation details.

D. Networking & ingress​

The service is reachable at its run.app URL by default, open to public internet traffic (ingress_settings = "all"). Set ingress_settings = "internal" to restrict it to VPC traffic when fronting it with an OpenClaw router. 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.

E. Cloud Logging & Monitoring​

Container logs flow to Cloud Logging; Cloud Run 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. OpenClaw Application Behaviour​

  • No database setup job. OpenClaw requires no Cloud SQL and no init job. The agent state lives entirely on GCS; the first container startup creates the workspace directories automatically via entrypoint.sh.
  • Config regenerated on every startup. entrypoint.sh always rewrites openclaw.json in $OPENCLAW_STATE_DIR, ensuring the Terraform-managed environment variables (API keys, gateway token, channel settings) win over any stale values previously persisted on GCS.
  • Skills repository sync (optional). When skills_repo_url is set, entrypoint.sh performs a shallow clone or update of the repository into /data/workspace/skill-library on every container startup. The sync is non-fatal — the gateway starts even if the clone fails. Check Cloud Logging for skill-library entries to verify sync status.
  • Health path. Startup and liveness probes both target GET /health on port 8080. The startup probe allows ~2 minutes for GCS Fuse mount and Node.js startup.
  • Telegram and Slack. When enable_telegram is set, the bot token is injected as TELEGRAM_BOT_TOKEN. When enable_slack is set, the bot token and the app-level token are injected as SLACK_BOT_TOKEN and SLACK_APP_TOKEN, and the entrypoint connects the agent to Slack over Socket Mode: an outbound WebSocket that needs no public ingress and no router. Slack ships as the separate @openclaw/slack plugin, which the entrypoint installs on each boot. Access is fail-closed: DMs only from the member IDs in SLACK_ALLOW_FROM, channels only from the IDs in SLACK_CHANNELS (mention-gated), both passed through environment_variables. The Telegram webhook secret and the optional Slack signing secret are stored in Secret Manager for a companion router service and are not injected into the agent container.
  • Scale-to-zero and cold starts. With min_instance_count = 0, Telegram/Slack webhook events arriving during a cold start (15–20 s) may be dropped. Set min_instance_count = 1 for production agent deployments.

4. Configuration Variables​

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for OpenClaw 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.
anthropic_api_key(required on first deploy)Anthropic API key. Stored in Secret Manager and injected as ANTHROPIC_API_KEY. Omit on updates to retain the stored value. Sensitive.
gateway_token(auto-generated)Gateway authentication token. A secure 64-character hex token is generated when left blank. Stored in Secret Manager as OPENCLAW_GATEWAY_TOKEN. Sensitive.

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_nameopenclawBase name for resources. Do not change after first deploy.
application_display_nameOpenClaw GatewayFriendly name shown in the Console.
descriptionOpenClaw AI Gateway - Serverless multi-tenant AI agent gateway on Cloud RunService description.
application_versionlatestOpenClaw image tag used as the BASE_IMAGE build arg. Pin to a specific release for reproducible builds.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
cpu_limit1000mCPU per instance.
memory_limit1GiMemory per instance. Sized for light/typical usage (observed ~400Mi peak); raise to 2Gi for heavier concurrent agent sessions.
min_instance_count00 enables scale-to-zero (15–20 s cold start). Set ≥ 1 to eliminate cold starts.
max_instance_count1Keep at 1 per tenant to avoid split-state. Increase only with sticky routing.
container_port8080Port the OpenClaw gateway listens on. Must match the PORT env var.
execution_environmentgen2Gen2 required for GCS Fuse. Do not change to gen1.
cpu_always_allocatedtrueRequired for WebSocket connections and async operations. Do not set to false.
timeout_seconds3600Maximum request duration. Agent sessions are long-running; 3600 s is the maximum.
enable_cloudsql_volumefalseOpenClaw does not use Cloud SQL. Leave false.
traffic_split[]Canary/blue-green traffic allocation. All entries must sum to 100.
max_revisions_to_retain7Old revisions to keep after each deployment.

Group 5 — Access & Ingress Control​

VariableDefaultDescription
ingress_settingsallinternal for VPC-only (recommended behind a router); all for direct public access.
vpc_egress_settingPRIVATE_RANGES_ONLYVPC egress routing.
enable_iapfalseRequire Google sign-in via Identity-Aware Proxy.
iap_authorized_users / iap_authorized_groups[]Who may access through IAP.

Group 6 — Environment Variables & Secrets​

VariableDefaultDescription
environment_variables{}Extra non-secret settings. Module-managed vars (OPENCLAW_STATE_DIR, NODE_ENV, etc.) always take precedence.
secret_environment_variables{}Map of env var → existing Secret Manager secret name. Core credentials are handled automatically.
secret_propagation_delay30Seconds to wait after secret creation before proceeding.
secret_rotation_period2592000sRotation notification frequency (30 days).

Group 7 — Backup & Restore​

VariableDefaultDescription
backup_schedule0 2 * * *Cron for automated workspace backup (UTC).
backup_retention_days7Retention days; raise for production/compliance.
enable_backup_import / backup_source / backup_formatrestore optionsImport a workspace backup on deploy. backup_format defaults to tar.

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 10 — Load Balancer, CDN & Image Retention​

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

Group 11 — Storage & Filesystem​

VariableDefaultDescription
create_cloud_storagetrueProvision additional buckets defined in storage_buckets. The workspace bucket is always created.
storage_buckets[]Additional GCS buckets beyond the auto-provisioned workspace bucket.
enable_nfsfalseOpenClaw uses GCS Fuse for state. NFS is not required and disabled by default.
gcs_volumes[]Additional GCS Fuse mounts. The openclaw-data volume at /data is always appended.
manage_storage_kms_iam / enable_artifact_registry_cmekfalseCMEK options.

Group 13 — Jobs & Scheduled Tasks​

VariableDefaultDescription
initialization_jobs[]OpenClaw has no default init job. Use for custom workspace seeding.
cron_jobs[]Recurring Cloud Run jobs triggered by Cloud Scheduler.

Group 14 — Observability & Health​

VariableDefaultDescription
startup_probe / startup_probe_configHTTP /health, 24-attempt thresholdAllows ~2 minutes for GCS Fuse mount and Node.js startup.
liveness_probe / health_check_configHTTP /healthRestarts the container if the gateway becomes unresponsive.
uptime_check_config{ enabled = false, path = "/health" }Cloud Monitoring uptime check. Disabled by default; enable for production monitoring.
alert_policies[]Metric alert policies.

Group 15 — OpenClaw Configuration​

VariableDefaultDescription
skills_repo_url""GitHub URL of a shared skills repository. Cloned into /data/workspace/skill-library on every container startup. Leave empty to skip.
skills_repo_refmainGit ref (branch, tag, or SHA) to check out.
enable_telegramfalseProvision a Telegram bot token secret and inject TELEGRAM_BOT_TOKEN. Requires telegram_bot_token.
telegram_bot_token""Telegram bot token from @BotFather. Sensitive.
telegram_webhook_secret""Webhook validation secret for the router (not injected into the agent). Generate with openssl rand -hex 32. Sensitive.
enable_slackfalseConnect the agent to Slack over Socket Mode (outbound WebSocket — no ingress or router). Provisions Slack secrets and injects SLACK_BOT_TOKEN + SLACK_APP_TOKEN. Requires slack_bot_token and slack_app_token.
slack_bot_token""Slack bot token (xoxb-...). Sensitive.
slack_app_token""Slack app-level token (xapp-..., scope connections:write) for Socket Mode. Sensitive.
slack_signing_secret""Optional. Slack signing secret for an HTTP Request-URL router only (not injected; Socket Mode does not use it). Sensitive.

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).
storage_bucketsCreated Cloud Storage buckets (including the workspace bucket).
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.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
initialization_jobsNames of any custom init jobs.
cicd_enabled / cicd_configurationCI/CD status and details.
github_repository_url / github_repository_owner / github_repository_nameConnected GitHub repo.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.

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
anthropic_api_keySet on first deployCriticalWithout a valid key the agent starts but all AI requests fail with 401 errors.
gateway_token consistencyAuto-generated or set onceCriticalRotating the token in Secret Manager without redeploying the service causes all client requests to be rejected until the service is redeployed.
enable_backup_importfalse unless restoringCriticalEnabling without a valid backup_uri fails the import job.
execution_environmentgen2HighGen1 does not support GCS Fuse; the workspace mount silently fails.
cpu_always_allocatedtrueHighCPU throttling breaks WebSocket connections and async agent operations.
telegram_bot_token / slack_bot_tokenset when integration enabledHighEmpty token causes all API calls to fail; messages are dropped.
telegram_webhook_secret / slack_signing_secretset when integration enabledHighEmpty value disables signature verification, allowing fake webhook injection.
min_instance_count1 for production agentsHigh0 means webhook events from Telegram/Slack are dropped during cold start (15–20 s).
skills_repo_urlreachable URL or emptyHighAn unreachable URL causes the git clone to fail at startup, restarting the container.
skills_repo_refexisting refHighA non-existent branch or tag causes the clone to fail at every startup.
max_instance_count1 per tenantHighMultiple instances for the same tenant split agent state across replicas.
enable_iapenable for admin-facingMediumThe gateway is otherwise reachable at its run.app URL. Telegram/Slack webhook endpoints cannot authenticate with Google identity — ensure they are not behind IAP.
backup_retention_days7 (raise for prod)MediumToo short for compliance; an accidental bucket purge permanently loses agent state.
enable_vpc_sc without organization_idset explicitlyMediumVPC-SC is silently skipped, leaving credentials without perimeter protection.

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

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