diff --git a/docs/render.mdx b/docs/render.mdx index adfb66207..8dfaed833 100644 --- a/docs/render.mdx +++ b/docs/render.mdx @@ -2,7 +2,7 @@ title: Deploy on Render --- -Deploy Moltbot on Render using Infrastructure as Code. The included `render.yaml` Blueprint defines your entire stack declaratively, service, disk, environment variables, so you can deploy with a single click and version your infrastructure alongside your code. +Deploy Moltbot on Render using Infrastructure as Code. The included `render.yaml` Blueprint defines your entire stack declaratively—service, disk, environment variables—so you can deploy with a single click and version your infrastructure alongside your code. ## Prerequisites @@ -26,8 +26,8 @@ The wrapper handles proxy header stripping and WebSocket proxying automatically. Clicking this link will: 1. Create a new Render service from the `render.yaml` Blueprint at the root of this repo. -2. Prompt you to set `SETUP_PASSWORD` -3. Build the Docker image and deploy +2. Prompt you to set `CLAWDBOT_GATEWAY_TOKEN` (or set it in **Environment** after deploy). +3. Build the Docker image and deploy. Once deployed, your service URL follows the pattern `https://.onrender.com`. @@ -42,18 +42,16 @@ services: name: moltbot runtime: docker plan: starter - healthCheckPath: /health + dockerCommand: /bin/sh scripts/render-start.sh envVars: - key: PORT value: "8080" - - key: SETUP_PASSWORD - sync: false # prompts during deploy + - key: CLAWDBOT_GATEWAY_TOKEN + sync: false # set in Render dashboard (secret) - key: CLAWDBOT_STATE_DIR value: /data/.clawdbot - key: CLAWDBOT_WORKSPACE_DIR value: /data/workspace - - key: CLAWDBOT_GATEWAY_TOKEN - generateValue: true # auto-generates a secure token # LLM Provider API Keys (set these in Render dashboard as secrets) - key: ANTHROPIC_API_KEY sync: false @@ -77,9 +75,8 @@ Key Blueprint features used: | Feature | Purpose | |---------|---------| | `runtime: docker` | Builds from the repo's Dockerfile | -| `healthCheckPath` | Render monitors `/health` and restarts unhealthy instances | +| `dockerCommand` | Runs `scripts/render-start.sh` to create config and start the gateway | | `sync: false` | Prompts for value during deploy (secrets) | -| `generateValue: true` | Auto-generates a cryptographically secure value | | `disk` | Persistent storage that survives redeploys | ## Choosing a plan @@ -95,17 +92,14 @@ The Blueprint defaults to `starter`. To use free tier, change `plan: free` in yo ## After deployment -### Complete the setup wizard +### Set the gateway token -1. Navigate to `https://.onrender.com/setup` -2. Enter your `SETUP_PASSWORD` -3. Select a model provider and paste your API key -4. Optionally configure messaging channels (Telegram, Discord, Slack) -5. Click **Run setup** +1. In Render **Dashboard → your service → Environment**, set `CLAWDBOT_GATEWAY_TOKEN` to a long random secret (or generate one with `openssl rand -hex 32`). +2. Save changes; Render will redeploy. ### Access the Control UI -The web dashboard is available at `https://.onrender.com/moltbot`. +The web dashboard is at `https://.onrender.com/moltbot`. Open a tokenized URL (e.g. from the service logs or your own link that includes the token) or paste the token into the Control UI settings to authenticate. ## Render Dashboard features @@ -155,7 +149,7 @@ The service will automatically redeploy with the new environment variable. **Alternative: Config file method** -You can also configure API keys in the `clawdbot.json` config file using the `env` block, though environment variables are preferred for security: +You can also configure API keys in the `moltbot.json` config file (under `CLAWDBOT_STATE_DIR` or `~/.clawdbot`) using the `env` block, though environment variables are preferred for security: ```json5 { @@ -170,7 +164,7 @@ See [Model Providers](/concepts/model-providers) for a complete list of supporte ### Auto-deploy -If you use the original Moltbot repository, Render will not auto-deploy your Moltbot. To update it, run a manual Blueprint sync from the dashboard. +If you use a fork, Render will not auto-deploy from the upstream repo. To update, run a manual Blueprint sync from the dashboard or push to your connected branch. ## Custom domain @@ -190,13 +184,13 @@ For Moltbot, vertical scaling is usually sufficient. Horizontal scaling requires ## Backups and migration -Export your configuration and workspace at any time: +If your deployment exposes a setup/export endpoint, you can export configuration and workspace from: ``` https://.onrender.com/setup/export ``` -This downloads a portable backup you can restore on any Moltbot host. +Otherwise, backup the persistent disk contents (e.g. under `/data/.moltbot`) via Render Shell or your own backup process. ## Troubleshooting @@ -204,8 +198,8 @@ This downloads a portable backup you can restore on any Moltbot host. Check the deploy logs in the Render Dashboard. Common issues: -- Missing `SETUP_PASSWORD` — the Blueprint prompts for this, but verify it's set -- Port mismatch — ensure `PORT=8080` matches the Dockerfile's exposed port +- Missing `CLAWDBOT_GATEWAY_TOKEN` — set it in **Environment** (Dashboard → your service → Environment) +- Port mismatch — ensure `PORT=8080` matches the gateway port ### Slow cold starts (free tier) @@ -218,7 +212,4 @@ regularly export your config via `/setup/export`. ### Health check failures -Render expects a 200 response from `/health` within 30 seconds. If builds succeed but deploys fail, the service may be taking too long to start. Check: - -- Build logs for errors -- Whether the container runs locally with `docker build && docker run` +If Render is configured with `healthCheckPath: /health`, it expects a 200 from `/health` within 30 seconds. This blueprint does not set a health check by default. If deploys fail, check deploy logs and that `scripts/render-start.sh` runs correctly (config written under `CLAWDBOT_STATE_DIR` or `~/.moltbot`/`~/.clawdbot`, then gateway started with the token).