블로그로 돌아가기

오픈클로(OpenClaw) 맥북 셋업 완벽 가이드: 보안을 고려한 단계별 설치

실제 삽질 경험 기반 오픈클로(OpenClaw) 맥북 설치 가이드. CLI 직접 설정, Discord/Telegram 연동, OpenRouter 무료 모델 설정까지 단계별로 안내한다.

2026년 1월 30일9분 읽기
백호백호

오픈클로(OpenClaw, 구 몰트봇/Moltbot) 맥북 셋업 완벽 가이드

보안을 고려한 단계별 설치 - Discord & Telegram 연동 실제 삽질 경험 기반 - CLI 직접 설정 방식 (onboard 마법사 없이)

사전 경고

오픈클로는 심각한 보안 취약점을 가지고 있습니다. 설치 전 반드시 보안 분석 문서를 읽어주세요.

권장하지 않는 환경:

  • 메인 개발 머신
  • 민감한 데이터가 있는 시스템
  • 프로덕션 환경

권장 환경:

  • 격리된 VM/Docker
  • 테스트 전용 Mac Mini
  • 임시 VPS

모델 선택 가이드 (비용 vs 성능)

| 옵션 | 비용 | 용도 | 권장 | |------|------|------|------| | OpenRouter Free | $0 | 테스트, 가벼운 사용 | 입문용 | | OpenRouter Paid | 사용량 기반 | 다양한 모델 접근 | 중급 | | Claude API | $30~300/월 | 최고 성능 | 헤비 유저 | | Gemini API | $0~사용량 | Google 생태계 | 대안 |

권장 순서: OpenRouter Free로 시작 → 테스트 후 필요시 Claude/Gemini로 전환


Step 1: 사전 준비

1.1 시스템 요구사항

| 항목 | 요구사항 | 확인 방법 | |------|----------|-----------| | macOS | 12.0+ | sw_vers | | Node.js | 22.12.0+ | node --version | | npm | 10.0+ | npm --version |

1.2 필수 계정 준비

최소 필요:

  1. OpenRouter 계정 (무료): https://openrouter.ai
    • GitHub OAuth로 가입
    • API Keys 메뉴에서 키 발급

선택 (나중에 추가 가능): 2. Anthropic 계정 (유료): https://console.anthropic.com 3. Google AI Studio (무료 티어): https://aistudio.google.com

1.3 메신저 봇 토큰 준비

Discord:

  1. https://discord.com/developers/applications
  2. New Application → Bot → Reset Token
  3. MESSAGE CONTENT INTENT 활성화 필수!

Telegram:

  1. @BotFather에게 /newbot
  2. 이름과 username 입력 (_bot으로 끝나야 함)
  3. 토큰 복사

Step 2: OpenClaw 설치

2.1 node-gyp 먼저 설치 (중요!)

# sharp 빌드 에러 방지
npm install -g node-gyp

# 그 다음 openclaw 설치
npm install -g openclaw@latest

# 확인
openclaw --version
# 출력: 2026.1.29

삽질 기록: npm install -g openclaw만 실행하면 sharp 빌드 에러 발생. node-gyp 먼저 설치해야 함.


Step 3: CLI로 직접 설정 (핵심!)

onboard 마법사는 대화형 TUI라서 자동화가 어렵습니다. CLI로 직접 설정하는 방법입니다.

3.1 플러그인 활성화

# Discord, Telegram 플러그인 활성화
openclaw plugins enable discord
openclaw plugins enable telegram

3.2 채널 토큰 설정

# Discord 토큰 설정
openclaw config set channels.discord.token "YOUR_DISCORD_BOT_TOKEN"

# Telegram 토큰 설정 (주의: botToken 필드!)
openclaw config set channels.telegram.botToken "YOUR_TELEGRAM_BOT_TOKEN"

삽질 기록: Telegram은 token이 아니라 botToken 필드를 사용함.

3.3 모델 설정

# OpenRouter 무료 모델 설정 (권장 - 시작용)
openclaw models set openrouter/z-ai/glm-4.5-air:free

