Lektion 2 von 6·10 Min Lesezeit

Installation & Konfiguration

OpenClaw lässt sich Self-hosted in Ihrer eigenen Infrastruktur betreiben — volle Datenkontrolle, kein Vendor Lock-in. In dieser Lektion richten Sie eine produktionsreife Instanz ein.

Systemvoraussetzungen

KomponenteMinimumEmpfohlen (Production)
CPU4 Cores8+ Cores
RAM8 GB16+ GB
Storage50 GB SSD200+ GB NVMe
OSLinux (Ubuntu 22.04+)Linux (Ubuntu 24.04)
Docker24.0+25.0+ mit Compose v2
DatenbankPostgreSQL 15PostgreSQL 16 mit pgvector

Docker Deployment

1. Repository klonen und Umgebung vorbereiten

git clone https://github.com/agentos/openclaw.git
cd openclaw
cp .env.example .env

2. Konfiguration anpassen

Die .env-Datei enthält alle wesentlichen Einstellungen:

# Datenbank
DATABASE_URL=postgresql://openclaw:secret@db:5432/openclaw
REDIS_URL=redis://redis:6379

# API-Schlüssel
OPENCLAW_API_KEY=oc_live_...
OPENCLAW_SECRET=your-secret-key

# Retention
TRACE_RETENTION_DAYS=90
LOG_RETENTION_DAYS=30

# Feature Flags
ENABLE_ALIGNMENT_SCORING=true
ENABLE_COMPLIANCE_MODULE=true

3. Container starten

docker compose up -d

OpenClaw startet folgende Services:

  • openclaw-api — REST/GraphQL-Endpunkt (Port 8080)
  • openclaw-worker — Async-Verarbeitung von Traces
  • openclaw-dashboard — Web-UI (Port 3000)
  • postgres — Datenbank
  • redis — Cache und Queue

4. Initiales Setup

docker compose exec api openclaw init
docker compose exec api openclaw admin create --email admin@example.com

SDK Installation

OpenClaw bietet SDKs für alle gängigen Agent-Frameworks:

# Python
pip install openclaw-sdk

# Node.js
npm install @openclaw/sdk

# Go
go get github.com/agentos/openclaw-go

SDK initialisieren (Python)

from openclaw import OpenClaw

oc = OpenClaw(
    api_key="oc_live_...",
    endpoint="https://openclaw.ihre-domain.de",
    environment="production"
)

API-Key-Management

OpenClaw verwendet ein hierarchisches Key-System:

  • Admin Keys — Vollzugriff, nur für Infrastruktur-Team
  • Project Keys — Scoped auf ein Projekt, für Agent-Entwickler
  • Read-Only Keys — Dashboard-Zugriff ohne Schreibrechte
  • Webhook Keys — Für Alerting-Integrationen

Best Practice: Verwenden Sie pro Agent-Deployment einen eigenen Project Key. So können Sie den Zugriff granular steuern und im Notfall einzelne Agents isolieren, ohne andere zu beeinflussen.