# OpenClaw on GCP: Deploy OpenClaw on Google Cloud Platform

> Deploy OpenClaw on GCP (Google Cloud Platform) and run your AI agent in the cloud. This guide shows how to set up a GCP VM and launch OpenClaw step-by-step.

**Published:** Mar 28, 2026 | **Author:** Alex Chen | **Read time:** 12 min read

Learn how to run OpenClaw on GCP using Google Cloud VM. Step-by-step guide with Docker setup, requirements, and deployment instructions.

---

Run [OpenClaw](/blog/what-is-openclaw) on Google Cloud Platform (GCP) to keep your AI agent running 24/7 without relying on your local machine.

This setup is ideal if you want a reliable production deployment with low monthly cost and high uptime.

Run [OpenClaw](/blog/what-is-openclaw) on Google Cloud Platform (GCP) to keep your AI agent running 24/7 without relying on your local machine.

This setup is ideal if you want a reliable production deployment with low monthly cost and high uptime.


## Minimum PC Requirements




| Component | Minimum Requirement | Recommended |
| --- | --- | --- |
| CPU | Dual-Core Processor | Quad-Core (Intel i5 / Ryzen 5) |
| RAM | 4GB | 8GB+ |
| Storage | 10GB Free | 20GB+ |
| Internet | 10 Mbps | 25 Mbps+ |
| Operating System | Windows 10 / Linux / macOS | Windows 11 / Linux |
| Terminal Access | Command Prompt / PowerShell / Terminal | Windows Terminal |
| Browser | Chrome / Edge / Firefox | Latest version |

## Recommended GCP VM Specs




| Machine Type | CPU | RAM | Recommendation |
| --- | --- | --- | --- |
| e2-micro | Shared | 1GB | Not recommended |
| e2-small | 2 vCPU | 2GB | Minimum |
| e2-medium | 2 vCPU | 4GB | Recommended |

## How to Run OpenClaw on GCP?


### Step 1: Install the gcloud CLI

Install the Google Cloud CLI on your local machine:

Once installed, initialize and authenticate:

Alternatively, every step in this guide can also be done through the Google Cloud Console at `https://console.cloud.google.com/`


### Step 2: Create a GCP Project

Create a new project for your OpenClaw deployment:

Enable billing for the project at `https://console.cloud.google.com/billing` (required for Compute Engine). Then enable the Compute Engine API:


### Step 3: Create the Compute Engine VM

Create a VM with Debian 12 and a 20GB boot disk:


### Step 4: SSH Into the VM

If the connection is refused, wait 1–2 minutes after VM creation for SSH key propagation, then retry.


### Step 5: Install Docker

Inside the VM, run:

Log out for the group change to take effect:

SSH back in:

Verify Docker is working:


### Step 6: Clone the OpenClaw Repository

Then create directories:

This ensures your config and workspace survive container rebuilds and VM restarts.


### Step 7: Configure Environment Variables

Create a `.env` file in the repository root:

Generate strong secrets for `OPENCLAW_GATEWAY_TOKEN` and `GOG_KEYRING_PASSWORD`:

Do not commit this file to version control.


### Step 8: Configure Docker Compose

Create `docker-compose.yml` in the repository root:


```bash
{`services:
  openclaw-gateway:
    image: \$
    build: .
    restart: unless-stopped
    env_file:
      - .env
    environment:
      - HOME=/home/node
      - NODE_ENV=production
      - TERM=xterm-256color
      - OPENCLAW_GATEWAY_BIND=\$
      - OPENCLAW_GATEWAY_PORT=\$
      - OPENCLAW_GATEWAY_TOKEN=\$
      - GOG_KEYRING_PASSWORD=\$
      - XDG_CONFIG_HOME=\$
      - PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    volumes:
      - \$:/home/node/.openclaw
      - \$:/home/node/.openclaw/workspace
    ports:
      - "127.0.0.1:\$:18789"
    command:
      [
        "node",
        "dist/index.js",
        "gateway",
        "--bind",
        "\$",
        "--port",
        "\$",
        "--allow-unconfigured",
      ]`}
```

The port binding `127.0.0.1:18789` keeps the gateway loopback-only on the VM. You access it securely through an SSH tunnel.


### Step 9: Build and Launch OpenClaw

Build the Docker image and start the container:

Check the container is running:


### Step 10: Configure Allowed Origins

When binding to LAN, set the trusted browser origin:


### Step 11: Access the Dashboard from Your Local Machine

From your local machine (not the VM), open an SSH tunnel:

Open in your browser:

Get a tokenized dashboard link:

If the dashboard shows *unauthorized* or *disconnected (1008): pairing required*, approve your browser:

After setup, connect a messaging channel — Telegram, [WhatsApp](/blog/connect-openclaw-whatsapp), Discord, [Slack](https://www.ampere.sh/openclaw-for-slack), Microsoft Teams, or any other supported app — to start chatting with your agent.


## Common Issues and Fix



| Issue | Fix |
| --- | --- |
| SSH connection refused | Wait 1–2 min after VM creation for SSH key propagation |
| Docker build fails (exit 137 / OOM) | gcloud compute instances set-machine-type openclaw-gateway --zone=us-central1-a --machine-type=e2-small |
| docker: command not found | Log out and back in after sudo usermod -aG docker $USER |
| docker compose not found | sudo apt-get install -y docker-compose-plugin |
| Gateway container not starting | docker compose logs -f to check error output |
| Dashboard shows unauthorized | docker compose run --rm openclaw-cli devices approve <requestId> |
| OS Login permission error | gcloud compute os-login describe-profile — check IAM permissions |
| Container stops after reboot | Confirm restart: unless-stopped is set in docker-compose.yml |

If you prefer to skip these setup steps entirely, you can deploy OpenClaw on [Ampere.sh](https://www.ampere.sh) in 60 seconds. No Docker, no config files, no infrastructure management required.


## Avoid Cloud Configuration

Setting up OpenClaw on GCP requires VM creation, Docker setup, and networking configuration. Run OpenClaw on Ampere.sh and start your AI agent in 60 seconds.

[Deploy on Ampere.sh →](https://www.ampere.sh/setup)


## Frequently Asked Questions

### What is OpenClaw on GCP?

OpenClaw on GCP means running your OpenClaw AI agent on a Google Cloud virtual machine instead of your local computer. This allows your agent to run 24/7 with better reliability and performance.

### Can I use GCP free tier for OpenClaw?

Yes, but it's not recommended. The free-tier e2-micro (1GB RAM) often fails during Docker builds or OpenClaw startup.

### Do I need Docker to run OpenClaw on GCP?

Yes. OpenClaw is typically deployed using Docker to ensure stable and persistent setup.

### Does OpenClaw continue running if I close my PC?

Yes. Once deployed, OpenClaw runs 24/7 on GCP even if your PC is turned off.

### Can I upgrade my VM later?

Yes. You can easily upgrade RAM, CPU, and Storage without reinstalling OpenClaw.

### What happens if my VM stops?

OpenClaw stops temporarily. Once you restart the VM, OpenClaw resumes automatically if Docker restart is enabled.

### Do I need technical knowledge?

Basic knowledge helps, but most steps are copy-paste friendly.

### Can I connect OpenClaw to Telegram or WhatsApp?

Yes. After deployment, you can connect Telegram, Discord, WhatsApp, Slack, and more.
