跳转至

Step by Step Directive on OpenClaw Setup

This is an excellent hardware setup for this project.

Your 2012 MacBook Pro running Linux is perfect for the "body" (hosting OpenClaw), meeting the realistic 8GB RAM requirement. Your M1 Max is a fantastic beast for the "brain" (hosting Ollama).

Crucial Prerequisite: The Model Selection

You mentioned using an "8g llm". This is the most critical point: You cannot use a standard text-only model like Llama 3 8B.

Because OpenClaw works by analyzing screenshots of web pages, the LLM on your M1 Max must be multimodal (vision-capable).

In Ollama, the standard vision model is LLaVA. Since your M1 Max has 64GB of RAM, it can easily handle these models. We will use llava:7b or llava:13b for this guide.

Here is a step-by-step directive on how to set this up.


Phase 1: Network Preparation (Both Machines)

The two machines must be able to talk to each other on your local network.

  1. Find the IP Address of the Brain (M1 Max):

    • On your Mac, open System Settings -> Wi-Fi (or Network) -> Details on your connected network. Find your IP address (e.g., 192.168.1.50).
    • Note this down. We will call this M1_IP.
  2. Find the IP Address of the Body (Linux MBP):

    • In the Linux terminal, run ip addr or ifconfig. Find your local IP address.
  3. Test Connectivity:

    • From the Linux terminal, type ping <M1_IP>. Make sure you get replies. If not, check your firewall settings on both machines.

Phase 2: Setting up the Brain (M1 Max)

By default, Ollama only listens to itself (localhost) for security. We need to tell it to listen to requests from your Linux machine.

1. Install Ollama: If you haven't already, download and install Ollama from ollama.com.

2. Pull a Vision Model: Open your terminal on the M1 Max and run:

ollama pull llava:7b
(Note: You could try llava:13b later for potentially better results, as your M1 Max can handle it, but let's start with 7b for speed testing.)

3. Stop Ollama (if running): If the Ollama app is running in your menu bar, quit it completely.

4. Run Ollama exposed to the network: To make Ollama accept connections from outside, we need to set the OLLAMA_HOST environment variable to 0.0.0.0.

Open a terminal on the M1 Max and run this command to start the server:

OLLAMA_HOST=0.0.0.0 ollama serve
Keep this terminal window open. You should see Ollama starting up.

5. Test the API from the Body (Linux MBP): Go to your Linux laptop terminal. Try to connect to the M1 Max's Ollama API to ensure it's listening. Replace <M1_IP> with the actual IP address.

curl http::<M1_IP>:11434/api/tags
If successful, you should get a JSON response listing the models you have installed (including llava:7b).


Phase 3: Setting up the Body (Linux MBP 2012)

Now we set up OpenClaw to use that remote brain.

Prerequisites: Ensure you have Docker and Docker Compose installed on your Linux installation.

1. Clone the Repository: I will assume you are using the main fork, often referred to as OpenClaw or based on the original codebase.

git clone https://github.com/OpenClaw/OpenClaw.git
cd OpenClaw
(Note: If you are using a different fork, clone that instead.)

2. Configure Environment Variables: You need to tell OpenClaw not to use OpenAI, but instead use your local Ollama instance.

Look for an example environment file (usually .env.example) and copy it to .env:

cp .env.example .env
nano .env

3. Edit the .env file: You need to find the section for LLM configuration. It usually defaults to OpenAI. You need to change it to use an OpenAI-compatible local endpoint.

Note: Different forks of OpenClaw might have slightly different variable names, but the logic remains the same. Look for variables controlling the base URL and the model.

Here is typical configuration pattern you need to achieve in the .env file. You are essentially "tricking" it into thinking Ollama is OpenAI:

# Set the provider to something generic if the option exists, otherwise leave it as openai
LLM_PROVIDER=openai

# THE CRITICAL PART: Point the Base URL to your M1 Max IP and port 11434, adding /v1 at the end
OPENAI_API_BASE=http://<M1_IP>:11434/v1

# Put any fake string here, Ollama doesn't care, but the app might require it not to be empty.
OPENAI_API_KEY=sk-fake-key-ollama

# Tell it exactly which vision model to use on Ollama
OPENAI_MODEL=llava:7b

# Ensure vision features are enabled (variable name may vary depending on fork)
VISION_ENABLED=true

Save and exit the editor (Ctrl+X, Y, Enter).

4. Start OpenClaw:

docker compose up -d

Wait for the containers to download and start. On the 2012 MBP, the initial build/pull might take a little while.

Phase 4: Testing

  1. Once Docker indicates the containers are running, open a web browser on your Linux machine and go to http://localhost:3000 (or whatever port OpenClaw configured itself to run on).
  2. You should see the OpenClaw interface.
  3. Try a very simple command, like: "Go to google.com and type 'hello world' into the search box."

What to watch for: * Look at the terminal on your M1 Max running ollama serve. When you give OpenClaw a command, you should see activity in that terminal indicating it is receiving a request and processing tokens. * Be patient. Local vision models, even on an M1 Max, might take several seconds to process the screenshot and decide what to do next. It won't be as instantaneous as Claude Opus in the cloud.