Skip to main content
Run a persistent OpenClaw Gateway on a Debian Compute Engine VM. This page covers GCP provisioning, network access, and machine operations; the shared Docker VM runtime page owns container setup, persistence, custom binaries, verification, and updates. Pricing varies by machine type and region. Start with at least 2 GB RAM for a source build and resize if the build is OOM-killed.

What you need

  • A GCP project with billing enabled
  • The gcloud CLI or the Cloud Console
  • SSH access from your laptop
  • Model and optional channel credentials
  • About 20 minutes

Provision the VM

1

Initialize gcloud

Install the CLI from cloud.google.com/sdk/docs/install, then authenticate:
You can perform the same steps in the Cloud Console.
2

Create the project

Enable billing in the Billing console. Compute Engine will not start without it.
3

Choose a machine

Create a Debian 12 VM:
4

Review firewall access

Keep TCP 18789 closed to the public Internet. The SSH tunnel below needs only SSH access to the VM:
Restrict SSH source ranges to your administrative network when possible. If you intentionally expose the Gateway through a reverse proxy or tailnet, follow Gateway security rather than adding a broad 0.0.0.0/0 rule for port 18789.
5

Connect over SSH

SSH key propagation can take a minute or two after VM creation. Wait and retry if the first connection is refused.
6

Install Docker

On the VM:
Reconnect so the group change takes effect, then verify the installation:

Configure the Docker runtime

On the VM, follow Docker VM runtime from Before you begin through Verify and administer the Gateway. The maintained setup script uses these GCP host paths by default:
If a source build ends with Killed, ResourceExhausted, or exit code 137, resize the VM before retrying.

Access the Control UI

From your laptop, open an SSH tunnel and leave it running:
Open http://127.0.0.1:18789/. Paste the Gateway token from the VM’s .env when prompted. To reprint the dashboard URL or approve a browser device, run on the VM:

Troubleshooting

SSH connection refused

Wait one or two minutes for SSH key propagation, then retry. Check the VM is running and that an ingress firewall rule allows TCP 22 from your current network.

OS Login issues

Ensure your account has Compute OS Login or Compute OS Admin Login permission.

Resize after an out-of-memory build

Use a deployment service account

For personal setup, your user account is enough. Automation should use a dedicated service account with the narrowest role that works:
Avoid the Owner role. See Understanding roles.

Next steps