Langsung ke konten utama

Documentation Index

Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

Langkah runtime bersama untuk instalasi Docker berbasis VM seperti GCP, Hetzner, dan penyedia VPS serupa.

Masukkan biner yang diperlukan ke dalam image

Menginstal biner di dalam container yang sedang berjalan adalah jebakan. Apa pun yang diinstal saat runtime akan hilang saat restart. Semua biner eksternal yang diperlukan oleh Skills harus diinstal saat image dibangun. Contoh di bawah hanya menampilkan tiga biner umum:
  • gog (dari gogcli) untuk akses Gmail
  • goplaces untuk Google Places
  • wacli untuk WhatsApp
Ini adalah contoh, bukan daftar lengkap. Anda dapat menginstal biner sebanyak yang diperlukan dengan pola yang sama. Jika nanti Anda menambahkan Skills baru yang bergantung pada biner tambahan, Anda harus:
  1. Memperbarui Dockerfile
  2. Membangun ulang image
  3. Me-restart container
Contoh Dockerfile
FROM node:24-bookworm

RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*

# Example binary 1: Gmail CLI (gogcli — installs as `gog`)
# Copy the current Linux asset URL from https://github.com/steipete/gogcli/releases
RUN curl -L https://github.com/steipete/gogcli/releases/latest/download/gogcli_linux_amd64.tar.gz \
  | tar -xzO gog > /usr/local/bin/gog; \
  chmod +x /usr/local/bin/gog

# Example binary 2: Google Places CLI
# Copy the current Linux asset URL from https://github.com/steipete/goplaces/releases
RUN curl -L https://github.com/steipete/goplaces/releases/latest/download/goplaces_linux_amd64.tar.gz \
  | tar -xzO goplaces > /usr/local/bin/goplaces; \
  chmod +x /usr/local/bin/goplaces

# Example binary 3: WhatsApp CLI
# Copy the current Linux asset URL from https://github.com/steipete/wacli/releases
RUN curl -L https://github.com/steipete/wacli/releases/latest/download/wacli-linux-amd64.tar.gz \
  | tar -xzO wacli > /usr/local/bin/wacli; \
  chmod +x /usr/local/bin/wacli

# Add more binaries below using the same pattern

WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY ui/package.json ./ui/package.json
COPY scripts ./scripts

RUN corepack enable
RUN pnpm install --frozen-lockfile

COPY . .
RUN pnpm build
RUN pnpm ui:install
RUN pnpm ui:build

ENV NODE_ENV=production

CMD ["node","dist/index.js"]
URL di atas adalah contoh. Untuk VM berbasis ARM, pilih aset arm64. Untuk build yang dapat direproduksi, sematkan URL rilis berversi.

Bangun dan jalankan

docker compose build
docker compose up -d openclaw-gateway
Jika build gagal dengan Killed atau exit code 137 selama pnpm install --frozen-lockfile, VM kehabisan memori. Gunakan kelas mesin yang lebih besar sebelum mencoba lagi. Verifikasi biner:
docker compose exec openclaw-gateway which gog
docker compose exec openclaw-gateway which goplaces
docker compose exec openclaw-gateway which wacli
Keluaran yang diharapkan:
/usr/local/bin/gog
/usr/local/bin/goplaces
/usr/local/bin/wacli
Verifikasi Gateway:
docker compose logs -f openclaw-gateway
Keluaran yang diharapkan:
[gateway] listening on ws://0.0.0.0:18789

Apa yang persisten di mana

OpenClaw berjalan di Docker, tetapi Docker bukan sumber kebenaran. Semua state jangka panjang harus bertahan melewati restart, rebuild, dan reboot.
KomponenLokasiMekanisme persistensiCatatan
Konfigurasi Gateway/home/node/.openclaw/Mount volume hostMencakup openclaw.json, .env
Profil autentikasi model/home/node/.openclaw/agents/Mount volume hostagents/<agentId>/agent/auth-profiles.json (OAuth, kunci API)
Kunci profil autentikasi/home/node/.config/openclaw/Mount volume hostKunci enkripsi lokal untuk material token profil autentikasi OAuth
Konfigurasi Skills/home/node/.openclaw/skills/Mount volume hostState tingkat Skill
Ruang kerja agen/home/node/.openclaw/workspace/Mount volume hostKode dan artefak agen
Sesi WhatsApp/home/node/.openclaw/Mount volume hostMempertahankan login QR
Keyring Gmail/home/node/.openclaw/Volume host + kata sandiMemerlukan GOG_KEYRING_PASSWORD
Paket Plugin/home/node/.openclaw/npm, /home/node/.openclaw/gitMount volume hostRoot paket Plugin yang dapat diunduh
Biner eksternal/usr/local/bin/Image DockerHarus dimasukkan saat build
Runtime NodeSistem berkas containerImage DockerDibangun ulang setiap build image
Paket OSSistem berkas containerImage DockerJangan instal saat runtime
Container DockerSementaraDapat di-restartAman untuk dihancurkan

Pembaruan

Untuk memperbarui OpenClaw di VM:
git pull
docker compose build
docker compose up -d

Terkait