Linux 설치
예상 소요시간: 20-30분
목표: Linux에 OpenClaw 설치 및 실행
지원 배포판
- Ubuntu 20.04 LTS 이상 권장
- Debian 11+
- Fedora 38+
- Arch Linux
- CentOS/RHEL 8+
Ubuntu/Debian 설치
1단계: 시스템 업데이트
sudo apt-get update && sudo apt-get upgrade -y2단계: 필수 패키지 설치
sudo apt-get install -y \ curl \ git \ build-essential \ python3 \ python3-pip \ pkg-config3단계: Node.js 설치
# NodeSource 저장소curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt-get install -y nodejs
# 확인node --version # v22.x.x4단계: OpenClaw 설치
curl -fsSL https://openclaw.ai/install.sh | bash또는:
npm install -g openclaw@latestFedora 설치
# 시스템 업데이트sudo dnf update -y
# 필수 패키지sudo dnf install -y curl git gcc-c++ make python3
# Node.jssudo dnf install -y nodejs22
# OpenClawnpm install -g openclaw@latestArch Linux 설치
# 시스템 업데이트sudo pacman -Syu
# 필수 패키지sudo pacman -S curl git base-devel python3 nodejs npm
# OpenClawnpm install -g openclaw@latest시스템 서비스 설정
systemd 서비스 생성
# 사용자 서비스 디렉토리 생성mkdir -p ~/.config/systemd/user
# 서비스 파일 생성cat > ~/.config/systemd/user/openclaw.service << 'EOF'[Unit]Description=OpenClaw GatewayAfter=network.target
[Service]Type=simpleExecStart=%h/.npm-global/bin/openclaw gatewayRestart=alwaysRestartSec=10Environment="NODE_ENV=production"
[Install]WantedBy=default.targetEOF
# 서비스 활성화systemctl --user daemon-reloadsystemctl --user enable openclawsystemctl --user start openclaw
# 자동 시작 확인systemctl --user status openclaw로그 확인
journalctl --user -u openclaw -f방화벽 설정
UFW (Ubuntu)
# 게이트웨이 포트 열기sudo ufw allow 18789/tcp
# (선택) 외부 접근 제한sudo ufw allow from 192.168.1.0/24 to any port 18789firewalld (Fedora/RHEL)
sudo firewall-cmd --permanent --add-port=18789/tcpsudo firewall-cmd --reload서버/헤드리스 설치
GUI 없는 서버에 설치하는 경우:
# 비대화형 설치export OPENCLAW_NONINTERACTIVE=1curl -fsSL https://openclaw.ai/install.sh | bash
# 수동 설정openclaw onboard --no-browser설정 파일 직접 작성
~/.openclaw/openclaw.json:
{ "gateway": { "port": 18789, "auth": { "mode": "token", "token": "your-secure-token-here" } }, "models": { "default": { "provider": "anthropic", "apiKey": "sk-ant-..." } }}Docker 대안
Linux 서버에서는 Docker 설치를 권장합니다:
# Docker 설치sudo apt-get install -y docker.io docker-compose
# OpenClaw 컨테이너 실행docker run -d \ --name openclaw \ -p 18789:18789 \ -v ~/.openclaw:/data \ openclaw/openclaw:latest자세한 내용은 Docker 설치 가이드 참고
흔한 문제
문제: Permission denied
해결책:
# npm 전역 디렉토리 변경mkdir ~/.npm-globalnpm config set prefix '~/.npm-global'echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrcsource ~/.bashrc문제: 포트 충돌
해결책:
# 사용 중인 프로세스 확인sudo lsof -i :18789sudo ss -tlnp | grep 18789
# 다른 포트 사용openclaw gateway --port 18790문제: 메모리 부족
해결책:
- 스왑 공간 추가
- 가벼운 모델 사용 (Groq 등)
- 로컬 모델 대신 API 사용