getting-started beginner 10 minutes

OpenClaw Getting Started: First Success on Docker (One Machine)

Run OpenClaw on a single machine with one canonical Docker path, persist config/state/workspace correctly, open the dashboard, and verify restart survivability.

By CoClaw Team •

What this page helps you do

This page gives you one bounded goal: get OpenClaw running on Docker on a single machine, then prove it survives restart with state intact.

By the end, you should have:

  • one working Docker-based OpenClaw instance
  • a known persistence boundary for config/state/workspace
  • a dashboard session you can reopen after restart

Who this is for / not for

Use this page if you want the shortest believable Docker path for first success.

This page is not for:

  • swarm or Kubernetes setups
  • reverse proxy design
  • production multi-host architecture

If you want the fastest non-Docker local path, use:

If you need deeper operations after first success, continue to:

Before you start

Confirm these basics first:

  1. Docker is installed and running:
docker --version
docker compose version
  1. You can clone and run scripts in a local repo.
  2. Port 18789 is available on your machine.

One canonical Docker path

Use this one path first. Do not optimize anything yet.

  1. Clone the OpenClaw repo and enter it:
git clone https://github.com/openclaw/openclaw.git
cd openclaw
  1. Run the official Docker setup script:
./docker-setup.sh

This path builds the image, runs onboarding in container context, starts the gateway with Docker Compose, and writes the gateway token to .env.

  1. Open the dashboard:

If the UI asks for a token, use the token printed by setup (also in .env).

Persistence sanity (config/state/workspace)

For first success, keep persistence simple and explicit:

  • Config + state root: ~/.openclaw/
  • Primary config file: ~/.openclaw/openclaw.json
  • Default workspace: ~/.openclaw/workspace

Why this matters:

  • if ~/.openclaw/ is not persisted on the host, restart behaves like a new machine
  • if workspace is not writable/persistent, runs may appear to succeed but files disappear

Quick host check:

ls -la ~/.openclaw
ls -la ~/.openclaw/workspace

First-success verification

Call first success only when all checks pass:

  1. Gateway container is running:
docker compose ps
  1. Dashboard opens at http://127.0.0.1:18789/ and accepts your token flow.
  2. Restart once, then re-check dashboard and persisted directories:
docker compose restart openclaw-gateway
docker compose ps
ls -la ~/.openclaw

If these still pass after restart, you have a valid one-machine Docker baseline.

First failure branches

A) Dashboard shows unauthorized

B) Files or state disappear after restart

C) Gateway does not stay healthy

  • check container status and logs:
docker compose ps
docker compose logs -f openclaw-gateway

What to do next

After first success, choose one next step:

Verification & references

  • Reviewed by:CoClaw Editorial Team
  • Last reviewed:March 19, 2026
  • Verified on: Docker · macOS · Linux · Windows (Docker Desktop)

Related Resources