This skill provides a step-by-step workflow for deploying OpenClaw on a Google Cloud Platform (GCP) VM instance. It covers everything from initial GCP setup to OpenClaw and GOG CLI configuration.
0. Download the Skill
Download this skill to the project root.
npx dlabs install gcp-openclaw --target agents
Other platform targets:
--target claude,--target gemini,--target antigravity등
1. Prerequisites (Local Machine)
Make sure the Google Cloud CLI (gcloud) is installed and authenticated on your local computer.
1.1 Verify Google Cloud CLI Installation
First, check whether gcloudis installed.
gcloud version
If the command runs successfully, skip to step 1.3. command not found . If an error occurs, proceed with the installation process below.
1.2 Install Google Cloud CLI
macOS
# Homebrew로 설치 (권장)
brew install --cask google-cloud-sdk
# 또는 공식 스크립트로 설치
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
Linux (Debian/Ubuntu)
# 패키지 소스 추가
sudo apt-get install -y apt-transport-https ca-certificates gnupg curl
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list
# 설치
sudo apt-get update && sudo apt-get install -y google-cloud-cli
Linux (RHEL/CentOS/Fedora)
# 패키지 소스 추가
sudo tee /etc/yum.repos.d/google-cloud-sdk.repo << 'EOF'
[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
# 설치
sudo dnf install -y google-cloud-cli
Windows
# winget으로 설치
winget install Google.CloudSDK
# 또는 공식 인스톨러 다운로드
# https://cloud.google.com/sdk/docs/install#windows
After installation, verify the installation with gcloud version.
1.3 Google Cloud Authentication
gcloud auth login --no-launch-browser
Open the output URL in your browser to authenticate, and paste the verification code into the terminal.
1.4 Project and Billing Setup
https://console.cloud.google.com to create a new project.
# 프로젝트 ID 설정
gcloud config set project [YOUR_PROJECT_ID]
# 필요한 서비스 활성화
gcloud services enable compute.googleapis.com
gcloud services enable cloudresourcemanager.googleapis.com
Tip:
gcloud config configurationsallows you to manage multiple configuration profiles per project/account.# 새 설정 프로필 생성 gcloud config configurations create openclaw-dev gcloud config set project my-openclaw-project gcloud config set compute/zone asia-northeast3-a # 프로필 전환 gcloud config configurations activate openclaw-dev
2. Create a VM Instance
Create a VM instance with sufficient resources.
Recommended specifications: e2-small (2 vCPU, 2GB RAM) or e2-medium (2 vCPU, 4GB RAM).
Operating system: Ubuntu 22.04 LTS
gcloud compute instances create openclaw-instance \
--zone=us-central1-a \
--machine-type=e2-small \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=25GB \
--boot-disk-type=pd-balanced \
--labels=env=dev,app=openclaw
3. SSH Configuration
Configure SSH so you can easily connect to the VM.
3.1 Generate a Key and Connect
# 키 자동 생성 및 접속
gcloud compute ssh openclaw-instance --zone=us-central1-a
3.2 Standard SSH Alias (Optional but Recommended)
Add the following to your local ~/.ssh/config file:
Host openclaw
HostName [EXTERNAL_IP]
User [YOUR_USERNAME]
IdentityFile ~/.ssh/google_compute_engine
4. Install Dependencies and Tools (Remote Server)
SSH into the server and install the required tools.
# 서버 접속
gcloud compute ssh openclaw-instance --zone=us-central1-a
# 업데이트 및 기본 도구 설치
sudo apt-get update
sudo apt-get install -y git curl make build-essential
4.1 Install Node.js (v22 or later)
OpenClaw requires Node.js v22 or later.
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
4.2 Install Go (Latest Version Required)
Building the GOG CLI **requires the latest version of Go (1.23 or later)**. The operating system's default package (e.g., apt install golang) may be too old and cause the build to fail, so manual installation as shown below is recommended.
wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.23.6.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
5. Install OpenClaw
Install OpenClaw globally.
# OpenClaw 설치
curl -fsSL https://openclaw.ai/install.sh | bash
# 또는 수동 설치:
# sudo npm install -g openclaw@latest
5.1 Initialize OpenClaw
openclaw onboard
The interactive setup wizard will start. Proceed in the following order:
Step 1: Select Setup Mode
QuickStart.
Step 2: Select AI Provider
In this guide, since we use models from a Gemini subscription account via Google Antigravity OAuth, select Google.
Step 3: Select Authentication Method
Google Antigravity OAuth.
Step 4: Google Account Authentication
- Click the link shown under "Copy this Url" while holding Ctrland the browser will open.
- Log in with the Google account you want.
- After logging in, even if "This site can't be reached" appears, don't panic, copy the entire URL in the address bar.
- Return to the terminal window, paste the copied URL and press Enter.
Step 5: Model selection
Once authentication is complete, you can select a model. Example: google-antigravity/gemini-3-flash
Step 6: Messenger selection (Telegram)
In the messenger selection step, select Telegram.
- In Telegram (desktop app or web), search for BotFather.
- Open BotFather and press the Start button.
/newbotto create a new bot.- name과 username(the username must end with
_botorBot). - When bot creation is complete, HTTP API Tokenis displayed. Click to copy it.
- In the terminal, paste the copied Token and press Enter.
Note: At this point, sending a message in the Telegram bot chat will not get a response. You must approve the conversation with that user in the OpenClaw TUI before conversation becomes possible.
Step 7: Skill settings
Skills can be configured separately later, so here skip.
Step 8: Execution mode selection
- Hatch in TUI: Start talking with OpenClaw directly in the terminal environment (recommended).
- Open the web UI: For a remote server, SSH tunneling is required (see 8-2).
Step 9: Persona settings
OpenClaw asks you to assign a persona during the first conversation. If you specify a role, personality, main emoji to use, etc., it will continue the conversation as that character.
6. GOG CLI installation
Install the Google service CLI tool (gogcli). (Proceed in the GCP VM environment)
# VM 접속 (이미 접속된 상태면 스킵)
gcloud compute ssh openclaw-instance --zone=us-central1-a
# 리포지토리 복제
git clone https://github.com/steipete/gogcli.git
cd gogcli
# 바이너리 빌드
make
# 전역 설치 (심볼릭 링크)
sudo ln -sf $(pwd)/bin/gog /usr/local/bin/gog
# 설치 확인
gog --help
6.1 Security Keyring configuration (important)
Without separate configuration, gog-cli will ask for a password every time a command is executed. For automated processing, the Keyring backend must be set to **file**.
-
Set environment variables (apply permanently)
~/.bashrcAdd the following content to the bottom of the file:# nano 편집기로 파일 열기 nano ~/.bashrcPaste the content below at the very bottom of the open document,
Ctrl+O→Enter→Ctrl+Xthen save and exit:# Go 언어 경로 (앞서 추가하지 않았다면) export PATH=$PATH:/usr/local/go/bin # GOG CLI 설정 (File Backend & Headless) export GOG_KEYRING_BACKEND=file export GOG_KEYRING_PASSWORD='your_secure_password' # 강력한 비밀번호로 변경하세요 export GOG_ACCOUNT='your_email@gmail.com' # 이메일 반복 입력을 피하기 위해 설정Apply changes:
source ~/.bashrc -
Check configuration Check that the settings were applied correctly:
gog config list
gog authentication continues in item 7 below.
7. Configuration and authentication
You can refer to the YouTube video below for a detailed walkthrough of the Google authentication key generation process.
Reference video: OpenClaw installation, finishing with Google in 30 minutes without a server!
- 06:46 | Google Cloud setup
- 14:11 | Registering a Google billing account
- 30:00 | Using Google services in OpenClaw
7.1 Client Secret setup
Downloaded from the Google Cloud Console, client_secret.json upload the file to the server.
Run on the local machine:
gcloud compute scp ./keys/client_secret.json openclaw-instance:~/client_secret.json --zone=us-central1-a
7.2 GOG CLI authentication (Headless mode)
Run on the remote server:
Since a browser cannot be run on the remote server, use the manual authentication method (--manual).
# 업로드한 시크릿 파일을 사용하여 인증 (이메일 주소 지정 권장)
gog auth login [YOUR_EMAIL@gmail.com] --client-secret ~/client_secret.json --manual
- When you run the command, the terminal will output an authentication URL.
- Copy that URL into the browser on your local computer, paste it, and log in.
- Copy the authentication codedisplayed on the screen and paste it into the terminal.
8. Running OpenClaw
8-1. TUI mode (recommended)
# 원격서버 접속
gcloud compute ssh openclaw-instance --zone=us-central1-a
# TUI 실행
openclaw tui
8-2. Web access - SSH tunneling (optional)
To securely access the OpenClaw dashboard from your local machine, use the following command:
Run on the local machine:
# 원격 포트 18789를 로컬 포트 18790으로 포워딩
gcloud compute ssh openclaw-instance --zone=us-central1-a -- -L 18790:localhost:18789 -N -f
Dashboard access address: http://localhost:18790
9. Troubleshooting tips
- Check gcloud installation:
gcloud versionIfcommand not foundappears when running, follow the OS-specific installation guide in step 1.2. - gcloud authentication expired:
gcloud auth loginRe-authenticate withgcloud auth application-default loginor - Memory issues:
npm installIfe2-smallfails, check that the instance specification is at least (2GB RAM) or higher. Adding a swap file is also an option. - Go version:
gogcliIf thego versionbuild fails, check. It must be version 1.22 or higher. - Port conflict: If port 18789 is already in use locally, use a different port (e.g.,
-L 18790:localhost:18789).