설치 준비
useradd donald su - donald
cd ~ mkdir -p ~/.npm-global npm config set prefix ~/.npm-global echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc
- 로컬 형태로 설치 및 운영 하면서
- npx 를 사용하는 경우에는
cd ~ mkdir openclaw cd openclaw npm init -y
설치
NODE_LLAMA_CPP_SKIP_DOWNLOAD=true npm install openclaw@latest
NODE_LLAMA_CPP_SKIP_DOWNLOAD=true npm install -g openclaw@latest
npx openclaw doctor
openclaw doctor
cd ~/openclaw
added 665 packages, and audited 666 packages in 49s
124 packages are looking for funding
run `npm fund` for details25 high severity vulnerabilities
To address issues that do not require attention, run:
npm audit fixTo address all issues (including breaking changes), run:
npm audit fix –forceRun `npm audit` for details.
$ npm audit fixadded 5 packages, and audited 671 packages in 4s
127 packages are looking for funding
run `npm fund` for details
- 호환성에 문제 없는 선(Minor 버전)에서 안전한 버전으로 자동 업데이트
- 안전함 : 실행 후 코드가 깨질 확률이 매우 낮음
- 강제 업데이트 : 보안 문제가 없는 최신 버전 (Major 버전 변경)
- 위험함 : 경우에 따라 봇 작동 실패 가능성
설정 by onboard
npx openclaw onboard
- 실행 : “npx openclaw gateway” 입력으로 실행
- 종료 : Ctrl+C 또는 터미널 종료에 의하여 봇이 중지됨
npx openclaw onbaord --install-daemon
onboard 절차
I understand this is powerful and inherently risky. Continue?=> Yes
Onboarding mode=> QuickStart
Model/auth provider
Enter Gemini API key=> AXXXXXXXXXXXXXXXXXXXXXXXXXXXX (임의 입력값)
Default model=> google/gemini-2.5-flash
Select channel=> Telegram (Bot API)
Enter Telegram bot token=> 1234554321:AXXXXXXXXXXXXXXXXXXXXX (임의 입력값)
Configure skills now?=> no
browser: 웹 검색 (설정 필요할 수 있음)
code-interpreter: 코드 실행
Enable hooks?boot-md (Run BOOT.md on gateway startup)
command-logger (Log all command events to a centralized audit file)
session-memory (Save session context to memory when /new command is issued)
Install shell completion script?=> Yes
설정 점검
doctor 옵션을 이용한 점검
npx openclaw doctor
- config.json 문법이 맞는지 확인합니다.
- 필수 항목(API Key, 모델명 등)이 빠지진 않았는지 체크합니다.
- 예: “Gemini API 키가 없는데요?” 하고 알려줌.
- 인터넷은 잘 연결되어 있는지,
- AI 모델(Gemini)과는 통신이 되는지
- 메신저(텔레그램) 서버와 연결이 되는지
- Node.js 버전은 적절한지, 필요한 권한은 있는지 봅니다.
- 필수 디렉토리가 없는 경우 생성
- “문제 있음”을 알리는 외에, “수정할지”를 물어보고 “Y” 선택 시 알아서 수정
- 예: 누락된 설정 기본값 채워넣기 등
- 처음 설치 & 온보드 후 준비가 완료 되었는지 (설정 파일 생성이 잘 되었는지) 확인 시
- 설정을 수동으로 바꾼 직후 (openclaw.json 수정 후)
- 봇이 갑자기 응답이 없을 때
openclaw 실행
npx openclaw gateway
- 간단한 테스트 진행시 추천
- 지속적 서비스를 구성한다면 서비스(daemon) 구동으로 전환
# PM2가 실행될 때 ~/openclaw 폴더로 이동해서 실행 pm2 start "npx openclaw gateway" --name openclaw --cwd ~/openclaw
$ pm2 start "npx openclaw gateway" --name openclaw --cwd ~/openclaw [PM2] Starting /usr/bin/bash in fork_mode (1 instance) [PM2] Done. ┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐ │ id │ name │ mode │ ↺ │ status │ cpu │ memory │ ├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤ │ 0 │ openclaw │ fork │ 0 │ online │ 0% │ 40.1mb │ └────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
$ pm2 save [PM2] Saving current process list... [PM2] Successfully saved in /home/donald/.pm2/dump.pm2
pm2 stop pm2 start
- 서버 재부팅이 발생할 경우 봇이 올라오도록 하는 설정
$ pm2 startup [PM2] Init System found: systemd [PM2] To setup the Startup Script, copy/paste the following command: sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u donald --hp /home/donald
- pm2 명령으로 출력된 결과를 복사&붙여넣기 해야 생성됨
$ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u donald --hp /home/donald
- 생성된 시작 스크립트 파일
경로 : /etc/systemd/system/pm2-donald.service
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target[Service]
Type=forking
User=donald
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/home/donald/.npm-global/bin:/home/donald/.local/bin:/home/donald/bin:/usr/share/Modules/bin:/usr/bin:/bin:/usr/sbin
Environment=PM2_HOME=/home/donald/.pm2
PIDFile=/home/donald/.pm2/pm2.pid
Restart=on-failureExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill[Install]
WantedBy=multi-user.target
- 링크된 파일
경로 : /etc/systemd/system/multi-user.target.wants/pm2-donald.service
텔레그램 접근
OpenClaw: access not configured.
Your Telegram user id: 75331166
Pairing code: 8A3HIGO0
Ask the bot owner to approve with:
openclaw pairing approve telegram <code>
openclaw pairing approve telegram <code>
openclaw pairing approve telegram 8A3HIGO0
{
"version": 1,
"requests": [
{
"id": "75331166",
"code": "8A3HIGO0",
"createdAt": "2026-02-01T06:23:18.486Z",
"lastSeenAt": "2026-02-01T06:23:18.486Z",
"meta": {
"username": "yourid_plz",
"firstName": "yourname_plz"
}
}
]
}
- id : 75331166
telegram 계정 생성시 부여되는 고유id - code : 8A3HIGO0
텔레그램id 사용자가 “/start”를 실행한 경우 부여되는 페어링 코드
npx openclaw pairing approve telegram 8A3HIGO0
{
"version": 1,
"allowFrom": [
"45912865"
]
}
{
"version": 1,
"requests": []
}
{
"version": 1,
"allowFrom": [
"45912865",
"12345656"
]
}
