- Updated: March 18, 2026
- 7 min read
Deploying a Multi‑Tenant Rating API on UBOS with OpenClaw – Step‑by‑Step Guide
Deploying a multi‑tenant rating API on UBOS with OpenClaw involves provisioning OpenClaw, configuring its rating plugin for tenant isolation, containerizing the API, and verifying each tenant’s endpoints—all within a few straightforward steps.
1. Introduction
Modern SaaS platforms demand robust, isolated services that can serve dozens or hundreds of customers from a single codebase. UBOS, the UBOS platform built for rapid AI‑driven application delivery, pairs perfectly with OpenClaw—a lightweight, extensible framework for building rating, review, and recommendation engines.
This guide walks technical decision‑makers and developers through a step‑by‑step deployment of a multi‑tenant rating API on UBOS using OpenClaw. By the end, you’ll have a production‑ready service that respects tenant boundaries, scales automatically, and can be extended with UBOS’s Enterprise AI platform.
2. Prerequisites
- Access to a UBOS account with permission to create services.
- Docker installed locally (for building the API container).
- Basic familiarity with YAML configuration files.
- OpenClaw source code (available from the UBOS marketplace).
- PostgreSQL or MySQL instance for persistent rating data.
Having these items ready will keep the deployment flow smooth and avoid mid‑process roadblocks.
3. Provisioning OpenClaw on UBOS
3.1 Installing UBOS
UBOS can be installed on any Linux VM, on‑premise hardware, or via a cloud marketplace image. Follow the official UBOS solutions for SMBs guide for a quick spin‑up:
- Download the UBOS installer script:
- Run the installer and accept the default configuration (UBOS will set up Docker, a reverse proxy, and a basic monitoring stack).
- Log in to the UBOS dashboard at
https://<your‑domain>/adminusing the credentials generated during installation.
curl -sSL https://ubos.tech/install.sh | bash3.2 Deploying the OpenClaw App
OpenClaw is offered as a pre‑packaged UBOS app. To provision it:
- Navigate to Apps → Marketplace in the UBOS UI.
- Search for “OpenClaw” and click Install. The platform will pull the Docker image, create a service, and expose it on a sub‑domain like
openclaw.your‑domain.com. - During installation, select a database backend (PostgreSQL is recommended for its JSONB support).
- After deployment, verify the service health by visiting the OpenClaw UI; you should see the default “Hello OpenClaw” page.
For a deeper dive into the provisioning process, see the OpenClaw hosting guide on UBOS.
4. Configuring the Rating Plugin for Multi‑Tenant Isolation
OpenClaw’s rating plugin can operate in a multi‑tenant mode, ensuring each customer’s data lives in a separate logical partition while sharing the same physical resources.
4.1 Enabling Multi‑Tenant Mode
Edit the rating-plugin.yaml configuration file located at /var/ubos/apps/openclaw/config/:
plugin:
name: rating
multiTenant: true
tenantKey: X-Tenant-ID # HTTP header used to identify the tenant
Setting multiTenant: true tells OpenClaw to enforce tenant isolation on every request.
4.2 Setting Tenant Identifiers
Each SaaS customer must be assigned a unique identifier (e.g., a UUID). Store these IDs in a Tenant Registry table within your primary database:
| Column | Type | Description |
|---|---|---|
| tenant_id | UUID | Primary key, globally unique. |
| name | VARCHAR(255) | Human‑readable tenant name. |
| api_key | VARCHAR(64) | Secret used by the tenant’s client to sign requests. |
When a client calls the rating API, it must include the header X‑Tenant‑ID: <tenant_id>. OpenClaw validates the header against the registry and automatically scopes all CRUD operations to that tenant’s data partition.
5. Deploying the Rating API
With OpenClaw ready and multi‑tenant mode enabled, the next step is to package your custom rating logic into a Docker container and register it as a UBOS service.
5.1 Building the API Container
Create a new directory rating-api/ and add a minimal Dockerfile:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
In requirements.txt include fastapi, uvicorn, and openclaw-sdk. The main.py file should instantiate the OpenClaw client, read the X‑Tenant‑ID header, and forward rating requests to the OpenClaw rating plugin.
Build the image locally:
docker build -t ubos/rating-api:latest .5.2 Deploying via UBOS Services
Push the image to a container registry accessible by UBOS (Docker Hub, GitHub Packages, or a private registry). Then create a UBOS service definition:
name: rating-api
image: ubos/rating-api:latest
replicas: 3
ports:
- containerPort: 8080
protocol: TCP
expose: true
environment:
- OPENCLAW_URL=https://openclaw.your-domain.com
- DATABASE_URL=postgres://user:pass@db.your-domain.com:5432/openclaw
Upload this YAML via the UBOS UI under Services → Create Service. UBOS will schedule three replicas behind its built‑in load balancer, automatically handling scaling and health checks.
For a visual walkthrough of UBOS service creation, explore the Workflow automation studio which can generate the YAML from a drag‑and‑drop flow.
6. Verifying the Deployment
After the service is up, perform health checks and sample API calls for multiple tenants to confirm isolation.
6.1 Health Checks
UBOS automatically creates a /healthz endpoint for each service. Test it with curl:
curl -s https://rating-api.your-domain.com/healthz | jqA successful response looks like:
{ "status": "ok", "uptime": "12h34m" }6.2 Sample API Calls per Tenant
Assume two tenants with IDs 1111‑aaaa‑bbbb‑cccc and 2222‑dddd‑eeee‑ffff. Submit a rating for a product (product ID prod‑123) as Tenant 1:
curl -X POST https://rating-api.your-domain.com/rate \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: 1111-aaaa-bbbb-cccc" \
-d '{"product_id":"prod-123","score":4.5,"comment":"Great!"}'Now submit a rating for the same product as Tenant 2:
curl -X POST https://rating-api.your-domain.com/rate \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: 2222-dddd-eeee-ffff" \
-d '{"product_id":"prod-123","score":2.0,"comment":"Not what I expected."}'When you query the average rating for prod‑123 without a tenant header, OpenClaw returns a global view (which you can disable). To see tenant‑specific aggregates, include the header:
curl -s https://rating-api.your-domain.com/average?product_id=prod-123 \
-H "X-Tenant-ID: 1111-aaaa-bbbb-cccc" | jqThe response will reflect only Tenant 1’s data, confirming proper isolation.
7. Reference to “Building a Multi‑Tenant Rating API with OpenClaw” Guide
For architects who need deeper insight into data partitioning strategies, caching layers, and advanced security (e.g., per‑tenant API keys with rate limiting), consult the comprehensive Building a Multi‑Tenant Rating API with OpenClaw guide. It covers:
- Design patterns for tenant‑aware database schemas.
- Using UBOS AI marketing agents to auto‑generate personalized rating prompts.
- Integrating OpenClaw with OpenAI ChatGPT integration for sentiment analysis on review text.
These advanced topics are optional for a basic deployment but become essential as you scale to dozens of tenants.
8. Conclusion
Deploying a multi‑tenant rating API on UBOS with OpenClaw is a repeatable process that leverages UBOS’s container orchestration, OpenClaw’s tenant‑aware plugin architecture, and modern DevOps practices. By following the steps above, you achieve:
- Zero‑touch provisioning of OpenClaw on a secure, scalable UBOS instance.
- Strict tenant isolation enforced via HTTP headers and a shared database.
- Fast, container‑native API deployment with automatic scaling and health monitoring.
- Immediate verification through health checks and tenant‑specific API calls.
Ready to accelerate your SaaS product? Explore the UBOS pricing plans to find a tier that matches your growth trajectory, and start building AI‑enhanced services today.
Take the Next Step
Join the UBOS partner program for dedicated support, early access to new integrations (like ChatGPT and Telegram integration), and co‑marketing opportunities.