Deployment & Hosting
🌐

Running OpenClaw on a Google Cloud VM

Deploy OpenClaw on Google Compute Engine with automated provisioning and management.

6 分鐘閱讀|
google cloudgcevm deployment

Google Cloud Deployment

Google Compute Engine (GCE) provides reliable, scalable VMs perfect for running OpenClaw. This guide covers manual setup — Claw for All automates this entirely.

Prerequisites

  • Google Cloud account with billing enabled
  • gcloud CLI installed
  • A project created in GCP Console

Step 1: Create the VM

gcloud compute instances create openclaw-vm \
  --zone=us-central1-a \
  --machine-type=e2-small \
  --image-family=ubuntu-2404-lts \
  --image-project=ubuntu-os-cloud \
  --boot-disk-size=20GB

Step 2: SSH and Install

gcloud compute ssh openclaw-vm --zone=us-central1-a

On the VM:

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install OpenClaw
npm install -g openclaw

# Run onboarding
openclaw onboard

Step 3: Configure as a Service

sudo tee /etc/systemd/system/openclaw.service > /dev/null <<EOF
[Unit]
Description=OpenClaw Gateway
After=network.target

[Service]
Type=simple
User=$USER
WorkingDirectory=$HOME/.openclaw
ExecStart=$(which openclaw) start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable openclaw
sudo systemctl start openclaw

Step 4: Set Up Instance Metadata

Store configuration in GCE instance metadata for secure key management:

gcloud compute instances add-metadata openclaw-vm \
  --zone=us-central1-a \
  --metadata=OPENROUTER_API_KEY=sk-or-...,TELEGRAM_BOT_TOKEN=...

Read metadata in your startup script to configure environment variables automatically.

Monitoring

Health Checks

Set up an uptime check in GCP Console to monitor your instance.

Logging

View logs:

sudo journalctl -u openclaw -f

Alerts

Configure Cloud Monitoring alerts for CPU, memory, and instance status.

Cost Optimization

  • e2-micro: Free tier eligible, good for light personal use
  • e2-small: ~$15/month, recommended for most users
  • Preemptible VMs: 60-91% cheaper but may restart periodically
  • Committed use discounts: Save 57% with 3-year commitment
google cloudgcevm deploymentcompute enginegcp openclaw

準備好使用AI助理了嗎?

今天就開始使用Claw for All。無需設定,無需終端機,註冊即可使用。

開始使用

相關指南