Skip to content

How to Deploy OpenClaw on Render with Infrastructure as Code

I have spent way too many hours manually configuring servers, only to realize I forgot a specific environment variable or missed mounting a volume. It is a frustrating cycle that pulls you away from actually using the software you are trying to build. I prefer using Infrastructure as Code because it lets me define everything in a single file and get a predictable result every time.

In this guide, I will show you how to use Render Blueprints to get OpenClaw running. This approach handles your services, disks, and environment variables automatically.

You can get OpenClaw up and running in about five minutes by following these steps:

  1. Click the Deploy Button: Use the link below to start the process. Deploy to Render
  2. Configure Settings: Render will prompt you to set a SETUP_PASSWORD. This password secures your initial configuration.
  3. Wait for the Build: Render will build the Docker image and deploy your service.
  4. Access your URL: Once finished, your service will be live at https://<service-name>.onrender.com.

Render Blueprints use a render.yaml file to define your setup. I like this because it keeps your infrastructure versioned alongside your code. Here is the configuration used for OpenClaw:

services:
- type: web
name: openclaw
runtime: docker
status: starter
healthCheckPath: /health
envVars:
- key: PORT
value: "8080"
- key: SETUP_PASSWORD
sync: false # prompts during deploy
- key: OPENCLAW_STATE_DIR
value: /data/.openclaw
- key: OPENCLAW_WORKSPACE_DIR
value: /data/workspace
- key: OPENCLAW_GATEWAY_TOKEN
generateValue: true # auto-generates a secure token
disk:
name: openclaw-data
mountPath: /data
sizeGB: 1

Here are the specific features this Blueprint uses:

  • runtime: docker: This builds the application directly from the Dockerfile in the repository.
  • healthCheckPath: Render monitors the /health endpoint. If the instance becomes unhealthy, Render restarts it.
  • sync: false: This tells Render to prompt you for the value during deployment, which is perfect for secrets.
  • generateValue: true: This auto-generates a secure, random token for the gateway.
  • disk: This provides persistent storage. Your data will stay safe even if the service restarts or redeploys.
PlanSpin-downDiskBest for
FreeAfter 15 min idleNot availableTesting, demos
StarterNever1GB+Personal use
Standard+Never1GB+Production

The Blueprint defaults to the starter plan. If you want to use the free tier, you can change plan: free in your fork of the render.yaml file. Just keep in mind that the free tier does not support persistent disks, so your configuration will reset every time you deploy.

Open https://<your-service>.onrender.com/setup in your browser. Enter the SETUP_PASSWORD you created earlier, choose your model provider, and paste your API key. You can also set up messaging channels like Telegram or Discord here. Click Run setup to finish.

You can find the main web dashboard at https://<your-service>.onrender.com/openclaw.

I recommend getting familiar with these Render Dashboard features:

  • Logs: Check the Logs tab for build progress or runtime output.
  • Shell: Use the Shell tab if you need to inspect files in the /data directory.
  • Environment Variables: You can update keys in the Environment tab. Saving changes will trigger a new deployment.
  • Backups: You can download a portable backup of your configuration and workspace at any time by visiting https://<your-service>.onrender.com/setup/export.

If the deployment fails, check your logs. Ensure that the SETUP_PASSWORD is actually set in your environment variables. Also, verify that the PORT is set to 8080 to match the Dockerfile requirements.

If you are on the free tier, Render spins down your service after 15 minutes of inactivity. The first request after a break will be slow while the container boots up. You can upgrade to the Starter plan to keep it always-on.

This usually happens if you are using the free tier without a persistent disk. To keep your data, upgrade to a paid plan that supports disks or use the /setup/export tool frequently to save your config.

Render needs a 200 response from /health within 30 seconds. If your service takes too long to start, the deployment might fail. I suggest checking your build logs for errors or testing the container locally to ensure it starts quickly.

If you run into other issues, you can ask the AI Setup Assistant for help.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.