조회수 6•
GCP에서 설치하기
OpenClaw 완전정복 : 설치부터 응용 사례까지Step 1: gcloud CLI 설치 및 초기 설정
사용자의 OS를 확인한 뒤, 아래 섹션에서 환경에 맞는 명령을 선택해 진행합니다.
gcloud CLI 설치
Windows
PowerShell을 관리자 권한으로 실행한 뒤, 설치 파일을 내려받아 인스톨러를 실행합니다.
(New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:TempGoogleCloudSDKInstaller.exe")
& $env:TempGoogleCloudSDKInstaller.exemacOS
Homebrew로 Google Cloud CLI를 설치합니다.
brew install --cask google-cloud-sdkLinux (Ubuntu/Debian)
권장: keyring을 사용해 APT 저장소를 추가한 뒤 설치합니다.1
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-cli초기 설정
gcloud init는 로그인, 기본 프로젝트, 리전/존 등을 대화형으로 설정합니다. 개별 명령은 필요한 항목만 따로 지정할 때 사용합니다. 아래 명령은 초기화를 진행합니다.
gcloud init아래 명령은 인증 및 프로젝트/존을 개별로 지정합니다(예: my-sample-project-123).
gcloud auth login
gcloud config set project enhanced-optics-487000-g1
gcloud config set compute/zone asia-northeast3-a확인/문제 해결(간단)
아래 명령으로 버전/설정/인증 상태를 빠르게 점검합니다.
gcloud --version
gcloud config list
gcloud auth list[!TIP] 설정 확인은
gcloud config list, 로그인 계정 확인은gcloud auth list가 유용합니다.
Step 2: GCP VM 인스턴스 생성
gcloud compute instances create openclaw-server \
--zone=asia-northeast3-a \
--machine-type=e2-small \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=20GB \
--tags=openclaw윈도우 파워쉘의 경우
gcloud compute instances create openclaw-server `
--zone=asia-northeast3-a `
--machine-type=e2-small `
--image-family=ubuntu-2204-lts `
--image-project=ubuntu-os-cloud `
--boot-disk-size=20GB `
--tags=openclaw방화벽 규칙 설정 (Gateway 포트 18789 허용)
윈도우 파워쉘의 경우
gcloud compute firewall-rules create allow-openclaw ``
--allow=tcp:18789 ``
--target-tags=openclaw ``
--description="OpenClaw Gateway 포트"gcloud compute firewall-rules create allow-openclaw \
--allow=tcp:18789 \
--target-tags=openclaw \
--description="OpenClaw Gateway 포트"[!IMPORTANT] PowerShell에서는 줄 이어쓰기에 `` 대신 백틱(`)을 사용합니다. ---
Step 3: SSH 접속 및 Node.js 설치
# VM에 SSH 접속
gcloud compute ssh openclaw-server --zone=asia-northeast3-a
# NVM으로 Node.js 22 설치
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22
nvm use 22