Home Tutorials Categories Skills About
ZH EN JA KO
Installation

Complete Guide to Installing OpenClaw on Windows

· 16 min read

Introduction

OpenClaw is an open-source, self-hosted AI assistant platform that connects to multiple messaging channels such as WhatsApp, Telegram, and Discord, while supporting mainstream large language models including Claude, OpenAI, and Ollama. This article provides a detailed walkthrough of installing and configuring OpenClaw on Windows.

System Requirements

Before starting the installation, make sure your system meets the following requirements:

Item Minimum Recommended
Operating System Windows 10 21H2 Windows 11 23H2+
Node.js 22.0+ 22 LTS latest
Memory 2 GB 4 GB+
Disk Space 500 MB 2 GB+
Network Internet access Stable broadband connection

Step 1: Install Node.js

OpenClaw requires Node.js 22 or higher. We recommend using nvm-windows to manage Node.js versions, making it easy to switch between multiple versions.

Option A: Using nvm-windows (Recommended)

  1. Go to the nvm-windows releases page and download the latest nvm-setup.exe.

  2. Run the installer and follow the prompts to complete the installation.

  3. Open PowerShell as Administrator and run the following commands:

# List available Node.js versions
nvm list available

# Install Node.js 22 LTS
nvm install 22

# Switch to Node.js 22
nvm use 22

# Verify the installation
node --version
npm --version

Option B: Direct Node.js Installation

Go to the Node.js website and download the 22 LTS Windows installer. Run the installer and check the "Automatically install the necessary tools" option.

After installation, open a new PowerShell window to verify:

node --version
# Output should be v22.x.x

npm --version
# Output should be 10.x.x or higher

Step 2: Install OpenClaw

Open PowerShell and run the global install command:

npm install -g openclaw@latest

After installation, verify it was successful:

openclaw --version

If you see the version number in the output, the installation was successful.

Common Installation Issues

If you encounter permission errors, try the following:

# Method 1: Set the npm global install directory
npm config set prefix "$env:APPDATA\npm"

# Method 2: Run PowerShell as Administrator and re-run the install command
npm install -g openclaw@latest

If you encounter network issues, you can configure an npm mirror:

# Use the Taobao mirror registry
npm config set registry https://registry.npmmirror.com

# Restore the official registry after installation
npm config set registry https://registry.npmjs.org

Step 3: Initial Configuration

The first time you run OpenClaw, you need to complete the setup wizard:

openclaw onboard

The wizard will guide you through the following settings:

  1. Select an AI model provider — supports Claude, OpenAI, Ollama, Gemini, OpenRouter, and more
  2. Enter your API key — provide the appropriate key for your chosen provider
  3. Select messaging channels — choose which messaging platforms to connect
  4. Set the gateway port — defaults to 18789

Once configured, the settings file is saved at:

%USERPROFILE%\.config\openclaw\openclaw.json5

You can open this file with any text editor to make manual changes.

Step 4: Start OpenClaw

openclaw up

After starting, you should see output similar to:

[OpenClaw] Gateway started on port 18789
[OpenClaw] Model provider: Claude (claude-sonnet-4-20250514)
[OpenClaw] Channels: ready
[OpenClaw] Dashboard: http://localhost:18789/dashboard

Open your browser and navigate to http://localhost:18789/dashboard to access the admin panel.

Check Running Status

# Check running status
openclaw doctor

# View logs
openclaw logs

# Restart the service
openclaw restart

Step 5: Configure Windows Environment Variables

To ensure OpenClaw works correctly in any terminal window, it's a good idea to check and configure your system environment variables.

# Check if the current PATH includes the npm global directory
$env:PATH -split ';' | Where-Object { $_ -like '*npm*' }

# If not, add it manually
[System.Environment]::SetEnvironmentVariable(
    'PATH',
    "$env:PATH;$env:APPDATA\npm",
    'User'
)

Step 6: Set Up as a Windows Service (Optional)

If you want OpenClaw to start automatically when the system boots, you can use node-windows to register it as a Windows service.

Install node-windows

npm install -g node-windows

Create the Service Installation Script

Create an install-service.js file in any directory:

const { Service } = require('node-windows');
const path = require('path');

// Find the actual path of openclaw
const openclawPath = path.join(
  process.env.APPDATA, 'npm', 'node_modules', 'openclaw', 'bin', 'openclaw.js'
);

const svc = new Service({
  name: 'OpenClaw',
  description: 'OpenClaw AI Assistant Platform',
  script: openclawPath,
  scriptOptions: 'up',
  nodeOptions: [],
  workingDirectory: process.env.USERPROFILE,
});

svc.on('install', () => {
  console.log('OpenClaw service installed, starting...');
  svc.start();
});

svc.on('start', () => {
  console.log('OpenClaw service started');
});

svc.install();

Run as Administrator:

node install-service.js

Manage the Service

After installation, you can find the OpenClaw service in Windows Service Manager, or manage it via command line:

# Check service status
Get-Service -Name 'OpenClaw'

# Stop the service
Stop-Service -Name 'OpenClaw'

# Start the service
Start-Service -Name 'OpenClaw'

# Restart the service
Restart-Service -Name 'OpenClaw'

Step 7: Configure Windows Firewall

If you need to access OpenClaw from other devices on your local network, you'll need to open the firewall port:

# Run as Administrator
New-NetFirewallRule `
  -DisplayName "OpenClaw Gateway" `
  -Direction Inbound `
  -Protocol TCP `
  -LocalPort 18789 `
  -Action Allow

Once opened, other devices on the local network can access the OpenClaw Dashboard at http://YOUR_IP:18789.

PowerShell Execution Policy

If you encounter a "script cannot be loaded" error when running OpenClaw, you may need to adjust the PowerShell execution policy:

# Check current policy
Get-ExecutionPolicy

# Allow local scripts
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Tips for Windows Terminal

We recommend using Windows Terminal for OpenClaw. You can create a dedicated profile:

  1. Open Windows Terminal Settings
  2. Click "Add a new profile"
  3. Set the name to OpenClaw
  4. Set the command line to: pwsh -NoExit -Command "openclaw up"
  5. Set the starting directory to %USERPROFILE%

This way, OpenClaw will start automatically whenever you open this profile.

Verify the Installation

After completing the steps above, run the diagnostic command to confirm everything is working:

openclaw doctor

This command checks:

  • Whether the Node.js version meets the requirements
  • Whether the configuration file is valid
  • Whether the network connection is working
  • Whether the configured model providers are available
  • Whether the configured messaging channels are connected

Summary

You have now completed the installation and configuration of OpenClaw on Windows. Next, you can:

  • Read the configuration file guide to learn more about the openclaw.json5 settings
  • Connect your preferred messaging platforms
  • Create custom skill plugins
  • Deploy multiple AI models and configure intelligent routing

If you encounter any issues, run openclaw doctor for a self-check, or consult the troubleshooting documentation.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms