# Self-host OpenClaw

> A self-hosted personal AI agent gateway that connects chat apps and tools to the model provider you choose. Recommended container limit is 2 GiB. Measured use is 0.9 to 1.3 GiB, so a Levelrail VM needs at least 4096 MiB. The gateway trusts the ingress proxy through gateway.trustedProxies, written once to openclaw.json in the data volume.

- Page: https://levelrail.com/templates/openclaw/
- JSON: https://levelrail.com/templates/openclaw.json
- Category: AI
- Licence: MIT (Permissive license)
- Source: https://github.com/openclaw/openclaw
- Upstream docs: https://docs.openclaw.ai/install

## Requirements
- Memory: about 2 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 2026.10.5

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| openclaw-gateway | ghcr.io/openclaw/openclaw | 2026.10.5 | 18789 | openclaw_data -> /home/node/.openclaw |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| openclaw-gateway | OPENCLAW_CONFIG_DIR | preset |
| openclaw-gateway | OPENCLAW_GATEWAY_PORT | preset |
| openclaw-gateway | OPENCLAW_GATEWAY_TOKEN | generated |
| openclaw-gateway | OPENCLAW_STATE_DIR | preset |
| openclaw-gateway | OPENCLAW_WORKSPACE_DIR | preset |
| openclaw-gateway | TZ | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install openclaw --name my-openclaw
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain openclaw-gateway=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/openclaw/install \
  -d '{
    "name": "my-openclaw"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Open the app address, then paste the generated gateway token (OPENCLAW_GATEWAY_TOKEN in the deployment variables) to sign in.

## Questions

### Can I deploy OpenClaw on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id openclaw for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image ghcr.io/openclaw/openclaw:2026.10.5 is what you deploy there.

Self-host OpenClaw, OpenClaw docker compose file, deploy OpenClaw on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
