openclaw hosting service
Kubernetes-native platform for managing and orchestrating OpenClaw bot instances. Provides a RESTful API to create, deploy, and manage AI agent bots in a multi-tenant environment.
…Each bot runs as an isolated K8s Pod with its own Deployment + Service. ClawHost manages the full lifecycle and proxies all traffic via subdomain routing, no per-bot Ingress needed. Bot config is synced bidirectionally between PostgreSQL and the pod.
Built-in web admin panel at /admin for managing Apps and Bots. Built with Next.js + shadcn/ui, statically exported and embedded into the Go binary.
api.admin_tokenkubectl and optionally helm (v3)ClawHost does not need to run inside the K8s cluster. It only needs a kubeconfig that can reach the cluster API.
Build the image locally first, then deploy everything (ClawHost + PostgreSQL + RBAC) into your K8s cluster:
docker build -t clawhost:latest .
helm install clawhost deploy/helm/clawhost \
-n clawhost --create-namespace \
--set adminToken="my-admin-token" \
--set domain.botDomain="clawhost.loc"Verify:
kubectl -n clawhost get pods
kubectl -n clawhost port-forward svc/clawhost 18080:18080
curl http://localhost:18080/healthSee Helm values for full configuration options.
…Run ClawHost on your host, connecting to a K8s cluster via kubeconfig.
git clone https://github.com/clawhost/clawhost.git
cd clawhost
# Build admin UI + Go binary
make build
# Or step by step:
# cd web/admin && npm install && npm run build && cd ../..
# go build -o clawhost .
cp config.example.toml config.tomlStart a PostgreSQL instance:
docker run -d --name clawhost-pg \
-e POSTGRES_DB=clawhost \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 postgres:16Prepare K8s namespace and storage:
kubectl create namespace clawhost
kubectl apply -f deploy/k8s/pvc.yamlEdit config.toml - key settings for local dev:
[kubernetes]
local_dev = true # use ClusterIP for direct pod access from host
[api]
admin_token = "my-admin-token"Run:
./clawhost server
curl http://localhost:18080/healthOnce the server is running (via any option above):
…Bot WebUI is accessed via subdomains (e.g., my-bot.clawhost.loc). For local development, use Caddy to handle TLS and route all subdomains to ClawHost.
Create a Caddyfile in the project root:
# API
clawhost.loc {
tls internal
reverse_proxy localhost:18080
}
# Bot subdomains
*.clawhost.loc {
tls internal
reverse_proxy localhost:18080
}Run Caddy:
caddy runThen add DNS entries to /etc/hosts (or use a local DNS like dnsmasq):
127.0.0.1 clawhost.locFor wildcard
*.clawhost.loc,/etc/hostsdoesn't support wildcards. Use dnsmasq or set up a local DNS resolver. On macOS with OrbStack, you can also use*.orb.localdomains directly.
helm install clawhost deploy/helm/clawhost \
-n clawhost --create-namespace \
--set adminToken="my-secret-token"Key values (deploy/helm/clawhost/values.yaml):
| Parameter | Default | Description |
|---|---|---|
adminToken |
change-me |
Admin API token |
server.image.repository |
clawhost |
ClawHost image |
server.image.tag |
latest |
Image tag |
server.replicas |
1 |
Number of replicas |
postgresql.enabled |
true |
Deploy built-in PostgreSQL |
postgresql.auth.password |
postgres |
DB password |
externalDatabase.host |
"" |
External DB host (when postgresql.enabled=false) |
storage.size |
10Gi |
Shared PVC size for bot data |
openclaw.image |
1panel/openclaw:latest |
OpenClaw bot image |
openclaw.cpuLimit |
2000m |
Bot CPU limit |
openclaw.memoryLimit |
4Gi |
Bot memory limit |
domain.botDomain |
clawhost.ai |
Domain for bot subdomains and API (unless apiDomain is set separately) |
ingress.enabled |
false |
Enable ingress |
Use an external database:
helm install clawhost deploy/helm/clawhost \
-n clawhost --create-namespace \
--set adminToken="my-token" \
--set postgresql.enabled=false \
--set externalDatabase.host="db.example.com" \
--set externalDatabase.password="secret"Upgrade:
helm upgrade clawhost deploy/helm/clawhost -n clawhostUninstall:
helm uninstall clawhost -n clawhostAll manifests are in deploy/k8s/:
| File | Description |
|---|---|
namespace.yaml |
Namespace |
rbac.yaml |
ServiceAccount, Role, RoleBinding |
pvc.yaml |
Shared storage for bot data |
postgres.yaml |
PostgreSQL Deployment + Service |
secrets.yaml.example |
Secret template (copy and edit) |
configmap.yaml |
ClawHost config.toml |
deployment.yaml |
ClawHost Deployment + Service |
cronjob-cleanup.yaml |
CronJob for expired bot cleanup |
Expired bots are cleaned up automatically via a K8s CronJob that runs clawhost cleanup.
# Deploy the CronJob (default: every 2 hours)
kubectl apply -f deploy/k8s/cronjob-cleanup.yaml
# Check status
kubectl -n clawhost get cronjob clawhost-cleanup
kubectl -n clawhost get jobs --sort-by=.status.startTime
# View logs of the latest run
kubectl -n clawhost logs job/$(kubectl -n clawhost get jobs --sort-by=.status.startTime -o jsonpath='{.items[-1].metadata.name}')
# Run manually
kubectl -n clawhost create job --from=cronjob/clawhost-cleanup cleanup-manualCleanup behavior:
expires_at is older than the grace period (default 72h)deleted (database record and PVC data preserved for recovery)Configuration in config.toml:
[bot]
cleanup_grace_hours = 72 # Grace period after expiration (hours)
cleanup_batch_size = 50 # Max bots per cleanup rundocker build -t clawhost:latest .
docker run -p 18080:18080 -v ./config.toml:/app/config.toml clawhost:latestAll routes are prefixed with /bot/api/v1 and require Authorization: Bearer .
GET /health| Method | Endpoint | Description |
|---|---|---|
| POST | /bot/api/v1/admin/apps |
Create app |
| GET | /bot/api/v1/admin/apps |
List apps |
| GET | /bot/api/v1/admin/apps/:id |
Get app |
| PUT | /bot/api/v1/admin/apps/:id |
Update app |
| DELETE | /bot/api/v1/admin/apps/:id |
Delete app |
| POST | /bot/api/v1/admin/apps/:id/reset-token |
Reset app API token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /bot/api/v1/admin/bots/upgrade |
Upgrade all bots |
| POST | /bot/api/v1/admin/bots/:id/upgrade |
Upgrade specific bot |
| Method | Endpoint | Description |
|---|---|---|
| POST | /bot/api/v1/bots |
Create bot |
| GET | /bot/api/v1/bots?user_id=xxx |
List bots |
| GET | /bot/api/v1/bots/:id |
Get bot |
| PUT | /bot/api/v1/bots/:id |
Update bot |
| DELETE | /bot/api/v1/bots/:id |
Delete bot |
| POST | /bot/api/v1/bots/:id/start |
Start bot |
| POST | /bot/api/v1/bots/:id/stop |
Stop bot |
| POST | /bot/api/v1/bots/:id/restart |
Restart bot |
| GET | /bot/api/v1/bots/:id/status |
Get bot status |
| GET | /bot/api/v1/bots/:id/connect |
Get connection info |
| POST | /bot/api/v1/bots/:id/reset-token |
Reset bot token |
| Method | Endpoint | Description |
|---|---|---|
| GET | /bot/api/v1/bots/:id/skills |
List skills |
| PUT | /bot/api/v1/bots/:id/skills/:name |
Upsert skill |
| DELETE | /bot/api/v1/bots/:id/skills/:name |
Delete skill |
| Method | Endpoint | Description |
|---|---|---|
| POST | /bot/api/v1/bots/:id/channels |
Add channel |
| GET | /bot/api/v1/bots/:id/channels |
List channels |
| DELETE | /bot/api/v1/bots/:id/channels/:channel |
Remove channel |
| GET | /bot/api/v1/bots/:id/channels/:channel/pairing |
List pairing requests |
| POST | `/bot/api/v1/bots/:id/channels/:channel/pairing/a |
No open issues yet, or sync has not completed.