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.
Step 1: Download Prerequisites
Section titled “Step 1: Download Prerequisites”Before beginning, download all necessary installers:
- Ubuntu 26.04 LTS Desktop
- VMware Workstation Pro 26H1 (TechPowerUp)
- Ollama for Windows
- Ollama Qwen3.5:9b Model Reference
Step 2: Host Setup (Windows & Ollama)
Section titled “Step 2: Host Setup (Windows & Ollama)”We start by installing the LLM engine directly on the Windows host to take full advantage of your native GPU hardware.
- Run the downloaded Ollama installer and complete the setup.
- Open PowerShell or Command Prompt as an Administrator.
- 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:
New-NetFirewallRule -DisplayName "Ollama API" -Direction Inbound -LocalPort 11434 -Protocol TCP -Action AllowStep 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.
# Update package listssudo apt update
# Upgrade existing packagessudo apt upgrade -y
# Install VMware integration toolssudo apt install -y open-vm-tools-desktop
# Reboot to apply kernel changessudo rebootStep 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.
Step 5: Install OpenClaw via npm & curl
Section titled “Step 5: Install OpenClaw via npm & curl”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:
# 1. Download and configure the Node.js 22.x LTS repositorycurl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# 2. Install Node.js and npmsudo apt install -y nodejs
# 3. Verify installationnode -vnpm -v
# 4. Install OpenClaw globallycurl -fsSL https://openclaw.ai/install.sh | bashStep 6: Initialize & Configure OpenClaw
Section titled “Step 6: Initialize & Configure OpenClaw”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:
openclaw onboardFollow 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:
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:
openclaw gateway statusOpenClaw 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.
-
Launch the dashboard link from your terminal:
Ubuntu Terminal openclaw dashboard -
Hold Ctrl and click the generated localhost link(http://127.0.0.1:18789) to open it in your Ubuntu web browser.
-
You will see a red Device pairing required warning box. This is completely normal.
-
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:
openclaw devices approve [YOUR-UNIQUE-DEVICE-ID]-
Press Enter. The terminal will confirm the device is approved.
-
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:
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:
mkdir -p ~/.config/systemd/userxdg-open ~/.config/systemd/user/openclaw-gateway.servicePaste the following script into the text editor. If your which openclaw path was different, update the ExecStart line to match.
[Unit]Description=OpenClaw Gateway ServiceAfter=network-online.target
[Service]Type=simpleExecStart=/usr/bin/openclaw gatewayRestart=alwaysRestartSec=5
[Install]WantedBy=default.targetSave the file (Ctrl + S) and close the editor.
Return to the terminal and execute these commands to enable the new autorun sequence:
# 1. Reload the systemd manager to recognize your new filesystemctl --user daemon-reload
# 2. Enable the service to start automatically on loginsystemctl --user enable openclaw-gateway.service
# 3. Start the service immediatelysystemctl --user start openclaw-gateway.service
# 4. Verify it is running correctly without errorssystemctl --user status openclaw-gateway.serviceOptional: 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:
sudo loginctl enable-linger $USER