- OpenClaw ≥ 2026.4.6
- Node.js ≥ 22
- Nacos Server ≥ 2.0.3 (recommended)
openclaw plugins install @partme.ai/openclaw-nacoscd openclaw-nacos
pnpm build
npm pack
openclaw plugins install ./partme.ai-openclaw-nacos-2026.5.12.tgzopenclaw plugins install --link /path/to/openclaw-nacosdocker run -d --name nacos \
-e MODE=standalone \
-p 8848:8848 -p 9848:9848 \
nacos/nacos-server:v2.4.0Add to ~/.openclaw/openclaw.json:
openclaw gateway restartcurl "http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=openclaw-gateway"Or visit http://localhost:8848/nacos → Service Management → Service List.
Store the complete openclaw.json in Nacos and have all Gateway instances load it automatically.
Setup:
- In Nacos Console, create a config with dataId
openclaw.json, groupDEFAULT_GROUP - Paste your complete openclaw.json content
- Configure the plugin:
"configCenter": {
"enabled": true,
"primaryConfigDataId": "openclaw.json"
}Behavior: On startup, the Gateway loads its local config first, then the Nacos config replaces the base and any sharedConfigs/pluginConfigIds are layered on top. Config changes in Nacos trigger automatic re-sync with backup.
Manage plugin-specific configs per environment (dev/staging/prod).
Nacos Configs:
openclaw-weixin-dev.json → { "appId": "dev-app", ... }
openclaw-weixin-prod.json → { "appId": "prod-app", ... }
openclaw-dingtalk-dev.json → { "appKey": "dev-key", ... }
Plugin Config:
"configCenter": {
"enabled": true,
"pluginConfigIds": ["openclaw-weixin", "openclaw-dingtalk"],
"profile": "dev"
}Configs are auto-merged into plugins.entries["openclaw-weixin"].config.
Run multiple Gateway instances behind a load balancer, with Nacos providing service discovery.
Setup: Configure each instance identically:
{
"serverList": "nacos-cluster:8848",
"username": "nacos",
"password": "nacos",
"serviceName": "openclaw-gateway",
"registerIp": "10.0.0.12", // unique per instance
"metadata": { "env": "prod" }
}External services can discover Gateway instances via Nacos SDK:
# Python example
from nacos_sdk_python import NacosNamingService
naming = NacosNamingService.create_naming_service(config)
instances = await naming.list_instances("openclaw-gateway", "DEFAULT_GROUP")
for inst in instances:
webhook_url = f"http://{inst.ip}:{inst.port}{inst.metadata['hooksBasePath']}"Use the Spring-style nacos block for teams migrating from Spring Cloud Alibaba.
"nacos": {
"server-addr": "127.0.0.1:8848",
"discovery": {
"server-addr": "10.0.0.1:8848",
"namespace": "dev"
},
"config": {
"shared-configs": [
{ "data-id": "common.yml", "group": "DEFAULT_GROUP" }
]
}
}# Gateway health (includes Nacos status)
curl http://localhost:18789/health
# Nacos plugin health (component-level)
curl http://localhost:18789/nacos/health
# → { "status": "ok", "configSync": {...}, "naming": {...}, "clusterDiscovery": {...} }curl http://localhost:18789/nacos/cluster
# → { "peers": [...], "peerCount": 2, "discoveryRunning": true }curl "http://localhost:8848/nacos/v1/ns/instance/list?serviceName=openclaw-gateway"
# → JSON array of registered instances with IP, port, health, metadataBackups are stored in the OpenClaw state directory:
ls ~/.openclaw/openclaw-nacos-*.json
# openclaw-nacos-20260518140522.json
# openclaw-nacos-20260518143015.json
# Restore a backup:
cp openclaw-nacos-20260518140522.json ~/.openclaw/openclaw.json
openclaw gateway restartCheck gateway log for plugin loading errors:
tail -100 ~/.openclaw/logs/gateway.log | grep -i nacosVerify plugin is installed:
ls ~/.openclaw/extensions/openclaw-nacos/dist/index.js- Verify Nacos server is reachable:
curl http://localhost:8848/nacos/v1/console/health/readiness - Check
registerIpis correct for your network - Check
serverListpoints to the correct Nacos address - Look for registration errors in the gateway log
- Verify
configCenter.enabledistrue - Check dataId and group match what's in Nacos
- Verify namespace isolation (configCenter.namespace vs top-level namespace)
- Check Nacos auth credentials if enabled
The plugin tries to auto-detect the LAN IP. If no non-loopback IPv4 is found, it falls back to 127.0.0.1. Set registerIp explicitly:
"registerIp": "192.168.1.100"Or set the environment variable:
export OPENCLAW_NACOS_REGISTER_IP=192.168.1.100# Unit tests
pnpm test
# Watch mode
pnpm test:watch
# Type check
pnpm typecheck
# Build
pnpm build
{ "plugins": { "entries": { "openclaw-nacos": { "enabled": true, "config": { "serverList": "127.0.0.1:8848", "username": "nacos", "password": "nacos", "serviceName": "openclaw-gateway" } } } } }