OpenClaw + Ubuntu Desktop on GCP: Remote GUI Setup Guide (2026)

So you've heard about OpenClaw—the open-source AI agent that automates tasks via WhatsApp, Telegram, and Discord. It's designed to run locally on your own hardware, which is great for privacy and control. But keeping your laptop on 24/7 isn't ideal.
This guide shows you how to run OpenClaw on a GCP VM with Ubuntu Desktop. I'm sharing the exact commands I used, including the mistakes I made and how I fixed them.
TL;DR#
- OpenClaw (formerly Clawdbot → Moltbot) is an open-source AI agent for task automation
- Run it on a GCP VM with Ubuntu Desktop for 24/7 availability
- This tutorial: create e2-standard-2 VM, install XFCE4, configure Chrome Remote Desktop
- Setup time: ~15 minutes | Cost: ~$50/month
What is OpenClaw?#
OpenClaw is a local-first AI agent that runs on your hardware and automates tasks through messaging apps. Unlike ChatGPT or Siri, it has deep system access—file management, browser automation, shell commands. It maintains persistent memory and can orchestrate multiple sub-agents.
The problem: It needs an always-on computer. A GCP VM solves this without buying a Mac Mini or keeping your laptop running 24/7.
Prerequisites#
- GCP account with billing enabled
- gcloud CLI installed locally
- Google account (for Chrome Remote Desktop)
- Basic command line knowledge
- ~15 minutes
Step 1: Create the GCP VM#
Configure gcloud:
gcloud config set project YOUR_PROJECT_ID
gcloud config set compute/zone us-central1-a
Create the VM:
gcloud compute instances create ubuntu-desktop \
--machine-type=e2-standard-2 \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=50GB
Why e2-standard-2? I tried e2-medium first—it works, but it's sluggish. 50GB disk because desktop environments eat space fast.
$ gcloud compute instances create ubuntu-desktop --machine-type=e2-standard-2 --image-family=ubuntu-2204-lts --image-project=ubuntu-os-cloud --boot-disk-size=50GB
Created [https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/europe-west1-b/instances/ubuntu-desktop]. NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS ubuntu-desktop europe-west1-b e2-standard-2 10.132.0.2 34.XX.XX.XX RUNNING
Step 2: Install Desktop Environment#
SSH might fail immediately after creation. Wait 10-30 seconds:
sleep 10 && gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command="uptime"
Install XFCE4 and Chrome Remote Desktop:
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=" \
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4 xfce4-goodies xfce4-terminal firefox wget && \
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb && \
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ./chrome-remote-desktop_current_amd64.deb"
This installs 438 packages and takes about 3 minutes.
$ gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command="sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4 xfce4-goodies xfce4-terminal firefox wget && wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ./chrome-remote-desktop_current_amd64.deb"
Get:1 http://europe-west1.gce.archive.ubuntu.com/ubuntu jammy InRelease [270 kB] ... 438 upgraded, 127 newly installed real 2m49.123s
Configure Chrome Remote Desktop to use XFCE4:
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=" \
echo 'exec /usr/bin/xfce4-session' > ~/.chrome-remote-desktop-session"
Step 3: Set Up Chrome Remote Desktop#
- Visit https://remotedesktop.google.com/headless on your local machine
- Click "Begin" → "Next" → "Authorize"
- Copy the generated command
Run it on your VM:
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=' \
DISPLAY= /opt/google/chrome-remote-desktop/start-host \
--code="4/0ASc3g..." \
--redirect-url="https://remotedesktop.google.com/_/oauthredirect" \
--name=$(hostname) \
--pin="YOUR_PIN"'
Verify it's running:
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=" \
systemctl status chrome-remote-desktop@\$USER.service"
$ gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command="systemctl status chrome-remote-desktop@$USER.service"
● [email protected] Active: active (running) since Mon 2026-02-02 13:45:12 UTC
Step 4: Install OpenClaw#
Visit https://remotedesktop.google.com/access, click your VM, and enter your PIN. The XFCE4 desktop appears.
Set a GUI password:
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=" \
echo 'USERNAME:PASSWORD' | sudo chpasswd"
Install OpenClaw:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard
$ curl -fsSL https://openclaw.ai/install.sh | bash Installing OpenClaw... ✓ Downloaded OpenClaw v2.1.0 ✓ Installed to /usr/local/bin/openclaw
$ openclaw onboard ? Select your preferred messaging channel: ❯ WhatsApp (Baileys) ✓ Gateway configured ✓ WhatsApp channel configured 🎉 OpenClaw is ready!
Cost Breakdown#
Running e2-standard-2 24/7:
- Compute: ~$48-52/month
- Disk: ~$2/month (50GB)
- Network: ~$1-2/month
- Total: ~$50-55/month
Save money: Schedule start/stop (e.g., stop at 11 PM, start at 7 AM = ~60% savings) or use e2-medium (~$25/month) for testing.
Troubleshooting#
SSH Connection Refused VM is still booting. Wait 10-30 seconds and retry.
Black Screen in Chrome Remote Desktop
gcloud compute ssh ubuntu-desktop --zone=europe-west1-b --command=" \
echo 'exec /usr/bin/xfce4-session' > ~/.chrome-remote-desktop-session && \
sudo systemctl restart chrome-remote-desktop@\$USER.service"
Zone Mismatch
Check actual zone: gcloud compute instances list
Frequently Asked Questions
Setting up OpenClaw on GCP gives you a 24/7 AI agent for ~$50/month. Create an e2-standard-2 VM, install XFCE4 + Chrome Remote Desktop, run the OpenClaw installer, and you're done.
Head to openclaw.ai to get started, then docs.openclaw.ai for detailed config. Happy automating!