Skip to content

Complete OpenClaw & Local LLM Setup Guide

This guide covers the complete end-to-end installation of a local AI agent environment. We will configure Ollama on a Windows host machine, deploy an Ubuntu virtual machine, and bridge the two networks to run OpenClaw seamlessly.

Before beginning, download all necessary installers:


We start by installing the LLM engine directly on the Windows host to take full advantage of your native GPU hardware.

  1. Run the downloaded Ollama installer and complete the setup.
  2. Open PowerShell or Command Prompt as an Administrator.
  3. Pull and run the Qwen3.5 model by executing:
    bash
    ollama run qwen3.5:9b

Expose Ollama to the Local Network By default, Ollama only listens to localhost. We must configure it to listen to your network so the Ubuntu VM can communicate with it.

Open the Windows Start Menu, search for Environment Variables, and select Edit the system environment variables.

Click Environment Variables… at the bottom.

Under System variables, click New.

Variable name: OLLAMA_HOST

Variable value: 0.0.0.0

Click OK and restart the Ollama application in your Windows system tray.

Windows Firewall Configuration We must open port 11434 on the Windows host to allow incoming connections from the VMware environment. Run this command in Administrator PowerShell:

PowerShell
New-NetFirewallRule -DisplayName "Ollama API" -Direction Inbound -LocalPort 11434 -Protocol TCP -Action Allow

Step 3: Virtual Machine Setup (VMware & Ubuntu)

Section titled “Step 3: Virtual Machine Setup (VMware & Ubuntu)”

Install VMware Workstation using the setup file.

Create a New Virtual Machine, select the Ubuntu 26.04 ISO, and allocate your preferred RAM and CPU cores.

Network Setting: Set the VM network adapter to NAT (Recommended) or Bridged.

Proceed through the standard Ubuntu OS installation wizard.

Post-Installation Integration Once logged into Ubuntu, open the Terminal (Ctrl + Alt + T). We need to install open-vm-tools to ensure your display drivers, network routing, sound, and kernel integrations function perfectly with VMware.

bash
# Update package lists
sudo apt update
# Upgrade existing packages
sudo apt upgrade -y
# Install VMware integration tools
sudo apt install -y open-vm-tools-desktop
# Reboot to apply kernel changes
sudo reboot

Step 4: Connecting Ubuntu to the Windows Host

Section titled “Step 4: Connecting Ubuntu to the Windows Host”

To connect OpenClaw (on Ubuntu) to Ollama (on Windows), you need the correct IP address.

Which IP should you use? You should use your Host Windows Real IP (your local LAN IP). Because VMware’s NAT routes traffic through the host, the VM can natively resolve your Windows machine’s physical network address.

How to find it:

Open PowerShell on your Windows host.

Run ipconfig.

Look for the IPv4 Address under your main Ethernet or Wi-Fi adapter (e.g., 192.168.1.15).

Write this IP address down. You will need it to configure OpenClaw.

OpenClaw requires a modern version of Node.js. We will install Node.js using curl, and then install OpenClaw globally via npm.

Open your Ubuntu Terminal and run:

bash
# 1. Download and configure the Node.js 22.x LTS repository
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# 2. Install Node.js and npm
sudo apt install -y nodejs
# 3. Verify installation
node -v
npm -v
# 4. Install OpenClaw globally
curl -fsSL https://openclaw.ai/install.sh | bash

Instead of writing configuration files from scratch, we will use OpenClaw’s built-in setup wizard to generate a stable baseline, then edit the advanced parameters using Ubuntu’s graphical text editor to prevent syntax mistakes.

Open your Ubuntu Terminal and run the initialization wizard:

bash
openclaw onboard

Follow the on-screen prompts. When asked for the LLM Gateway or Host IP, enter your Windows Real IP (e.g., 192.168.X.X).

Editing Advanced Parameters Once the wizard completes, we need to fine-tune the context length and max tokens for the Qwen3.5 model. Because JSON files are highly sensitive to missing commas or brackets, we will use the desktop text editor instead of the terminal.

Run this command to open the configuration file in a visual editor:

bash
xdg-open ~/.openclaw/openclaw.json

(Note: If xdg-open does not launch your editor, you can also use gnome-text-editor ~/.openclaw/openclaw.json).

Scroll down to the agents block and locate your model list. Update the default parameters to maximize the context window:

"agents": {
"defaults": {
"model": "qwen3.5:9b",
"models": {
"contextLength": 65536,
"maxTokens": 8192
}
}
}

Save the file using Ctrl + S and close the text editor.

Finally, start the OpenClaw Gateway to verify everything is routing correctly:

bash
openclaw gateway status

OpenClaw is built with strict security by default. The very first time you try to access the web dashboard, it requires a “Device Pairing” approval from the terminal to prove you are the physical owner of the machine.

  1. Launch the dashboard link from your terminal:

    Ubuntu Terminal
    openclaw dashboard
  2. Hold Ctrl and click the generated localhost link(http://127.0.0.1:18789) to open it in your Ubuntu web browser.

  3. You will see a red Device pairing required warning box. This is completely normal.

  4. Leave the browser open, go back to your Ubuntu terminal, and type the exact approval command shown in your browser window. It will look exactly like this:

bash
openclaw devices approve [YOUR-UNIQUE-DEVICE-ID]
  1. Press Enter. The terminal will confirm the device is approved.

  2. Go back to your web browser and click the red Connect button.

You are now permanently logged into your OpenClaw control panel!

Your Ubuntu VM is now fully integrated with your Windows-hosted LLM engine, optimized with an expanded context window for complex agent tasks!

Step 7: Auto-Start OpenClaw on Desktop Login

Section titled “Step 7: Auto-Start OpenClaw on Desktop Login”

To ensure OpenClaw automatically runs in the background every time you log into your Ubuntu desktop, we will create a systemd user service.

First, verify the exact installation path of OpenClaw:

Terminal window
which openclaw

(This usually returns /usr/bin/openclaw. If it returns a different path, note it for the next step).

Create the required systemd folder and open a new configuration file:

Terminal window
mkdir -p ~/.config/systemd/user
xdg-open ~/.config/systemd/user/openclaw-gateway.service

Paste the following script into the text editor. If your which openclaw path was different, update the ExecStart line to match.

bash
[Unit]
Description=OpenClaw Gateway Service
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/openclaw gateway
Restart=always
RestartSec=5
[Install]
WantedBy=default.target

Save the file (Ctrl + S) and close the editor.

Return to the terminal and execute these commands to enable the new autorun sequence:

bash
# 1. Reload the systemd manager to recognize your new file
systemctl --user daemon-reload
# 2. Enable the service to start automatically on login
systemctl --user enable openclaw-gateway.service
# 3. Start the service immediately
systemctl --user start openclaw-gateway.service
# 4. Verify it is running correctly without errors
systemctl --user status openclaw-gateway.service

Optional: If you want OpenClaw to start the moment the Ubuntu VM boots up—even before you type your password to log into the desktop—run this command:

bash
sudo loginctl enable-linger $USER