Principle:Openclaw Openclaw Cloud Deployment Configuration
| Knowledge Sources | |
|---|---|
| Domains | Deployment, Docker |
| Last Updated | 2026-02-06 12:00 GMT |
Overview
Cloud deployment configuration is the concept of infrastructure-as-code deployment: declaring cloud provider configuration (regions, volumes, health checks, scaling) in version-controlled files that fully describe the desired deployment state.
Description
Modern cloud platforms allow applications to declare their infrastructure requirements in configuration files that are checked into version control alongside the application source. This approach, known as infrastructure-as-code, ensures deployments are reproducible, auditable, and consistent across environments.
OpenClaw provides configuration templates for two cloud platforms: Fly.io (via fly.toml and fly.private.toml) and Render (via render.yaml). Each file declares the complete deployment specification: the Docker build configuration, environment variables, process commands, networking (ports, HTTPS, public/private exposure), compute resources (CPU, memory), persistent storage (volumes/disks), health checks, and scaling parameters.
The two Fly.io configurations illustrate a key design choice in cloud deployment: public versus private exposure. The standard fly.toml includes an [http_service] block that allocates a public URL with HTTPS termination, suitable for webhook-based messaging channels. The private fly.private.toml omits this block entirely, making the gateway accessible only via fly proxy, WireGuard, or SSH, suitable for outbound-only deployments or those using tunnel-based webhook forwarding.
Usage
Apply this concept when deploying OpenClaw to Fly.io or Render, or as a reference pattern when creating configuration for other cloud platforms (Railway, DigitalOcean App Platform, Google Cloud Run). The configuration files serve as both deployment templates and documentation of the infrastructure requirements.
Theoretical Basis
Infrastructure-as-code for containerized applications typically declares:
- Build specification: How to build the Docker image (Dockerfile path, build args).
- Process definition: What command to run, with what arguments. OpenClaw uses
node dist/index.js gateway --allow-unconfigured --port PORT --bind lan. - Environment variables: Runtime configuration including
NODE_ENV,OPENCLAW_STATE_DIR, memory limits, and authentication tokens. - Networking: Internal port, HTTPS enforcement, health check paths.
- Compute resources: VM size, memory allocation. OpenClaw recommends
shared-cpu-2xwith 2048MB on Fly.io andstarterplan on Render. - Persistent storage: Volume mounts for state data. Both platforms mount a persistent disk at
/data. - Scaling policy: Whether machines auto-stop, minimum running instances. OpenClaw disables auto-stop because the gateway maintains persistent WebSocket connections.
The private deployment variant demonstrates the principle of least privilege applied to networking: if the gateway does not need inbound webhooks (using polling or tunnel-based delivery instead), removing the public endpoint eliminates an entire attack surface.