# 또는 다른 무료 모델들
# openclaw models set openrouter/google/gemma-3-27b-it:free
# openclaw models set openrouter/qwen/qwen3-coder:free

3.4 보안 설정 (중요!)

# 게이트웨이 loopback 바인딩 (외부 노출 방지)
openclaw config set gateway.bind "loopback"
openclaw config set gateway.mode "local"

# 게이트웨이 인증 토큰 생성
GATEWAY_TOKEN=$(openssl rand -hex 16)
openclaw config set gateway.auth.token "$GATEWAY_TOKEN"
echo "Gateway Token: $GATEWAY_TOKEN"  # 기록해두기

3.5 API 키 설정 (가장 중요한 삽질 포인트!)

# 디렉토리 생성
mkdir -p ~/.openclaw/agents/main/agent

# auth-profiles.json 생성 (형식이 중요!)
cat > ~/.openclaw/agents/main/agent/auth-profiles.json << 'EOF'
{
  "version": 1,
  "profiles": {
    "openrouter:manual": {
      "provider": "openrouter",
      "type": "token",
      "token": "sk-or-v1-YOUR_OPENROUTER_API_KEY"
    }
  }
}
EOF

# 권한 설정
chmod 600 ~/.openclaw/agents/main/agent/auth-profiles.json

핵심 삽질 기록:

  1. version: 1 필드 필수
  2. profiles 객체 안에 프로필 정의
  3. type: "token" 필드 필수!
  4. 프로바이더와 모델이 일치해야 함 (openrouter 모델 → openrouter 키)

Step 4: 게이트웨이 시작

4.1 서비스 설치 및 시작

# LaunchAgent로 설치
openclaw gateway install

# 시작
openclaw gateway start

# 상태 확인 (5초 대기 후)
sleep 5 && openclaw gateway status

정상 출력 예시:

Runtime: running (pid 12345)
RPC probe: ok
Listening: 127.0.0.1:18789

4.2 헬스 체크

openclaw doctor

정상이면:

  • Telegram: ok (@YourBot)
  • Discord: ok (@YourBot)

Step 5: 첫 메시지 테스트

5.1 Telegram 테스트

  1. Telegram에서 봇 검색 (@YourBotName)
  2. "안녕" 메시지 전송
  3. 페어링 코드가 오면 터미널에서 승인:
# 대기 중인 페어링 확인
openclaw pairing list telegram

# 승인 (코드 예: ABC123)
openclaw pairing approve telegram ABC123
  1. 다시 메시지 전송 → AI 응답 확인

5.2 Discord 테스트

동일한 방식으로 진행:

openclaw pairing list discord
openclaw pairing approve discord YOUR_CODE

Step 6: 모델 변경 (나중에)

Claude API로 전환

# 1. Anthropic API 키로 auth-profiles.json 업데이트
cat > ~/.openclaw/agents/main/agent/auth-profiles.json << 'EOF'
{
  "version": 1,
  "profiles": {
    "anthropic:manual": {
      "provider": "anthropic",
      "type": "token",
      "token": "sk-ant-YOUR_ANTHROPIC_API_KEY"
    }
  }
}
EOF
chmod 600 ~/.openclaw/agents/main/agent/auth-profiles.json

# 2. 모델 변경
openclaw models set anthropic/claude-sonnet-4-20250514

# 3. 게이트웨이 재시작
openclaw gateway restart

Gemini API로 전환

# 1. auth-profiles.json 업데이트
cat > ~/.openclaw/agents/main/agent/auth-profiles.json << 'EOF'
{
  "version": 1,
  "profiles": {
    "google:manual": {
      "provider": "google",
      "type": "token",
      "token": "YOUR_GEMINI_API_KEY"
    }
  }
}
EOF
chmod 600 ~/.openclaw/agents/main/agent/auth-profiles.json

# 2. 모델 변경
openclaw models set google/gemini-2.0-flash

# 3. 재시작
openclaw gateway restart

여러 모델 동시 설정

