Payload Logo

How to Install OpenClaw on Google Cloud (Using the $300 Free Credit)

Date Published

If you want to test OpenClaw without touching your local machine, Google Cloud is a clean way to do it.

New Google Cloud accounts receive $300 in free credits.
That’s more than enough to:

  • Spin up a VM
  • Install Docker
  • Run OpenClaw
  • Stress test performance
  • Delete everything afterward

This guide walks you from zero to a running OpenClaw gateway.


Quick Summary

Here’s the short version.

You:

  1. Create a fresh Google Cloud project
  2. Attach billing (to activate the free credit)
  3. Enable Compute Engine
  4. Launch an Ubuntu VM
  5. Install Docker
  6. Install and start OpenClaw

That’s it.

In less than an hour, you can run OpenClaw in a clean cloud environment and test it for free using the $300 credit.


Phase 1 — Create a Clean Project

You’ll use the gcloud CLI.

Create a new project

1gcloud projects create openclaw-ubuntu-2026 --name="OpenClaw Bot"
2gcloud config set project openclaw-ubuntu-2026

This isolates billing, firewall rules, and compute resources.


Phase 2 — Attach Billing (Required)

Even if you’re using free credits, billing must be enabled.

List billing accounts:

1gcloud billing accounts list

Copy your billing account ID, then link it:

1gcloud billing projects link openclaw-ubuntu-2026 --billing-account=ACCOUNT_ID

Without this step, Compute Engine will not start.


Phase 3 — Enable Compute Engine API

New projects have all services disabled.

Enable Compute Engine:

1gcloud services enable compute.googleapis.com

Phase 4 — Create an Ubuntu 24.04 VM

We’ll use Ubuntu 24.04 LTS.

Recommended machine type:

  • e2-small — safe baseline
  • Avoid e2-micro — it may run out of memory

Frankfurt zone example:

1gcloud compute instances create openclaw-gateway \
2 --zone=europe-west3-a \
3 --machine-type=e2-small \
4 --boot-disk-size=20GB \
5 --image-family=ubuntu-2404-lts-amd64 \
6 --image-project=ubuntu-os-cloud \
7 --tags=openclaw-gateway

If you’re in the US, use us-central1-a.


Verify the VM

SSH into it:

1gcloud compute ssh openclaw-gateway --zone=europe-west3-a

Check the OS:

1lsb_release -a

You should see:

1Ubuntu 24.04 LTS
2Codename: noble

If you see that, the VM is ready.


Phase 5 — Install Docker

Inside the VM:

1sudo apt-get update && sudo apt-get upgrade -y
2sudo apt-get install -y git curl ca-certificates
3curl -fsSL https://get.docker.com | sudo sh

Enable Docker without sudo:

1sudo usermod -aG docker $USER
2newgrp docker

Verify:

1docker --version
2docker compose version

If both commands work, Docker is ready.


Phase 6 — Install OpenClaw

Clone the repository:

1git clone https://github.com/openclaw/openclaw.git
2cd openclaw

Create persistent host directories

Docker containers are ephemeral. All long-lived state must live on the host.

1mkdir -p ~/.openclaw
2mkdir -p ~/.openclaw/workspace

Run the interactive setup wizard:

1./docker-setup.sh

This configures:

  • Gateway
  • Workspace
  • Tokens
  • Ports

It requires a real SSH session (TTY), so run it manually.


Start OpenClaw

After setup:

1docker compose up -d
2docker compose logs -f openclaw-gateway

Look for:

1[gateway] listening on ws://0.0.0.0:18789

If you see that line, the gateway is running.


Access the Dashboard (Secure Way)

Do not expose port 18789 publicly unless you truly need to.

Instead, create an SSH tunnel from your laptop:

1ssh -N -L 18789:127.0.0.1:18789 user@<VM_IP>

Then open:

1http://localhost:18789/

Or with token:

1http://localhost:18789/#token=YOUR_TOKEN


This keeps the dashboard private.


Optional: Open Firewall

1gcloud compute firewall-rules create allow-openclaw-ui \
2 --direction=INGRESS \
3 --action=ALLOW \
4 --rules=tcp:18789 \
5 --source-ranges=0.0.0.0/0


Only do this for short-term testing.
Public dashboards are security risks.