{"id":48537342,"url":"https://github.com/blaxel-templates/template-openclaw","last_synced_at":"2026-04-08T02:31:31.450Z","repository":{"id":339217459,"uuid":"1160969075","full_name":"blaxel-templates/template-openclaw","owner":"blaxel-templates","description":"This template packages the OpenClaw gateway inside a VM and deploys it on Blaxel's infrastructure, giving you a fully managed OpenClaw instance accessible via a public URL","archived":false,"fork":false,"pushed_at":"2026-03-18T02:26:25.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-03-18T18:43:15.936Z","etag":null,"topics":["agent","openclaw","shell"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blaxel-templates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T15:30:12.000Z","updated_at":"2026-03-18T02:26:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/blaxel-templates/template-openclaw","commit_stats":null,"previous_names":["blaxel-templates/template-openclaw"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/blaxel-templates/template-openclaw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaxel-templates%2Ftemplate-openclaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaxel-templates%2Ftemplate-openclaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaxel-templates%2Ftemplate-openclaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaxel-templates%2Ftemplate-openclaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaxel-templates","download_url":"https://codeload.github.com/blaxel-templates/template-openclaw/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaxel-templates%2Ftemplate-openclaw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31537701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","openclaw","shell"],"created_at":"2026-04-08T02:31:30.889Z","updated_at":"2026-04-08T02:31:31.438Z","avatar_url":"https://github.com/blaxel-templates.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenClaw on Blaxel\n\nRun [OpenClaw](https://docs.openclaw.ai) as a Blaxel agent. This template packages the OpenClaw gateway inside a VM and deploys it on Blaxel's infrastructure, giving you a fully managed OpenClaw instance accessible via a public URL.\n\nOpenClaw's Control UI, WebSocket API, and optional channel integrations (Telegram, Discord, WhatsApp, etc.) all work out of the box.\n\n## Deploy on Blaxel\n\n### One-Click Deploy\n\nCreate an OpenClaw agent directly from the Blaxel console: [Link](ttps://app.blaxel.ai/global-agentic-network/agents/create?type=openclaw)\n\n### Custom Deploy\n\nIf you want to customize the template before deploying, use the Blaxel CLI:\n\n1. Install the [Blaxel CLI](https://docs.blaxel.ai/Get-started) and log in:\n   ```bash\n   curl -fsSL https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh | BINDIR=/usr/local/bin sudo -E sh\n   bl login YOUR-WORKSPACE\n   ```\n\n2. Create from template:\n   ```bash\n   bl new agent --template openclaw my-openclaw\n   cd my-openclaw\n   ```\n\n3. Copy `.env.example` to `.env` and fill in your values:\n   ```bash\n   cp .env.example .env\n   ```\n\n4. Make your changes, then deploy:\n   ```bash\n   bl deploy\n   ```\n\n5. Open the Control UI at the URL shown in the deploy output.\n\n### Authentication\n\nWhen deployed on Blaxel (`BL_CLOUD=true`), the auth proxy shows a login page where users authenticate with their Blaxel account via email (passwordless OTP). Only users who belong to the configured workspace (`BL_WORKSPACE`) can access the instance.\n\nThe platform automatically sets `BL_CLOUD=true` and other runtime variables when deployed on Blaxel.\n\n### Environment Variables\n\nVariables in `.env` are automatically stored in Blaxel's secret manager on deploy.\n\n#### Model Configuration\n\n| Variable | Default | Description |\n|---|---|---|\n| `OPENCLAW_MODEL` | `anthropic/claude-sonnet-4-5` | Primary model in `provider/model` format (e.g. `anthropic/claude-opus-4-6`, `openai/gpt-5.4`). |\n| `ANTHROPIC_API_KEY` | | Anthropic API key. Required if using an Anthropic model. |\n| `OPENAI_API_KEY` | | OpenAI API key. Required if using an OpenAI model. |\n| `GEMINI_API_KEY` | | Google Gemini API key. Required if using a Gemini model. |\n\n#### Authentication (set automatically by Blaxel)\n\n| Variable | Default | Description |\n|---|---|---|\n| `BL_CLOUD` | | Set to `true` by the platform. Enables OAuth2 email login instead of basic auth. |\n| `BL_WORKSPACE` | | Blaxel workspace name. When set, only users belonging to this workspace can log in. |\n| `BL_ENV` | `prod` | Blaxel environment (`prod` or `dev`). Determines which API endpoints are used for authentication. |\n\n#### Blaxel Sandbox (optional)\n\n| Variable | Description |\n|---|---|\n| `BL_API_KEY` | Blaxel API key for the sandbox plugin. Enables code execution in isolated sandboxes. |\n\n#### Advanced\n\n| Variable | Default | Description |\n|---|---|---|\n| `OPENCLAW_ALLOWED_ORIGIN` | Auto-computed | Override the allowed CORS origin for the Control UI. |\n| `COOKIE_SECRET` | Auto-generated | Secret used to sign session cookies. Auto-generated if not set. |\n\n### How It Works\n\nThe Dockerfile installs OpenClaw and bundles the Blaxel sandbox plugin. At startup:\n\n1. **`entrypoint.sh`** generates the OpenClaw config from environment variables\n2. **`auth-proxy.js`** starts as a reverse proxy on the public port, handling authentication and forwarding requests to the OpenClaw gateway\n3. The OpenClaw gateway runs on an internal port with `trusted-proxy` auth mode, relying on the `X-Forwarded-User` header from the auth proxy\n4. CORS origins are auto-computed from Blaxel's runtime variables (`BL_NAME`, `BL_WORKSPACE_ID`, `BL_REGION`)\n5. If the gateway crashes, the entrypoint automatically restarts it\n\n### Project Structure\n\n```\ntemplate-openclaw/\n├── Dockerfile          # Node.js Alpine + OpenClaw + tini\n├── entrypoint.sh       # Config generation + gateway restart loop\n├── auth-proxy.js       # Authentication proxy (email login / basic auth)\n├── setup-server.js     # First-run setup wizard (self-hosted mode)\n├── blaxel.toml         # Blaxel agent configuration\n├── .env.example        # Environment variables template\n└── openclaw-blaxel/    # Blaxel sandbox plugin\n```\n\n---\n\n## Self-Hosted Deployment\n\nYou can also run this template outside of Blaxel using Docker.\n\n### Quick Start\n\n1. Copy `.env.example` to `.env` and configure your model and credentials:\n   ```bash\n   cp .env.example .env\n   ```\n\n2. Build and run:\n   ```bash\n   make run\n   ```\n\n3. Open http://localhost:8888 in your browser. On first run, a setup wizard will guide you through configuration.\n\n### Authentication\n\nWhen not deployed on Blaxel (no `BL_CLOUD=true`), the auth proxy uses HTTP basic auth. Credentials can be set via environment variables or through the setup wizard on first run.\n\n### Environment Variables\n\n#### Required\n\n| Variable | Description |\n|---|---|\n| `OPENCLAW_MODEL` | Primary model in `provider/model` format. If not set, the setup wizard will ask. |\n| Provider API key | At least one of `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`. |\n\n#### Authentication\n\n| Variable | Description |\n|---|---|\n| `PROXY_USER` | Username for basic auth. If not set, the setup wizard will ask. |\n| `PROXY_PASSWORD` | Password for basic auth. If not set, the setup wizard will ask. |\n\n#### Blaxel Sandbox (optional)\n\nIf you want to enable the Blaxel sandbox plugin for code execution:\n\n| Variable | Description |\n|---|---|\n| `BL_WORKSPACE` | Your Blaxel workspace name. |\n| `BL_API_KEY` | Your Blaxel API key (generate one at https://app.blaxel.ai). |\n\n### Makefile Targets\n\n| Target | Description |\n|---|---|\n| `make build` | Build the Docker image. |\n| `make run` | Build and start the container (port 8888). |\n| `make stop` | Stop the container. |\n| `make restart` | Restart the container. |\n| `make logs` | Tail container logs. |\n| `make clean` | Stop and remove container + volume. |\n\n---\n\n## Troubleshooting\n\n**Can't access the UI**: Check that the auth proxy started correctly:\n```bash\nmake logs\n# Look for: [auth-proxy] Listening on port 80\n```\n\n**Origin not allowed**: The entrypoint auto-computes allowed origins from Blaxel env vars. If you access the agent from a custom domain, set `OPENCLAW_ALLOWED_ORIGIN` to that URL. For local development, the host-header fallback is enabled automatically.\n\n**Gateway keeps restarting**: The restart loop is intentional -- it recovers from OpenClaw's self-restart behavior. Check the logs for the root cause of the exit.\n\n**Email login not working**: Ensure `OAUTH_BASE_URL` and `OAUTH_INTERNAL_URL` are correctly set if running against a non-default Blaxel API. In production on Blaxel, these are not needed (auto-detected from `BL_ENV`).\n\n## Support\n\n- [OpenClaw Documentation](https://docs.openclaw.ai)\n- [Blaxel Documentation](https://docs.blaxel.ai)\n- [Blaxel Discord](https://discord.gg/G3NqzUPcHP)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaxel-templates%2Ftemplate-openclaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaxel-templates%2Ftemplate-openclaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaxel-templates%2Ftemplate-openclaw/lists"}