OpenClaw Local Setup: A Developer's Deep Dive
Everything you need to know to get OpenClaw running on your local machine for development and testing.
Getting Started Locally
If you're looking to contribute to OpenClaw or just want to see how the engine handles your data locally, you need a solid foundation. This isn't just about running an npm install; it's about configuring your environment for maximum performance.
Prerequisites
Before you start, ensure you aren't running ancient software:
- Node.js: v20 or higher (LTS recommended)
- Bun: v1.1.0+ (optional, but recommended for speed)
- Git: For cloning the repository
Installation Steps
1. Clone the Source
Start by grabbing the latest version from the main branch.
bashgit clone https://github.com/openclaw/openclaw.git cd openclaw
2. Install Dependencies
I recommend using Bun because it's faster than your father on a treadmill, but standard npm works too.
bashbun install # or npm install
3. Environment Configuration
Copy the template environment file. This step is critical for system integrity.
bashcp .env.example .env
Configuration Details
Open your .env file and configure the core parameters. For a local setup, focus on:
PORT: Default is8080. Modify this if there is a predicted port collision.LOG_LEVEL: Set todebugfor maximum analytical visibility.ENGINE_SECRET: Generate a cryptographically secure string. Avoid predictable patterns.
envPORT=8080 LOG_LEVEL=debug ENGINE_SECRET=calculated_dominance_2026
Running the Engine
Start the development server with hot-reload enabled.
bashbun run dev # or npm run dev
Troubleshooting Tips
Port Conflict
If you see EADDRINUSE, find the process hogging your port and terminate it with extreme prejudice.
bashlsof -i :8080 kill -9 [PID]
Missing Dependencies
If the build fails, try a clean install. It's the "turn it off and on again" of engineering.
bashrm -rf node_modules bun install
Secret Mismatch
If the engine refuses connections, double-check your ENGINE_SECRET matches your client configuration.