How to Install OpenClaw on Google Cloud (Using the $300 Free Credit)
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:
- Create a fresh Google Cloud project
- Attach billing (to activate the free credit)
- Enable Compute Engine
- Launch an Ubuntu VM
- Install Docker
- 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
gcloud projects create openclaw-ubuntu-2026 --name="OpenClaw Bot"
gcloud config set project openclaw-ubuntu-2026This 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:
gcloud billing accounts listCopy your billing account ID, then link it:
gcloud billing projects link openclaw-ubuntu-2026 --billing-account=ACCOUNT_IDWithout this step, Compute Engine will not start.
Phase 3 — Enable Compute Engine API
New projects have all services disabled.
Enable Compute Engine:
gcloud services enable compute.googleapis.comPhase 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:
gcloud compute instances create openclaw-gateway \
--zone=europe-west3-a \
--machine-type=e2-small \
--boot-disk-size=20GB \
--image-family=ubuntu-2404-lts-amd64 \
--image-project=ubuntu-os-cloud \
--tags=openclaw-gatewayIf you’re in the US, use us-central1-a.
Verify the VM
SSH into it:
gcloud compute ssh openclaw-gateway --zone=europe-west3-aCheck the OS:
lsb_release -aYou should see:
Ubuntu 24.04 LTS
Codename: nobleIf you see that, the VM is ready.
Phase 5 — Install Docker
Inside the VM:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git curl ca-certificates
curl -fsSL https://get.docker.com | sudo shEnable Docker without sudo:
sudo usermod -aG docker $USER
newgrp dockerVerify:
docker --version
docker compose versionIf both commands work, Docker is ready.
Phase 6 — Install OpenClaw
Clone the repository:
git clone https://github.com/openclaw/openclaw.git
cd openclawCreate persistent host directories
Docker containers are ephemeral. All long-lived state must live on the host.
mkdir -p ~/.openclaw
mkdir -p ~/.openclaw/workspaceRun the interactive setup wizard:
./docker-setup.shThis configures:
- Gateway
- Workspace
- Tokens
- Ports
It requires a real SSH session (TTY), so run it manually.
Start OpenClaw
After setup:
docker compose up -d
docker compose logs -f openclaw-gatewayLook for:
[gateway] listening on ws://0.0.0.0:18789If 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:
ssh -N -L 18789:127.0.0.1:18789 user@<VM_IP>Then open:
http://localhost:18789/Or with token:
http://localhost:18789/#token=YOUR_TOKENThis keeps the dashboard private.
Optional: Open Firewall
gcloud compute firewall-rules create allow-openclaw-ui \
--direction=INGRESS \
--action=ALLOW \
--rules=tcp:18789 \
--source-ranges=0.0.0.0/0Only do this for short-term testing.
Public dashboards are security risks.