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.
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:
- Docker is installed and running:
docker --version
docker compose version
- You can clone and run scripts in a local repo.
- Port
18789is available on your machine.
One canonical Docker path
Use this one path first. Do not optimize anything yet.
- Clone the OpenClaw repo and enter it:
git clone https://github.com/openclaw/openclaw.git
cd openclaw
- 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.
- 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:
- Gateway container is running:
docker compose ps
- Dashboard opens at
http://127.0.0.1:18789/and accepts your token flow. - 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
- reopen via the setup-generated token flow (
.envtoken), then retry - if still blocked, use /guides/openclaw-deployment-troubleshooting
B) Files or state disappear after restart
- confirm
~/.openclaw/is host-persistent and actually mounted in your Docker path - then follow /guides/openclaw-state-workspace-and-memory
C) Gateway does not stay healthy
- check container status and logs:
docker compose ps
docker compose logs -f openclaw-gateway
- then route by symptom via /guides/openclaw-deployment-troubleshooting
What to do next
After first success, choose one next step:
- Docker day-2 operations and safer upgrades:
- Persistence and permissions deep dive:
- Fast symptom-first troubleshooting:
Verification & references
- Reviewed by:CoClaw Editorial Team
- Last reviewed:March 19, 2026
- Verified on: Docker · macOS · Linux · Windows (Docker Desktop)
References
- OpenClaw docs - DashboardOfficial docs
- OpenClaw docs - Deployment troubleshootingOfficial docs
- OpenClaw docs - Install with DockerOfficial docs
- GitHub: /openclaw/openclaw.gitGitHub
- OpenClaw GitHub repositoryGitHub