| title | Running OpenClaw Locally |
|---|---|
| description | Run OpenClaw on your own machine with Docker Compose, local volumes, and the built-in gateway UI. |
If you want to try OpenClaw without putting it directly on your host system, the easiest path is the Docker setup that ships with the main repository. This gives you a local gateway, a persistent config directory, and a workspace folder that is mounted into the container.
This playbook follows that Docker-based approach rather than the older Wrangler-style local simulation flow.
- Docker Desktop or Docker Engine with Compose support
- Git
- A terminal
- An AI provider account you can use during onboarding
- Optional: Telegram if you want to chat with your bot from your phone
git clone https://github.com/openclaw/openclaw
cd openclawThe repository includes a Docker helper script, docker-setup.sh, plus a docker-compose.yml file.
Run the setup script from the repository root:
./docker-setup.shThat script uses Docker Compose and prepares two host directories that are mounted into the container:
~/.openclawfor config, memory, tokens, and other persistent application state~/openclaw/workspacefor files the agent can read and write while it runs
Anything the agent saves into the workspace will remain available on your machine.
On first launch, OpenClaw asks a series of setup questions. One combination that has been reported to work well for a purely local install is:
- Onboarding mode:
manual - What do you want to set up?:
Local gateway (this machine)
From there, choose your model provider.
One practical option is OpenAI Codex with ChatGPT OAuth. That flow opens a browser URL, redirects to a localhost callback that will fail visibly, and then expects you to copy that final localhost URL back into OpenClaw to complete authentication.
If a networking option feels risky or unnecessary during first-time setup, skip it and get the basic gateway working first.
Once setup completes, inspect the running containers:
docker psYou should see the gateway container plus the companion CLI container from the Compose stack.
The Compose setup includes an openclaw-cli service for management commands.
Run these commands from the same directory as the repository's docker-compose.yml:
docker compose run --rm openclaw-cli statusThat is the easiest way to inspect the local instance without entering the container directly.
The local web UI listens on port 18789:
http://localhost:18789
If you open that URL directly, OpenClaw will usually tell you that authentication is required.
To generate a fresh dashboard link with the required token:
docker compose run --rm openclaw-cli dashboard --no-openOpen the URL that command prints.
Even with the dashboard token, you may still hit a pairing error such as:
disconnected (1008): pairing required
If that happens, list pending devices from inside the gateway container:
docker compose exec openclaw-gateway node dist/index.js devices listFind the pending request ID, then approve it:
docker compose exec openclaw-gateway node dist/index.js devices approve <REQUEST_ID>After approval, reload the dashboard.
Telegram is one of the simpler chat integrations for a local install.
To set it up:
- Create a bot by talking to
@BotFatheron Telegram. - Run
/newbot. - Follow the prompts and copy the bot token.
- Provide that token during OpenClaw setup.
After that, OpenClaw should send you a pairing code via Telegram. Approve it with:
docker compose run --rm openclaw-cli pairing approve telegram <CODE>At that point you should be able to message your bot from Telegram.
If you need to inspect the container or install extra packages manually, open a shell as root:
docker compose exec -u root openclaw-gateway bashUse that carefully. The default runtime user is intentionally more restricted.
The main host paths created by the Docker setup are:
| Path | Purpose |
|---|---|
~/.openclaw |
Persistent config, memory, credentials, and other OpenClaw state |
~/openclaw/workspace |
Files that the agent can access and modify |
Those mounts are what make the Docker setup practical for day-to-day local use.
The dashboard rejects me even with the token
You probably still need to approve the current device. Use devices list and devices approve against the gateway container.
The CLI command fails unexpectedly
Make sure you are running docker compose commands from the same directory as the repo's docker-compose.yml.
The OAuth callback page shows an error That can be normal during browser-based auth flows. Copy the final localhost callback URL and paste it back into OpenClaw if the prompt asks for it.
I lost the dashboard URL
Run docker compose run --rm openclaw-cli dashboard --no-open again to generate another one.
I need deeper access inside the container
Use docker compose exec -u root openclaw-gateway bash.