Deploy openclaw.ai on Google Cloud
Deploy on Google's reliable infrastructure with $300 free credits for new accounts.
$300 Free Trial
New Google Cloud accounts get $300 in free credits valid for 90 days. An e2-micro instance is also part of the Always Free tier â enough to run openclaw.ai at no cost.
đ 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 series â e2-small (2 vCPU, 2 GB RAM) or e2-micro (free tier, 1 GB RAM)
- Under Boot disk, click Change â select Ubuntu 22.04 LTS, set disk size to 20 GB or more
- Under Firewall, check Allow HTTP traffic
- 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 Node.js 22
openclaw.ai requires Node.js 22 or higher. Install it from the official NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version # Should show v22.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
# Open the web dashboard
openclaw dashboard
# Dashboard available at http://your-vm-external-ip:18789
Configure VPC Firewall Rules
GCP blocks all inbound traffic by default except SSH (port 22). Create a firewall rule to allow access to the openclaw.ai dashboard:
# Create a firewall rule for the openclaw dashboard
gcloud compute firewall-rules create allow-openclaw \
--direction=INGRESS \
--priority=1000 \
--network=default \
--action=ALLOW \
--rules=tcp:18789 \
--source-ranges=YOUR_IP/32 \
--target-tags=openclaw-server
Or configure via the Console:
- Go to VPC Network â Firewall â Create Firewall Rule
- Name:
allow-openclaw - Direction: Ingress
- Target tags:
openclaw-server - Source IP ranges: your IP address (e.g.,
203.0.113.10/32) - Protocols and ports: TCP â
18789 - Click Create
Security Warning
Replace YOUR_IP/32 with your actual IP address. Never use 0.0.0.0/0 as the source range for the dashboard port in production.
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
Verify both the VPC firewall rule and that the gateway is listening:
# Confirm the gateway is listening
ss -tlnp | grep 18789
# Verify firewall rules
gcloud compute firewall-rules list --filter="name=allow-openclaw"
# Ensure the VM has the correct network tag
gcloud compute instances describe openclaw-vm \
--zone=us-central1-a --format="get(tags.items)"
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.
Was this helpful?