Local Deployment of ZeroClaw

📢 This article was translated by gemini-3.5-flash

Back when OpenClaw was super popular, I wasn’t really a fan of using Node for deployment. The subsequent security vulnerabilities confirmed my doubts. Now, there are plenty of great forks. Since I prefer lightweight setups, I went with the lighter ZeroClaw.

Since I’m deploying my own AI assistant, I don’t want my data uploaded to the cloud. So, the goal this time is to build a fully local private assistant.

Overview

To keep everything fully local, I’ll use Ollama for hosting local models. Communication will go through a Matrix server running on my NAS. For clients on phones and PCs, I’ll use Element. Although Element has a web client, I couldn’t get it working due to configuration issues, so I’ll skip that for now.

I also tried setting up multi-container instances and building an MCP server. Since it’s isolated in a container, I gave ZeroClaw full permissions.

Compiling ZeroClaw

Install Rust. Head over to https://rustup.rs/ , download rustup-init.exe, and run it. Press 1 for the default install. You will need Visual Studio and its build tools installed during this process.

Clone the official ZeroClaw repo:

1
git clone https://github.com/zeroclaw-labs/zeroclaw

Run setup.bat to start the installation. Choose the version you want; if you are not sure, go with the standard install.

By the way, I fixed the Windows path installation issue. My very first PR! (●’◡’●)

Also, there’s a bug in how the official installer writes the PATH environment variable. After installing, open PowerShell and run this (too lazy to PR this small bug):

1
2
3
4
5
6
# Read your clean "User-level PATH", append the zeroclaw path, and write it back to the registry
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($currentPath -notlike "*\.zeroclaw\bin*") {
    [Environment]::SetEnvironmentVariable("Path", $currentPath + ";$HOME\.zeroclaw\bin", "User")
    Write-Host "PATH successfully updated! Please restart your terminal." -ForegroundColor Green
}

Then close the terminal.

Deploying Local Models

Install Scoop. Open PowerShell and run:

1
2
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

Add the extras bucket and install ollama:

1
2
scoop bucket add extras
scoop install ollama-full

Run the Qwen2.5-coder-7b-instruct-Q4_K_M model (you can also do this after installing ZeroClaw):

1
ollama run qwen2.5-coder:7b

Once you see success and the interactive prompt, you’re good to go. It runs on http://127.0.0.1:11434 by default.

Matrix Deployment

Deploy a Synapse server using Docker, then connect using Element.

First, generate the configuration file:

1
2
3
4
5
docker run --rm \
    -v ./data:/data \
    -e SYNAPSE_SERVER_NAME=localhost \
    -e SYNAPSE_REPORT_STATS=no \
    matrixdotorg/synapse:latest generate

Open data/homeserver.yaml and tweak the config. For example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Allow registration (enable to register your admin account, then turn off and restart for security)
enable_registration: true

# Accept risks of open registration without verification (safe for local environments)
enable_registration_without_verification: true

# Highly recommended to enable end-to-end encryption (E2EE), keeping database content encrypted
encryption_enabled: true

# If purely for local LAN, federation with other Matrix servers is not needed. Disable federation listening or keep defaults.

Create your docker-compose.yml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
services:
  synapse:
    image: matrixdotorg/synapse:latest
    container_name: matrix-synapse
    restart: unless-stopped
    volumes:
      - ./data:/data
    ports:
      - "8008:8008"
    environment:
      - TZ=Asia/Tokyo

Spin up the container:

1
docker compose up -d

Grab the client from the Element official website , connect to your server, register an account, and start chatting.

Create a dedicated account for claw. Go to settings. You can find the Access Token at the bottom of “Help & About”, the recovery key under “Encryption”, and your Username (which is your user-id) on the Account page.

Configuring ZeroClaw

Launch the GUI onboarding:

1
zeroclaw onboard

Just follow the steps based on your setup. Here are some key points:

Select Ollama, enter your custom model name, put a dummy API Key (like sk-local), select the model, and keep the rest default. Note: I recommend enabling sandbox-enabled and setting sandbox-backend to docker.

In the claw configuration, I recommend turning on interrupt-on-new-message so you can interrupt running tasks with a new message.

Start the agent:

1
zeroclaw agent --agent <your-agent-name>

Start the channel to listen to Matrix:

1
zeroclaw channel start

Matrix Configuration Issues

I’m not sure if I missed a setting, but for allowed users, you need to create a group. Add this to your configuration file:

1
2
3
4
[peer_groups.matrix_{group}]
channel = "matrix.{group}"
agents = ["init"]
external_peers = ["@yexca:yexca-matrix-server"]

Of course, you can configure other parts separately using the GUI helpers:

  • agent
1
zeroclaw onboard agents
  • channel
1
zeroclaw onboard channels

Local MCP

I wrote an MCP server to hook up some local services, including image generation, TTS, and printer services.

For image generation, it supports local generation (via ComfyUI) and OpenAI’s DALL-E 2. Other services are untested for now. I haven’t decided on a TTS service yet, and the printer integration is more of a “nice-to-have” than a necessity.

Check out my GitHub repo for details:

Loading...
- -

Docker Multi-instances

Since ZeroClaw currently only supports listening to one Matrix account per channel instance, I set up multi-container deployment to handle different Matrix accounts. I also added features like random wake-ups and multi-message detection. The official Docker image is still stuck at 0.7.5 (probably waiting for 0.8.0), so I built my own image locally. Configuration files have changed quite a bit since 0.7.5, so I don’t recommend using the official 0.7.5 image.