I wanted to run Clawdbot—an AI chatbot framework—on Windows WSL, but there was a catch: I needed to use my existing Claude Code subscription instead of paying for separate API access. Here's how I got it working.
The Authentication Challenge
Clawdbot supports multiple authentication methods, but most require paid API access. If you have a Claude Code subscription, you can leverage its OAuth mechanism instead. The trick? Claude Code CLI must be inside the Docker container.
Here's why this setup is required:
| Requirement | Why |
|---|---|
| Claude Code CLI in container | Clawdbot uses Claude Code's OAuth mechanism |
Mount ~/.claude credentials |
Where Claude Code stores authentication |
Set HOME=/home/node
|
So Claude Code finds the credentials |
Other auth methods won't work with your subscription:
- Anthropic API key requires paid API access
- Setup-token paste has incompatible format
- Claude Code CLI OAuth uses your subscription
Prerequisites
Before starting, make sure you have:
- Windows with WSL 2 (Ubuntu 22.04)
- Claude Code CLI installed and authenticated in WSL
- Internet connection
If you haven't installed Claude Code yet:
npm install -g @anthropic-ai/claude-code && claude
Step 1: Install Docker Engine in WSL
First, set up Docker in your WSL environment:
# Update package index
sudo apt-get update
# Install required packages
sudo apt-get install -y ca-certificates curl gnupg
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add your user to docker group
sudo usermod -aG docker $USER
# Start Docker service
sudo service docker start
Log out and back into WSL for the group change to take effect, then verify:
docker --version
docker compose version
docker run hello-world
Step 2: Clone and Build Clawdbot
mkdir -p ~/GIT/clawdbot-project
cd ~/GIT/clawdbot-project
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
./docker-setup.sh
During the onboarding prompts, use these settings:
| Prompt | Value |
|---|---|
| Security warning | Yes (continue) |
| Onboarding mode | QuickStart |
| Model/auth provider | Skip for now |
| Gateway bind | lan |
| Gateway auth | token |
| Skills | Skip for now |
| Hooks | Skip for now |
Step 3: Build Custom Image with Claude Code
Here's the key part. Create a custom Dockerfile that includes Claude Code CLI:
cd ~/GIT/clawdbot-project
cat > Dockerfile.custom << 'EOF'
FROM clawdbot:local
# Install Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code
# Mount point for Claude credentials
VOLUME /home/node/.claude
EOF
docker build -t clawdbot-with-claude -f Dockerfile.custom .
Step 4: Create Docker Compose Override
Create an override file to use the custom image and mount your Claude credentials:
# ~/GIT/clawdbot-project/clawdbot/docker-compose.override.yml
services:
clawdbot-gateway:
image: clawdbot-with-claude
environment:
HOME: /home/node
volumes:
- ~/.claude:/home/node/.claude
clawdbot-cli:
image: clawdbot-with-claude
environment:
HOME: /home/node
volumes:
- ~/.claude:/home/node/.claude
Save this to ~/GIT/clawdbot-project/clawdbot/docker-compose.override.yml.
Step 5: Configure Dashboard Access
Enable insecure auth for local dashboard access by editing ~/.clawdbot/clawdbot.json. Add this inside the "gateway" section:
"controlUi": {
"allowInsecureAuth": true
}
Also change "bind": "loopback" to "bind": "lan" if you want to access it from your network.
Step 6: Start and Test
Start the gateway:
cd ~/GIT/clawdbot-project/clawdbot
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d clawdbot-gateway
Test the agent:
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm clawdbot-cli agent --local --session-id test -m "Hello!"
You should get a response from Claude.
Accessing the Dashboard
Get your gateway token:
grep CLAWDBOT_GATEWAY_TOKEN ~/GIT/clawdbot-project/clawdbot/.env
Then open http://127.0.0.1:18789/?token=YOUR_TOKEN_HERE in your browser.
Bonus: Adding WhatsApp
WhatsApp is surprisingly easy to set up—it uses QR code login like WhatsApp Web.
cd ~/GIT/clawdbot-project/clawdbot
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm clawdbot-cli configure
Select Channels → WhatsApp and configure:
- Personal phone mode: Yes
- dmPolicy: allowlist
- allowFrom: Your phone number (E.164 format like +1555123456)
Then link your phone:
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm clawdbot-cli channels login
Scan the QR code with WhatsApp → Settings → Linked Devices → Link a Device.
Quick Reference Commands
Click to expand common commands
# Start gateway
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d clawdbot-gateway
# Stop gateway
docker compose -f docker-compose.yml -f docker-compose.override.yml down
# View logs
docker compose -f docker-compose.yml -f docker-compose.override.yml logs -f clawdbot-gateway
# Test agent
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm clawdbot-cli agent --local --session-id test -m "Hello"
Troubleshooting
Docker permission denied: Run sudo usermod -aG docker $USER and log out/in.
Claude credentials not working: Re-authenticate with claude /login in WSL.
Dashboard shows "pairing required": Ensure controlUi.allowInsecureAuth: true is in your config.
No response from agent: Check that HOME=/home/node is set and ~/.claude is mounted in your override file.
Wrapping Up
The key insight here is that Claude Code's OAuth tokens can be shared with containerized applications by mounting the credentials directory. This pattern works for any Docker-based tool that supports Claude Code authentication.
OpenClaw 🦞 — Your assistant, on your devices, in your chats
OpenClaw is a personal AI assistant that runs on your devices and meets you in the channels you already use. It is designed for a single operator and connects models, tools, messaging channels, and optional companion apps through one Gateway.
Website · Docs · Getting started · Showcase · FAQ · Vision · DeepWiki
Install
The installer supports macOS, Linux, and Windows. It provisions a supported Node.js runtime when needed.
# macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
Already manage Node.js? Install the published package instead (Node 22.22.3+, 24.15+, or 25.9+):
npm install -g openclaw@latest
See the installation guide for npm 12 lifecycle-script requirements, Docker, Nix, and other deployment paths.
Quick start
openclaw onboard --install-daemon
openclaw gateway status
openclaw dashboard
Onboarding verifies model…
Have you tried running AI assistants in Docker? What authentication challenges did you face? Share in the comments!

Top comments (0)