Files
docker-infrastructure/openclaw/SETUP.md
T
poprhythm f0902944e0 Document OpenClaw troubleshooting attempts
Add comprehensive troubleshooting documentation for OpenClaw auth issues:
- All configuration attempts with Ollama and Anthropic
- Error messages and findings
- Links to relevant GitHub issues and documentation
- Recommendations for future attempts

Issue: Gateway mode fails with 'No API key found' despite correct auth-profiles.json configuration with both Ollama and real Anthropic API key.
2026-02-09 03:03:56 +00:00

130 lines
4.0 KiB
Markdown

# OpenClaw Setup Guide
## Prerequisites
1. **Create storage directories:**
```bash
sudo mkdir -p /srv/openclaw/config /srv/openclaw/workspace
sudo chown -R 1000:1000 /srv/openclaw
```
2. **Create .env file on host:**
The `.env` file is already created locally at `openclaw/.env` with a generated token. You need to copy it to the deployment location:
```bash
# Copy .env to the openclaw directory where Portainer will use it
# Option 1: If running locally
cp openclaw/.env /path/to/portainer/stack/openclaw/.env
# Option 2: Add environment variables directly in Portainer stack
# (see Portainer setup below)
```
## Portainer Stack Setup
### Method 1: Via Portainer Web UI
1. Go to Portainer → Stacks → Add Stack
2. Choose "Git Repository"
3. Fill in:
- **Name:** openclaw
- **Repository URL:** `https://gitea.kolpacksoftware.com/homelab/docker-infrastructure.git`
- **Reference:** `refs/heads/main`
- **Compose path:** `openclaw/docker-compose.yml`
- **Auto update:** Enabled (5m interval recommended)
4. Add environment variables:
- `OPENCLAW_GATEWAY_TOKEN`: `27d4e63adce6c8f7c5396e8ca3f9ec5e6ff590077247fb11da03a8684ee3c711`
5. Deploy the stack
### Method 2: Via Portainer API
```bash
# Set your Portainer API token
export PORTAINER_TOKEN="your-token-here"
# Create the stack (Docker Compose mode)
curl -k -X POST "https://localhost:9443/api/stacks/create/standalone/repository" \
-H "X-API-Key: $PORTAINER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "openclaw",
"endpointId": 2,
"repositoryURL": "https://gitea.kolpacksoftware.com/homelab/docker-infrastructure.git",
"repositoryReferenceName": "refs/heads/main",
"composeFile": "openclaw/docker-compose.yml",
"repositoryAuthentication": false,
"autoUpdate": {
"interval": "5m"
},
"env": [
{
"name": "OPENCLAW_GATEWAY_TOKEN",
"value": "27d4e63adce6c8f7c5396e8ca3f9ec5e6ff590077247fb11da03a8684ee3c711"
}
]
}'
```
## Nginx Proxy Manager Configuration
Set up a proxy host for:
- **Domain:** openclaw.kolpacksoftware.com
- **Forward Hostname / IP:** openclaw (container name)
- **Forward Port:** 18789
- **⚠️ WebSocket Support:** Enable "WebSocket Support" toggle (REQUIRED - OpenClaw uses WebSocket protocol)
- **SSL:** Request Let's Encrypt certificate
- **Access List:** Create/use "Private Network Only" to restrict to 192.168.1.0/24
## Ollama Integration
Make sure Ollama is running and has models pulled:
```bash
# Check Ollama status
docker ps | grep ollama
# Pull a model if needed (from ollama directory)
docker exec -it ollama ollama pull llama3
# or
docker exec -it ollama ollama pull mistral
```
## Running the Onboarding Wizard
After the stack is deployed, run the onboarding wizard:
```bash
docker exec -it openclaw npx openclaw onboard
```
During onboarding:
1. Select **Ollama** as your model provider
2. Enter Ollama base URL: `http://ollama:11434` (since they're on the same Docker network)
3. Select which model to use (e.g., llama3, mistral)
4. Configure any messaging channels you want (optional)
## Accessing OpenClaw
- **Control UI:** https://openclaw.kolpacksoftware.com
- **Gateway Token:** `27d4e63adce6c8f7c5396e8ca3f9ec5e6ff590077247fb11da03a8684ee3c711`
## Troubleshooting
⚠️ **KNOWN ISSUE (2026-02-09)**: OpenClaw gateway mode in Docker consistently fails with "No API key found for provider 'anthropic'" despite correct auth-profiles.json configuration. See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for detailed information about all attempted solutions.
**Current Status**: Container runs and is accessible, but cannot execute AI requests with either Ollama or Anthropic API.
Check logs:
```bash
docker logs openclaw -f
```
Check if OpenClaw can reach Ollama:
```bash
docker exec -it openclaw curl http://ollama:11434
```
For detailed troubleshooting history and configuration attempts, see:
- **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)** - Complete troubleshooting log