Deploy openclaw.ai on Google Cloud
Deploy on Google Compute Engine with a private Gateway and SSH-tunneled Control UI.
Check Current Trial Terms
Google Cloud credits and free-tier limits can change by account and region. Confirm current eligibility and expiration in Cloud Billing.
Check current Google Cloud offers
Review current trial credits, free-tier limits, and Compute Engine pricing.
Get Started âđ Prerequisites
Create a Compute Engine VM Instance
Open the Compute Engine Console and create a new VM:
- Click Create Instance
- Name your instance (e.g.,
openclaw-vm) - Choose a Region and Zone close to you (e.g.,
us-central1-a) - Under Machine configuration, select E2 â e2-small (2 GB RAM) or a current equivalent
- Under Boot disk, click Change â select Ubuntu 24.04 LTS or a newer supported LTS release, with 20 GB or more
- Under Firewall, leave HTTP and HTTPS unchecked; the Gateway will remain private
- Click Create
CLI Alternative
You can also create the VM using the gcloud CLI if you prefer the command line.
# Alternative: Create via gcloud CLI
gcloud compute instances create openclaw-vm \
--zone=us-central1-a \
--machine-type=e2-small \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=20GB \
--tags=openclaw-server
Connect via SSH
The easiest way to connect is through the GCP Console:
- Go to Compute Engine â VM instances
- Click the SSH button next to your instance
Or connect from your local terminal:
# Connect using gcloud (auto-handles SSH keys)
gcloud compute ssh openclaw-vm --zone=us-central1-a
# Or use standard SSH with the external IP
ssh username@your-vm-external-ip
System Update & Dependencies
Update the package index and upgrade all installed packages:
sudo apt update && sudo apt upgrade -y
Install supported Node.js version
openclaw.ai requires Node.js 22.22.3+, 24.15+, or 25.9+ (installer defaults to Node 26). Install it from the official NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_26.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version # Should show v26.x.x
Install openclaw.ai
Run the official one-line installer:
curl -fsSL https://openclaw.ai/install.sh | bash
Run Onboarding
Launch the interactive onboarding wizard. The --install-daemon flag automatically configures openclaw.ai to run as a background service:
openclaw onboard --install-daemon
The wizard will walk you through:
- Authentication setup (API keys for your LLM provider)
- Gateway configuration (port, allowed origins)
- Optional channel setup (Slack, Discord, etc.)
Verify Installation
Confirm everything is running correctly:
# Check system configuration
openclaw doctor
# Verify the gateway is healthy
openclaw health
# Print the authenticated dashboard URL
openclaw dashboard --no-open
# On your local computer, forward the private Gateway port
ssh -N -L 18789:127.0.0.1:18789 YOUR_USER@your-vm-external-ip
# Then open http://127.0.0.1:18789
Configure VPC Firewall Rules
Keep the Gateway on its default loopback bind. You do not need a VPC firewall rule for port 18789; use the SSH tunnel from Step 7:
# Run this on your local computer
gcloud compute ssh openclaw-vm \
--zone=us-central1-a \
-- -N -L 18789:127.0.0.1:18789
# Then open http://127.0.0.1:18789
Keep the Gateway Private
Do not create an internet-facing rule for port 18789. Use SSH forwarding or Tailscale for remote access.
Keep Running with systemd
The --install-daemon flag from Step 6 already set up a systemd user service. To check its status:
# Check gateway status via openclaw CLI
openclaw gateway status
# Or check directly via systemd
systemctl --user status openclaw-gateway
# View live logs
journalctl --user -u openclaw-gateway -f
The service will automatically restart on failure and start on boot.
đ§ Troubleshooting
Check the Gateway on the VM, then restart the SSH tunnel locally:
# On the VM
openclaw gateway status
ss -tlnp | grep 18789
# On your local computer
gcloud compute ssh openclaw-vm \
--zone=us-central1-a \
-- -N -L 18789:127.0.0.1:18789
GCP SSH requires port 22 to be open. Verify the default SSH firewall rule exists:
gcloud compute firewall-rules list --filter="name=default-allow-ssh"
If missing, create it or use the GCP Console browser-based SSH as a fallback.
The e2-micro instance has only 1 GB RAM. If you're experiencing OOM issues, add swap space:
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Or upgrade to an e2-small (2 GB RAM) for a smoother experience.
Ready to deploy? Get started with Google Cloud â
Was this helpful?