How to Deploy OpenClaw on Windows 11: A Practical Self-Hosted AI Assistant Guide

    This guide walks through deploying OpenClaw, an open-source Node.js-based AI assistant, on Windows 11. It covers environment requirements, obtaining a model API key, installing Node.js, safely reviewing and running the install script, initial configuration, model switching strategies, accessing the web console, skill permissions, backup and recovery, and common troubleshooting steps.

    1. Scope and Prerequisites

    This article uses OpenClaw to demonstrate the complete process of deploying a self-hosted AI assistant on Windows 11. OpenClaw is an open-source project built on Node.js. Conversation history and configuration are stored locally, while model inference is handled through a cloud API. By following this guide, you will end up with a locally running AI assistant that supports model switching and web console access.

    Version numbers, install URLs, and command names may change as the project evolves. Before you start, open the project’s official repository README or documentation and verify that the install address and commands match those in this guide. Always treat the official documentation as authoritative; this article serves as an operational reference.

    2. System Requirements

    Item Requirement Notes
    Operating system Windows 11 64-bit Windows 10 64-bit may also work, but this has not been verified
    Node.js LTS version 22 or later The install script reports an error on older versions
    Memory 8GB or more recommended Model inference runs in the cloud; local resources handle sessions and skill scheduling
    Disk At least 2GB free Excludes conversation history and log growth
    Network Access to GitHub, npm, and the model provider’s API Configure a proxy first if your network is restricted

    No dedicated GPU is required. Since large model inference runs on the provider’s servers, an ordinary office laptop is sufficient.

    3. Obtaining a Model API Key

    OpenClaw calls large models through an API. Choose any provider that supports an OpenAI-compatible interface and get a key as follows:

    1. Register and log in to the provider’s developer platform;
    2. Go to the “API keys” or similar management page;
    3. Click “Create key” and copy the generated string;
    4. Save it immediately. Most platforms display the full key only once.

    An API key is equivalent to account credentials. Never commit it to a Git repository, include it in screenshots, or share it in chat groups. If you suspect a leak, revoke the key in the console immediately and generate a new one. New users can start with a lightweight model that has a free quota as the default, then switch to a high-performance model for complex tasks.

    4. Installing Node.js

    Install the LTS version using Windows’ built-in package manager, winget:

    1. winget install OpenJS.NodeJS.LTS

    After installation, close the current terminal, open a new PowerShell window, and run:

    1. node -v
    2. npm -v

    node -v should output a version starting with v22. or higher. If you get an “unrecognized” error, the PATH hasn’t refreshed. If restarting PowerShell doesn’t help, sign out and sign back in to Windows.

    5. Downloading, Reviewing, and Verifying the Install Script

    The install script downloads and executes code, so avoid piping it directly with iwr ... | iex. That pattern executes remote code without review—if the download source is compromised, malicious content could be injected. The recommended approach is: download first, inspect, then run.

    Open a regular (non-elevated) PowerShell and run the following. Replace the URL with the install script address published in the official documentation:

    1. $url = "https://openclaw.ai/install.ps1"
    2. $script = "$env:USERPROFILE\Downloads\openclaw-install.ps1"
    3. Invoke-WebRequest -Uri $url -OutFile $script
    4. notepad $script
    5. Get-FileHash $script -Algorithm SHA256

    This does three things: saves the script to your Downloads folder, opens the script in Notepad, and outputs the file’s SHA256 hash in PowerShell.

    When reviewing, focus on three things: whether the script downloads other files, whether it modifies system environment variables, and whether it accesses domains unrelated to the project. If the official SHA256 value is published, compare it with your output and continue only if they match. If no hash is published, at least confirm the script comes from the official repository, and record this hash for future comparison.

    6. Running the Install Script

    Once you’ve verified the script, run:

    1. cd $env:USERPROFILE\Downloads
    2. Unblock-File .\openclaw-install.ps1
    3. .\openclaw-install.ps1

    Unblock-File removes the “downloaded from the internet” mark attached to files fetched over the network. If the execution policy blocks the script, run the following to allow it for the current user only:

    1. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

    RemoteSigned allows local scripts to run, while remotely downloaded scripts must be signed by a trusted publisher. Do not set it to Unrestricted, which disables most script protections.

    Installation typically takes 3 to 10 minutes depending on network speed. Do not close the window during this process. If downloads are slow, check the official documentation for a mirror, or configure an npm mirror and retry.

    7. Verifying the Installation

    When installation finishes, close the current window, open a new PowerShell, and run:

    1. openclaw --version

    If a version number is output, the core program is ready. If the command isn’t found, troubleshoot in this order:

    1. where.exe openclaw
    2. $env:Path -split ';'

    If where.exe can’t find the command, check whether the install directory printed by the install script was added to your user PATH. If the directory exists but isn’t in PATH, add it manually in the environment variables settings under System Properties, then reopen the terminal.

    8. Initial Configuration

    Run the interactive wizard:

    1. openclaw onboard

    The wizard typically asks for the following in sequence:

    1. Model provider: choose the provider whose key you obtained in Section 3;
    2. API key: paste the key. If the wizard supports environment variables, prefer that option;
    3. Default model name: choose a lightweight model;
    4. Gateway port: the default is usually 18789, unless that port is already in use;
    5. Skills: on first use, enable only the skills you actually need.

    The configuration file is stored in your user directory. To view it:

    1. Get-Content "$env:USERPROFILE\.openclaw\openclaw.json"

    The following example shows the configuration structure. Field names and nesting may differ from your locally generated file—do not copy it verbatim:

    1. {
    2. "models": {
    3. "default": "lightweight model name",
    4. "providers": {
    5. "provider name": {
    6. "baseUrl": "API address provided by the provider",
    7. "apiKey": "read from environment variable or filled in"
    8. }
    9. }
    10. },
    11. "gateway": {
    12. "port": 18789,
    13. "bind": "loopback"
    14. }
    15. }

    Before editing the configuration, make a backup copy such as openclaw.json.bak. JSON syntax errors will prevent the service from starting. You can check syntax with Get-Content ... | ConvertFrom-Json.

    9. Model Switching Strategy

    You can define multiple model profiles in the configuration. Assigning models by task type balances cost and quality:

    • Everyday Q&A and short text: use a fast lightweight model with a free quota;
    • Code generation and long-form writing: switch to a more capable model;
    • Provider rate limits or outages: preconfigure a fallback model and switch manually when needed.

    Switching can be done via command-line arguments or from a dropdown menu in the web console. Switching usually doesn’t require a service restart—consult the documentation for your version.

    10. Starting the Service and Accessing the Web Console

    Run the start command:

    1. openclaw gateway

    The startup log shows the listening address and port. Open that address in a browser—commonly http://127.0.0.1:18789. From the web console you can:

    • Create new sessions and view history;
    • Adjust the model, temperature, and system prompt;
    • Enable or disable skills;
    • View usage and logs.

    By default, the service listens only on the local loopback address, so only this machine can access it. If you want to access it from other devices on your LAN, set an access token in the configuration first, then change the listening address. Never expose the admin interface to the network without authentication.

    To confirm the port is listening:

    1. Get-NetTCPConnection -LocalPort 18789 -State Listen

    Output means the service is listening. No output means the service isn’t running, or the port doesn’t match the address you’re accessing.

    11. Least-Privilege Principle for Skills

    Skills extend the assistant’s capabilities but also expand the attack surface. Follow these rules when installing skills:

    1. Enable only skills your current work actually requires;
    2. For file read/write skills, restrict access to specific directories—never grant whole-disk permissions;
    3. For command execution skills, run only in controlled environments and review each command before it runs;
    4. Before installing third-party skills, check the author, update history, and source code.

    12. Backup and Recovery

    Conversation history and configuration are the data that most need protection. A daily backup is sufficient. The following command packages the configuration directory to the D drive:

    1. $stamp = Get-Date -Format yyyyMMdd
    2. Compress-Archive -Path "$env:USERPROFILE\.openclaw" -DestinationPath "D:\backup\openclaw-$stamp.zip"

    After creating the backup, verify it’s usable. Extract the archive to a temporary folder and check that the key files exist and are well-formed:

    1. $test = "$env:TEMP\openclaw-restore-test"
    2. Expand-Archive -Path "D:\backup\openclaw-$stamp.zip" -DestinationPath $test -Force
    3. Get-Content "$test\.openclaw\openclaw.json" | ConvertFrom-Json | Out-Null
    4. Remove-Item $test -Recurse -Force

    If there are no errors, the configuration file can be read correctly. Delete the temporary directory after verification. Store backups on a different disk or cloud storage so they don’t fail along with the system drive.

    13. Common Troubleshooting

    Symptom Possible Cause Steps
    Install script download fails Network or proxy issue Verify connectivity to the script host; configure a proxy if needed
    node command not recognized PATH not refreshed Restart PowerShell, or sign out and back in
    openclaw command not found Install directory not in PATH Check the install output and add the directory to user PATH
    Service fails to start Invalid JSON in configuration Validate the config with ConvertFrom-Json and restore the backup if needed
    Port unreachable Service not running or wrong port Check with Get-NetTCPConnection and compare with the startup log