Deploy openclaw.ai on Google Cloud

Intermediate ⏱ 30 minutes 📅 Updated Feb 2026

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

1

Create a Compute Engine VM Instance

Open the Compute Engine Console and create a new VM:

  1. Click Create Instance
  2. Name your instance (e.g., openclaw-vm)
  3. Choose a Region and Zone close to you (e.g., us-central1-a)
  4. Under Machine configuration, select E2 series → e2-small (2 vCPU, 2 GB RAM) or e2-micro (free tier, 1 GB RAM)
  5. Under Boot disk, click Change → select Ubuntu 22.04 LTS, set disk size to 20 GB or more
  6. Under Firewall, check Allow HTTP traffic
  7. Click Create
â„šī¸

CLI Alternative

You can also create the VM using the gcloud CLI if you prefer the command line.

bash
# 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
2

Connect via SSH

The easiest way to connect is through the GCP Console:

  1. Go to Compute Engine → VM instances
  2. Click the SSH button next to your instance

Or connect from your local terminal:

bash
# 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
3

System Update & Dependencies

Update the package index and upgrade all installed packages:

bash
sudo apt update && sudo apt upgrade -y
4

Install Node.js 22

openclaw.ai requires Node.js 22 or higher. Install it from the official NodeSource repository:

bash
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
5

Install openclaw.ai

Run the official one-line installer:

bash
curl -fsSL https://openclaw.ai/install.sh | bash
6

Run Onboarding

Launch the interactive onboarding wizard. The --install-daemon flag automatically configures openclaw.ai to run as a background service:

bash
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.)
7

Verify Installation

Confirm everything is running correctly:

bash
# 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
8

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:

bash
# 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:

  1. Go to VPC Network → Firewall → Create Firewall Rule
  2. Name: allow-openclaw
  3. Direction: Ingress
  4. Target tags: openclaw-server
  5. Source IP ranges: your IP address (e.g., 203.0.113.10/32)
  6. Protocols and ports: TCP → 18789
  7. 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.

9

Keep Running with systemd

The --install-daemon flag from Step 6 already set up a systemd user service. To check its status:

bash
# 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:

bash
# 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:

bash
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:

bash
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.