22 KiB
OpenClaw auf Raspberry Pi 4 – Installationsanleitung
mit OpenRouter + mailbox.org CalDAV & Tasks
Übersicht & Voraussetzungen
Diese Anleitung richtet einen OpenClaw Gateway auf einem Raspberry Pi 4 (headless, 64-bit) ein, verbindet ihn mit OpenRouter als KI-Provider und integriert mailbox.org Kalender und Aufgaben über CalDAV via vdirsyncer + khal.[^1][^2]
Du brauchst:
- Raspberry Pi 4 (2 GB+ RAM, 4 GB empfohlen) mit 64-bit Raspberry Pi OS Lite[^2]
- MicroSD ≥ 16 GB oder USB-SSD (empfohlen für Stabilität)[^2]
- SSH-Zugang
- OpenRouter API Key (
sk-or-...) – holen unter openrouter.ai/keys[^1] - mailbox.org App-Passwort mit CalDAV-Berechtigung (unter Einstellungen → Sicherheit → Applikationspasswörter)[^3][^4]
- Deine mailbox.org Kalender-URL(s) aus dem Webinterface (☰ → Eigenschaften → CalDAV URL)[^5][^6]
Wichtig: Das App-Passwort ist zwingend erforderlich – auch ohne 2FA. Externe Apps wie vdirsyncer werden seit mailbox.org Login 2.0 mit dem normalen Passwort blockiert.[^4][^7]
Hinweis: npm ist Pflicht
OpenClaw wird ausschließlich als npm-Paket distribuiert – es gibt keinen Weg daran vorbei. Der offizielle install.sh-Einzeiler übernimmt den npm-Aufruf automatisch, prüft Node.js, richtet das npm-Verzeichnis ein und vermeidet Permission-Fehler. Deshalb wird in dieser Anleitung der Einzeiler statt npm install -g openclaw direkt bevorzugt.[^8][^9][^10][^11]
Phase 1: Raspberry Pi vorbereiten
1.1 OS flashen
Mit Raspberry Pi Imager (Raspberry Pi OS Lite, 64-bit) flashen. In den erweiterten Einstellungen vorab konfigurieren:[^2]
- Hostname:
dumbass - SSH aktivieren
- Benutzername:
hans, Passwort setzen - WLAN (optional; Ethernet ist stabiler)
SD-Karte einstecken, Pi starten, per SSH verbinden:
ssh hans@dumbass
1.2 System aktualisieren & Grundpakete installieren
Der install.sh installiert fehlende Pakete zwar selbstständig nach, aber explizite Vorinstallation verhindert spawn git ENOENT-Fehler während des npm-Build-Prozesses:[^9][^8]
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential python3-pip
Warum
build-essential+python3-pip? Einige npm-Abhängigkeiten von OpenClaw (insb.sharpfür Bildverarbeitung undnode-gypfür native Addons) kompilieren C++-Code während der Installation. Auf ARM ohne Build-Tools schlägtnpm installmitnode-gyp rebuildFehler fehl.[^11][^12]
Zeitzone korrekt setzen (wichtig für Kalenderabfragen und Cron):[^2]
sudo timedatectl set-timezone Europe/Vienna
1.3 Node.js 22 installieren (Mindestanforderung)
OpenClaw erfordert Node.js 22+. Node.js 24 funktioniert ebenfalls.[^13][^14][^11]
Empfohlen – nvm (flexibles Versionsmanagement, einfach aktualisierbar):[^15]
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install 22
nvm alias default 22
node --version # → v22.x.x
npm --version # → 10.x.x
Alternative – NodeSource (systemweit, ohne nvm):
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
node --version
Achtung: Den Standard-
nodejs-APT-Paket von Raspberry Pi OS nicht verwenden – er liefert oft veraltete Versionen (v18 oder älter), die von OpenClaw abgelehnt werden.[^14][^15]
1.4 Swap prüfen (du hast bereits 4 GB Swap)
Da bereits 4 GB Swap konfiguriert sind, wird zusätzlich die Swappiness reduziert um unnötigen Swap-Druck zu vermeiden:[^2]
free -h # Swap sollte angezeigt werden
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
1.5 Pi-spezifische Optimierungen
# GPU-Speicher minimieren (kein Display benötigt)
echo 'gpu_mem=16' | sudo tee -a /boot/firmware/config.txt
# Nicht benötigte Dienste deaktivieren
sudo systemctl disable bluetooth
sudo systemctl disable cups 2>/dev/null || true
# Node.js Compile Cache (beschleunigt CLI-Aufrufe auf ARM spürbar)
grep -q 'NODE_COMPILE_CACHE' ~/.bashrc || cat >> ~/.bashrc <<'EOF'
export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
mkdir -p /var/tmp/openclaw-compile-cache
export OPENCLAW_NO_RESPAWN=1
EOF
source ~/.bashrc
node modules nachinsatlliere n
Phase 2: OpenClaw installieren & mit OpenRouter verbinden
2.1 OpenClaw installieren
Der offizielle Einzeiler prüft Node.js, richtet den npm-Prefix korrekt ein (verhindert EACCES-Fehler) und installiert alle Abhängigkeiten:[^16][^9][^11]
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
Die Installation dauert auf dem Pi 4 ca. 3–6 Minuten (npm kompiliert native Module für ARM). Nicht unterbrechen.[^16]
Nach Abschluss Umgebung neu laden und verifizieren:
source ~/.bashrc
openclaw --version
Falls openclaw: command not found – npm-Prefix wurde auf ~/.npm-global gesetzt und ist noch nicht im PATH:[^17][^9]
export PATH="$HOME/.npm-global/bin:$PATH"
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
openclaw --version
Falls sharp-Build-Fehler auftreten (kommt vor bei ARM mit globalem libvips):[^11]
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
Nach der Installation immer prüfen:
openclaw doctor
Dieser Befehl checkt Node.js-Version, npm-Installation, Config-Gültigkeit, Gateway-Status und Permission-Probleme – und sagt genau was fehlt.[^8]
2.2 Onboarding mit OpenRouter
Der schnellste Weg setzt OpenRouter direkt per CLI:[^18][^1]
openclaw onboard --auth-choice openrouter-api-key
Der Wizard fragt nach dem API Key. Alternativ als Ein-Zeiler:[^18]
openclaw onboard --auth-choice apiKey --token-provider openrouter --token "sk-or-DEINKEY"
2.3 Modell konfigurieren
Öffne ~/.openclaw/openclaw.json und trage dein gewünschtes Modell ein. Empfohlene Konfiguration mit Fallback:[^19][^20][^1]
{
"env": {
"OPENROUTER_API_KEY": "sk-or-DEINKEY"
},
"agents": {
"defaults": {
"model": {
"primary": "openrouter/anthropic/claude-sonnet-4.5",
"fallbacks": [
"openrouter/anthropic/claude-haiku-3.5"
]
},
"models": {
"openrouter/anthropic/claude-sonnet-4.5": {},
"openrouter/anthropic/claude-haiku-3.5": {}
}
}
}
}
Tipp Kostenoptimierung:
"primary": "openrouter/openrouter/auto"lässt OpenRouter automatisch das günstigste Modell für jede Anfrage wählen. Besonders sinnvoll wenn OpenClaw viele einfache Hintergrundaufgaben (Heartbeats, Status-Checks) ausführt.[^20][^1]
Modellverbindung testen:
openclaw models list
2.4 Gateway als Daemon starten
openclaw onboard --install-daemon
Status prüfen:
openclaw status
systemctl --user status openclaw-gateway.service
journalctl --user -u openclaw-gateway.service -f
Falls der Dienst nach Logout nicht weiterläuft, Lingering aktivieren:[^2]
sudo loginctl enable-linger hans
Phase 3: vdirsyncer + khal installieren (CalDAV-Stack)
Der offizielle OpenClaw CalDAV-Skill setzt auf vdirsyncer (Sync-Layer) und khal (Lese-/Schreibzugriff auf Events und Tasks).[^21][^22]
3.1 Pakete installieren
sudo apt install -y vdirsyncer khal
Verzeichnisse anlegen:
mkdir -p ~/.config/vdirsyncer
mkdir -p ~/.config/khal
mkdir -p ~/.local/share/vdirsyncer/status
mkdir -p ~/.local/share/vdirsyncer/calendars
mkdir -p ~/.local/share/vdirsyncer/tasks
3.2 CalDAV URLs von mailbox.org ermitteln
Öffne mailbox.org im Browser. Für jeden Kalender und jede Aufgabenliste:
- Kalender anklicken → ☰-Menü → Eigenschaften
- Unter CalDAV URL die vollständige URL kopieren
Beispielform: https://dav.mailbox.org/caldav/Y2FsOi8vMC80Mg[^6][^5]
Die oberste Discovery-URL
https://dav.mailbox.orgfunktioniert bei vdirsyncer direkt (automatische Collection-Erkennung), aber spezifische URLs sind zuverlässiger und vermeiden, dass ungewollte Shared-Folder auftauchen.[^23][^24]
3.3 App-Passwort sicher speichern
Das Passwort wird als geschützte Datei abgelegt (einfache, bewährte Methode):[^25]
# Datei anlegen (600 = nur für dich lesbar)
echo "DEIN_APP_PASSWORT" > ~/.config/vdirsyncer/mailbox_apppassword
chmod 600 ~/.config/vdirsyncer/mailbox_apppassword
Phase 4: vdirsyncer konfigurieren
Vollständige Konfiguration für Kalender + Aufgaben in ~/.config/vdirsyncer/config:
[general]
status_path = "~/.local/share/vdirsyncer/status/"
# ──────────────── KALENDER ────────────────
[pair mailbox_calendar]
a = "mailbox_cal_remote"
b = "mailbox_cal_local"
collections = ["from a", "from b"]
conflict_resolution = "a wins"
metadata = ["displayname", "color"]
[storage mailbox_cal_remote]
type = "caldav"
url = "https://dav.mailbox.org/caldav/DEINE_KALENDER_ID"
username = "deine@mailadresse.org"
password.fetch = ["command", "cat", "/home/hans/.config/vdirsyncer/mailbox_apppassword"]
[storage mailbox_cal_local]
type = "filesystem"
path = "~/.local/share/vdirsyncer/calendars/"
fileext = ".ics"
# ──────────────── AUFGABEN (VTODO) ────────────────
[pair mailbox_tasks]
a = "mailbox_tasks_remote"
b = "mailbox_tasks_local"
collections = ["from a", "from b"]
conflict_resolution = "a wins"
[storage mailbox_tasks_remote]
type = "caldav"
url = "https://dav.mailbox.org/caldav/DEINE_TASKS_ID"
username = "deine@mailadresse.org"
password.fetch = ["command", "cat", "/home/hans/.config/vdirsyncer/mailbox_apppassword"]
[storage mailbox_tasks_local]
type = "filesystem"
path = "~/.local/share/vdirsyncer/tasks/"
fileext = ".ics"
Wichtig: Ersetze
DEINE_KALENDER_IDundDEINE_TASKS_IDmit den tatsächlichen IDs aus Schritt 3.2.conflict_resolution = "a wins"bedeutet: im Konflikt gewinnt der Server (mailbox.org). Das ist die sicherste Einstellung.[^26][^25]
Ersten Sync durchführen:
vdirsyncer discover
vdirsyncer sync
Erwartetes Verhalten: Beim ersten Durchlauf erscheint eine Bestätigungsabfrage für neue Collections → mit
yesbestätigen.
Phase 5: khal konfigurieren
~/.config/khal/config:
[calendars]
[[mailbox_kalender]]
path = ~/.local/share/vdirsyncer/calendars/*
type = discover
[[mailbox_aufgaben]]
path = ~/.local/share/vdirsyncer/tasks/*
type = discover
[default]
default_calendar = mailbox_kalender
highlight_event_days = True
show_todos = True
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdateformat = %A, %d. %B %Y
longtimeformat = %H:%M
firstweekday = 0
Khal-Setup testen:
khal list today 7d
Phase 6: OpenClaw CalDAV-Skill installieren
openclaw skills install caldav-calendar
Oder alternativ über den Playbooks-Skill:[^22][^27]
openclaw add @asleep123/caldav-calendar
Danach OpenClaw Gateway neu starten:
systemctl --user restart openclaw-gateway.service
Du kannst jetzt z.B. via Telegram oder deinem konfigurierten Channel tippen:
- „Was habe ich morgen im Kalender?"
- „Erstelle einen Termin am 10.6. um 14 Uhr – Zahnarzt"
- „Zeig mir alle offenen Aufgaben"
Phase 7: Automatischer Sync via Cron
Damit OpenClaw immer aktuelle Kalenderdaten hat, Sync automatisieren:[^28][^26]
crontab -e
Folgende Zeilen einfügen:
# Alle 5 Minuten synchronisieren
*/5 * * * * /usr/bin/vdirsyncer sync >> ~/.local/share/vdirsyncer/sync.log 2>&1
# khal-Cache täglich um 03:00 löschen (verhindert veraltete Anzeigen)
0 3 * * * rm -f ~/.local/share/khal/khal.db
Phase 8: Dashboard-Zugriff (optional)
Das OpenClaw Control UI läuft nur lokal. Zugriff via SSH-Tunnel:[^2]
# Auf dem Raspi:
openclaw dashboard --no-open
# → zeigt lokale URL, z.B. http://127.0.0.1:18789
# Auf deinem PC (neues Terminal):
ssh -N -L 18789:127.0.0.1:18789 hans@dumbass
Dann im Browser: http://localhost:18789
Bekannte Fallstricke & Workarounds
| Problem | Ursache | Fix |
|---|---|---|
| 401-Fehler bei vdirsyncer | Normales Passwort statt App-Passwort | App-Passwort mit CalDAV-Berechtigung anlegen[^4][^29] |
| Wiederkehrende Aufgaben verschwinden | Open-Xchange-Bug: RRULE wird entfernt | Wiederkehrende Tasks nicht über CalDAV verwalten; als VEVENT anlegen[^30][^31] |
| Tasks nur in eine Richtung | Bekannter Sync-Bug | vdirsyncer discover erneut ausführen; conflict_resolution explizit setzen[^32][^33] |
| khal zeigt veraltete Daten | Cache-Problem | rm ~/.local/share/khal/khal.db und neu abfragen[^21] |
| OpenClaw liefert erfundene Termine | Kalender nicht verbunden, Agent halluziniert | Bekannte Termine als Probe gegenchecken; Logs prüfen[^34][^35] |
| khal edit schlägt fehl | Braucht TTY, nicht-interaktiver Kontext | tmux verwenden oder Events direkt als .ics bearbeiten[^21] |
| Service startet nach Reboot nicht | Kein User-Lingering | sudo loginctl enable-linger $(whoami)[^2] |
| WiFi bricht periodisch weg | Power Management | sudo iwconfig wlan0 power off (nach Reboot nötig → /etc/rc.local eintragen)[^2] |
Schnellreferenz: Wichtige Befehle
# Status prüfen
openclaw status
journalctl --user -u openclaw-gateway.service -n 50
# Manueller Kalender-Sync
vdirsyncer sync
# Heutige Termine anzeigen
khal list today
# Nächste 7 Tage
khal list today 7d
# Neuen Termin erstellen
khal new 2026-06-10 14:00 15:00 "Zahnarzt"
vdirsyncer sync # danach immer syncen!
# Modell wechseln
openclaw models set openrouter/anthropic/claude-opus-4.5
# OpenClaw-Skill aktualisieren
openclaw skills update --all
# Gateway neu starten
systemctl --user restart openclaw-gateway.service
References
-
Integration with OpenClaw | OpenRouter | Documentation - Learn how to configure OpenClaw to use OpenRouter for AI agents across multiple messaging platforms.
-
Application passwords for external programs - Knowledge Base - When using Two-Factor Authentication (2FA) for your account, you must create and use a corresponding...
-
Access security for mailbox – 2FA, app passwords, and email ... - This article provides an overview of the different functions for securing your access to mailbox – i...
-
CardDAV for Outlook and Thunderbird – CalDav Synchronizer - Mailbox.org - Once you have enabled two-factor authentication, external applications such as Outlook, Thunderbird,...
-
CalDAV-Clients – Outlook, Thunderbird, macOS, Evolution, Kontact - Im nächsten Schritt wählen Sie als Format CalDAV und als Adresse https://dav.mailbox.org/caldav/XXX ...
-
Information zu Nutzung von CalDAV/CardDAV/WebDAV und Drive ... - Mit dem neuen Login 2.0 in Kombination mit 2FA müssen für den Zugriff über CalDAV/CardDAV/WebDAV und...
-
Fix 'npm install failed for openclaw@latest' and ... - Stack Junkie - Fix npm install failed for openclaw@latest, Node version mismatches, permission errors, port conflic...
-
OpenClaw Install: Complete Installation Guide | macOS, Linux ... - Complete OpenClaw install guide for macOS, Linux, and Windows. Learn how to install OpenClaw in 10 m...
-
Install – OpenClaw - Open Source AI Coding Assistant - Install OpenClaw — installer script, npm/pnpm, from source, Docker, and more
-
OpenClaw Installation Error: Complete Fix Guide for All Platforms ... - Fix OpenClaw installation errors on macOS, Windows, and Linux. Covers Node.js version issues, Sharp/...
-
The Ultimate Guide to Fixing OpenClaw Installer NPM Install Failed ... - Fix OpenClaw npm install failed errors fast—step‑by‑step guide, environment checks, and top AI agent...
-
How to Run OpenClaw on Raspberry Pi: A Practical Setup Guide - Start by installing Raspberry Pi OS Lite. This version provides a minimal environment without a grap...
-
OpenClaw x Raspberry Pi Deployment Guide | MI - 超智諮詢 - A complete tutorial on deploying the OpenClaw AI agent on Raspberry Pi (5/4).
-
Can OpenClaw Run on Raspberry Pi? Complete Step-by- ... - Yes, OpenClaw can absolutely run on a Raspberry Pi — and it runs surprisingly well when set up corre...
-
The Complete OpenClaw Setup & Installation Guide - Sphere Partners - If you're deploying on a VPS, use the npm method or Docker instead. 2.3 Installation Method 2: npm G...
-
OpenClaw OpenRouter Setup: One API Key for Hundreds of ... - OpenClaw OpenRouter setup: connect hundreds of LLM models through one API key, configure model routi...
-
The Ultimate Guide to OpenClaw OpenRouter Setup - Optimize AI agents with OpenClaw + OpenRouter: cost‑effective, multi‑model routing, local execution,...
-
caldav-calendar skill by openclaw/skills - playbooks - This skill synchronizes and queries CalDAV calendars using vdirsyncer and khal, enabling streamlined...
-
caldav-calendar - OpenClaw Skills - How do I install caldav-calendar? Run openclaw add @asleep123/caldav-calendar in your terminal. This...
-
mailbox.org - DAVx5 - WebDAV URL: https://dav.mailbox.org/servlet/webdav.infostore/. User name: your mailbox.org email add...
-
Access calendar data from programs using CalDav - I was using the wrong url. ``` # Replace with your actual mailbox.org username and password. USERNAM...
-
Synchronise CalDAV and CardDAV data for khal and khard with ... - First we need to setup our synchronisation. The file ~/.config/vdirsyncer/config contains the config...
-
Calendar Integration | Dank Linux - Setting up khal and vdirsyncer is very user-unfriendly and convoluted, in a future release this inte...
-
CardDAV/CalDAV authentication error - mailbox User Forum - Hello since about 24 hours or so ago, I have been consistently receiving error authenticating into m...
-
Support for recurring tasks for CalDAV would be really nice - Right now, if I add a recurring task on a CalDAV client and sync it to Mailbox, the recurring tasks ...
-
Are recurring tasks not supported when syncing from Mailbox.org? - I am trying to sync my Mailbox.org tasks with my Android phone. Everything works as expected, except...
-
mailbox.org synchronization broken · Issue #948 · tasks/tasks - CALDAV server: mailbox.org Tasks version: 8.7 (current on F-droid) I first noticed this today, but I...
-
Tasks only syncing one way over CalDAV - Reddit - I have a problem with the sync between NextCloud and the Tasks Android App which uses CalDAV. This i...
-
Calendar tool returns hallucinated data when no calendar connected - When using the calendar tool with no calendar integration configured, the tool returns fabricated/ha...
-
[Bug]:Agent fabricates tool output for factual queries — calendar tool ... - I am a non-developer end user running OpenClaw 2026.4.1 in a Lume VM, and that this was discovered w...