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.
What You’ll Need
Section titled “What You’ll Need”- A Render account (the free tier works for testing)
- An API key from your preferred model provider
Quick Start
Section titled “Quick Start”You can get OpenClaw up and running in about five minutes by following these steps:
- Click the Deploy Button: Use the link below to start the process. Deploy to Render
- Configure Settings: Render will prompt you to set a
SETUP_PASSWORD. This password secures your initial configuration. - Wait for the Build: Render will build the Docker image and deploy your service.
- Access your URL: Once finished, your service will be live at
https://<service-name>.onrender.com.
Understanding the Blueprint
Section titled “Understanding the Blueprint”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: 1Here are the specific features this Blueprint uses:
runtime: docker: This builds the application directly from the Dockerfile in the repository.healthCheckPath: Render monitors the/healthendpoint. 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.
Choosing a plan
Section titled “Choosing a plan”| Plan | Spin-down | Disk | Best for |
|---|---|---|---|
| Free | After 15 min idle | Not available | Testing, demos |
| Starter | Never | 1GB+ | Personal use |
| Standard+ | Never | 1GB+ | 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.
After deployment
Section titled “After deployment”Complete the setup wizard
Section titled “Complete the setup wizard”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.
Access the Control UI
Section titled “Access the Control UI”You can find the main web dashboard at https://<your-service>.onrender.com/openclaw.
Manage your service
Section titled “Manage your service”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
/datadirectory. - 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.
Troubleshooting
Section titled “Troubleshooting”Service won’t start
Section titled “Service won’t start”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.
Slow cold starts
Section titled “Slow cold starts”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.
Data loss after redeploy
Section titled “Data loss after redeploy”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.
Health check failures
Section titled “Health check failures”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.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.