{
  "version": 1,
  "profiles": {
    "openrouter:manual": {
      "provider": "openrouter",
      "type": "token",
      "token": "sk-or-v1-xxx"
    },
    "anthropic:manual": {
      "provider": "anthropic",
      "type": "token",
      "token": "sk-ant-xxx"
    }
  }
}

모델 전환은 openclaw models set 명령으로 언제든 가능.


트러블슈팅 (실제 삽질 기록)

Q1: "No API key found for provider" 에러

원인: auth-profiles.json 형식 오류

체크리스트:

# 1. 파일 존재 확인
cat ~/.openclaw/agents/main/agent/auth-profiles.json

# 2. 필수 필드 확인
# - "version": 1
# - "profiles": { ... }
# - "type": "token"
# - provider와 모델이 일치하는지

# 3. 권한 확인
ls -la ~/.openclaw/agents/main/agent/auth-profiles.json
# -rw------- 이어야 함

Q2: Gateway가 즉시 종료됨

원인: gateway.auth.token 미설정

해결:

# 로그 확인
cat ~/.openclaw/logs/gateway.err.log | tail -10

# "no token is configured" 메시지가 있으면:
GATEWAY_TOKEN=$(openssl rand -hex 16)
openclaw config set gateway.auth.token "$GATEWAY_TOKEN"
openclaw gateway restart

Q3: Telegram botToken vs token

원인: 필드 이름 혼동

정답:

# Discord는 token
openclaw config set channels.discord.token "xxx"

# Telegram은 botToken
openclaw config set channels.telegram.botToken "xxx"

Q4: 페어링 코드가 오는데 승인 안 됨

해결:

# 정확한 코드 확인
openclaw pairing list telegram

# 대소문자 정확히 입력
openclaw pairing approve telegram EXACT_CODE

일상 운영 명령어

# 상태 확인
openclaw gateway status
openclaw doctor

# 재시작
openclaw gateway restart

# 로그 확인
cat ~/.openclaw/logs/gateway.err.log | tail -30

# 설정 확인
cat ~/.openclaw/openclaw.json

# 대시보드 (브라우저)
open http://127.0.0.1:18789/

설정 파일 위치

| 파일 | 경로 | 용도 | |------|------|------| | 메인 설정 | ~/.openclaw/openclaw.json | 채널, 모델, 게이트웨이 | | API 키 | ~/.openclaw/agents/main/agent/auth-profiles.json | 모델 인증 | | 로그 | ~/.openclaw/logs/ | 디버깅 | | LaunchAgent | ~/Library/LaunchAgents/ai.openclaw.gateway.plist | 서비스 |


빠른 설정 스크립트 (복사용)

#!/bin/bash
# OpenClaw Quick Setup Script

# 1. 설치
npm install -g node-gyp
npm install -g openclaw@latest

# 2. 플러그인
openclaw plugins enable discord
openclaw plugins enable telegram

# 3. 채널 토큰 (여기에 실제 토큰 입력)
openclaw config set channels.discord.token "YOUR_DISCORD_TOKEN"
openclaw config set channels.telegram.botToken "YOUR_TELEGRAM_TOKEN"

# 4. 모델 (OpenRouter 무료)
openclaw models set openrouter/z-ai/glm-4.5-air:free

# 5. 보안
openclaw config set gateway.bind "loopback"
openclaw config set gateway.mode "local"
GATEWAY_TOKEN=$(openssl rand -hex 16)
openclaw config set gateway.auth.token "$GATEWAY_TOKEN"

# 6. API 키 (여기에 실제 키 입력)
mkdir -p ~/.openclaw/agents/main/agent
cat > ~/.openclaw/agents/main/agent/auth-profiles.json << 'EOF'
{
  "version": 1,
  "profiles": {
    "openrouter:manual": {
      "provider": "openrouter",
      "type": "token",
      "token": "YOUR_OPENROUTER_API_KEY"
    }
  }
}
EOF
chmod 600 ~/.openclaw/agents/main/agent/auth-profiles.json

# 7. 시작
openclaw gateway install
openclaw gateway start
sleep 5
openclaw doctor

echo "Setup complete! Gateway Token: $GATEWAY_TOKEN"

참고 자료