This guide gets you from zero to a working OpenClaw instance with its first LLM connection and web chat interface. Messaging platform connections (WhatsApp, Telegram) are covered in the next guide.
Estimated time: 20–30 minutes for a local setup, 60 minutes for a VPS.
Before You Start
What you need:
- A computer running macOS, Linux, or Windows with WSL2
- Docker installed (recommended) or Node.js 20+
- An API key from OpenAI or Anthropic — or Ollama for local models
- 4 GB RAM minimum (8 GB recommended)
- 5 GB free disk space
Choosing where to run OpenClaw:
| Option | Pros | Cons |
|---|---|---|
| Local machine | Easy, free | Only works when laptop is on |
| Home server / Raspberry Pi | Always-on, free | Requires home hardware |
| Cloud VPS | Always-on, reliable | ~₹600–900/month |
For messaging integrations to work 24/7 (so OpenClaw responds to WhatsApp at any hour), you need it running on an always-on machine. A VPS is the most reliable option — see the VPS setup guide.
Method 1: Docker (Recommended)
Docker handles all dependencies automatically. This is the easiest path.
Step 1: Install Docker
macOS:
brew install --cask docker
# Then open Docker Desktop from Applications
Ubuntu / Debian:
sudo apt update
sudo apt install docker.io docker-compose-plugin -y
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
newgrp docker
Verify:
docker --version
docker compose version
Step 2: Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw
Step 3: Configure Environment
cp .env.example .env
nano .env # or use any text editor
The minimum config to get started — pick one LLM provider:
# === Required ===
OPENCLAW_SECRET=your-random-secret-here-make-it-long
# === LLM Provider (pick one) ===
# Option A: OpenAI
OPENAI_API_KEY=sk-...
# Option B: Anthropic
ANTHROPIC_API_KEY=sk-ant-...
# Option C: Local (Ollama) — no API key needed
# OLLAMA_BASE_URL=http://localhost:11434
# === Optional (add later) ===
# TELEGRAM_BOT_TOKEN=...
# WHATSAPP_SESSION_PATH=./whatsapp-session
Generate a random secret:
openssl rand -hex 32
Step 4: Start OpenClaw
docker compose up -d
This pulls the Docker images and starts OpenClaw. First run takes 2–5 minutes to download images.
Check it's running:
docker compose logs -f openclaw
You should see:
openclaw | OpenClaw started on port 3000
openclaw | LLM provider: openai (gpt-4o)
openclaw | Memory engine: ready
openclaw | Web UI: http://localhost:3000
Step 5: Open the Web UI
Visit http://localhost:3000 in your browser.
You'll be prompted to create an admin account on first launch. After that, you'll see the web chat interface. Type something to test:
Hello! What can you do?
OpenClaw will respond using your configured LLM. If you get a response, your setup is working.
Method 2: Manual (Node.js)
If you prefer not to use Docker, or if you're setting up on a VPS where Docker isn't available:
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# Install dependencies
npm install
# Copy and configure environment
cp .env.example .env
nano .env # add your API key as above
# Build
npm run build
# Start
npm start
For production use on a VPS, run with PM2 so it restarts automatically:
npm install -g pm2
pm2 start npm --name "openclaw" -- start
pm2 save
pm2 startup # follow the printed instructions
Step 6: Write Your SOUL.md
SOUL.md is the file that defines your AI's personality, communication style, and rules. It's what makes OpenClaw feel like your assistant rather than a generic chatbot.
Create or edit soul.md in the root OpenClaw directory:
nano soul.md
A starting template:
# My AI Assistant
## Communication Style
- Be direct and concise. Skip the filler phrases.
- No "Certainly!", "Of course!", or "Great question!"
- Use plain language unless I ask for technical detail.
- Bullet points for lists. Prose for explanations.
## About Me
- I'm a developer / designer / founder (edit this)
- My timezone is IST (UTC+5:30)
- I work in [your field]
## Priorities
- Flag anything time-sensitive immediately
- Always confirm before taking irreversible actions (deleting files, sending emails)
- If you're unsure about something, say so rather than guessing
## Context
- Respond in Hindi if I write in Hindi
- For technical questions, include working code examples
- Remember tasks I mention and follow up if I forget them
Save and restart OpenClaw:
docker compose restart openclaw
# or if using PM2:
pm2 restart openclaw
Test the personality change by sending a message that would normally trigger filler phrases.
Step 7: Configure Your Default Model
In .env, you can specify exactly which model to use:
# OpenAI options
OPENAI_MODEL=gpt-4o # Best quality, higher cost
OPENAI_MODEL=gpt-4o-mini # Good quality, much cheaper
OPENAI_MODEL=o3-mini # Best for reasoning tasks
# Anthropic options
ANTHROPIC_MODEL=claude-opus-4-6 # Highest quality
ANTHROPIC_MODEL=claude-sonnet-4-6 # Best balance
ANTHROPIC_MODEL=claude-haiku-4-5-20251001 # Fastest, cheapest
For most personal use, gpt-4o-mini or claude-haiku-4-5-20251001 gives good quality at a fraction of the cost of the flagship models.
Testing Memory
One of OpenClaw's key features is persistent memory. Test it:
-
Tell it something specific:
Remember that I'm launching a project called MasterPrompting in March. -
Close the browser, reopen it, start a new conversation:
What project am I launching?
It should recall "MasterPrompting in March." This memory persists indefinitely in a local database.
Updating OpenClaw
cd openclaw
git pull origin main
docker compose down
docker compose pull
docker compose up -d
Or with Node.js/PM2:
git pull origin main
npm install
npm run build
pm2 restart openclaw
Troubleshooting
Port 3000 already in use:
# Change the port in .env:
PORT=3001
# Then access at localhost:3001
LLM not responding:
docker compose logs openclaw | grep -i "error\|api"
# Check your API key is correct in .env
# Verify you have API credits at platform.openai.com or console.anthropic.com
Memory not persisting:
Check that the data/ directory is writable:
ls -la data/
# Should be owned by your user, not root
sudo chown -R $USER:$USER data/
Docker compose not found:
# On newer Docker versions it's 'docker compose' not 'docker-compose'
docker compose up -d # no hyphen
What's Next
You have a working OpenClaw instance with web chat. The next steps:
- Connect WhatsApp and Telegram — respond on your actual messaging apps
- Customise SOUL.md — deep dive into personality and rules
- Set up a VPS for 24/7 access — run on Hostinger so it works when your laptop is off
- Add local LLM with Ollama — zero API costs