Skip to content

Run OpenClaw as your self-hosted personal AI agent

OpenClaw is a personal AI assistant that is designed to run on your local device. It connects directly to messaging apps like Discord and Slack, and allows you to interact with it right in the app.

It acts as an "always-on" operator that can execute real tasks, such as searching and sending documents, managing calendars, or browsing web pages.

Learning objectives

In this guide, you will learn how to:

  • Install and initialize the OpenClaw environment.
  • Integrate OpenClaw with channels like Discord.
  • Optional: Enable the web search capability.
  • Manage skills and plugins.
  • Manage Olares with your OpenClaw agent.
  • Optional: Enable the sandbox for secure code execution.

Prerequisites

Before you begin, you need:

  • Discord account: Required to create the bot application.

  • Discord server: A server where you have permissions to add bots.

  • The following model:

    Model typeModelHow to get it
    ChatGemma 4 26B (Ollama)Install from Market

    Model provider

    This tutorial uses Gemma 4 26B through its Ollama API. If you use a different provider or local proxy, see the OpenClaw documentation on custom providers.

Upgrade notes

If you are upgrading an existing OpenClaw installation, review the version-specific changes and troubleshooting steps before proceeding. For more information, see Upgrade OpenClaw.

Install OpenClaw

  1. From the Olares Market, search for "OpenClaw".

    Search for OpenClaw from Market

  2. Click Get, and then click Install. When the installation finishes, two shortcuts appear in the Launchpad:

    • OpenClaw CLI: The command line interface
    • Control UI: The graphical dashboard

    OpenClaw entry points

Run multiple OpenClaw agents

Olares supports app cloning. If you want to run multiple independent AI agents for different tasks, you can clone the OpenClaw app. For more information, see Clone applications.

Initialize OpenClaw

Run a quick setup for the agent.

Step 1: Get model connection details

This tutorial uses Gemma 4 26B (Ollama), a tool-capable model available from Market.

TIP

OpenClaw requires a large "context window" (that is the AI's short-term memory) to handle complex tasks without forgetting your previous instructions. If you are using local models, it is recommended to select a model that natively supports a context window of at least 64K tokens.

How model connections work

A standalone model on Olares runs as a separate service from the client app. To connect them, the client needs the exact Model name and a Base URL that matches the API format it expects.

You can get both values from the model's console. For more details, see Connect AI apps.

  1. Open the model app from Launchpad. Its Model Console opens automatically.

  2. Wait until Model shows READY and Engine shows RUNNING.

    Gemma4 26B model console

  3. Under Model, copy the Model name exactly as shown.

  4. Under Engine:

    a. Connection source: Select Apps in Olares.

    b. API format: Select Ollama.

    c. Copy the provided Base URL exactly as shown.

Step 2: Verify model accessibility

Before configuring OpenClaw, verify that your model is accessible and responsive via the API.

  1. Open the OpenClaw CLI app from the Launchpad.

  2. Run the following command to verify your API address. Ensure you replaced {Your-Model-API} with the Base URL copied in Step 1.

    bash
    curl {Your-Model-API}/api/tags

    The terminal returns the available models, indicating that the API is reachable.

  3. Run the following command to force the model to load into memory and test its response speed. Ensure you replaced {Your-Model-API} and {Your-Model-Name} with the Base URL and Model name copied in Step 1.

    bash
    curl {Your-Model-API}/api/generate -d '{
    "model": "{Your-Model-Name}",
    "prompt": "say hello world",
    "stream": false
    }'

    A successful response containing Hello World! indicates that the model is ready.

Step 3: Run onboarding wizard

Set up OpenClaw using the step-by-step interactive wizard.

  1. Open the OpenClaw CLI app from the Launchpad.

  2. Enter the following command to start the interactive onboarding wizard:

    bash
    openclaw onboard --classic

    Do not run openclaw onboard

    Do not run openclaw onboard on its own — it launches a conversational TUI that requires an API key configured in the environment variables. Since no API key is configured there, this path is unusable. For the interactive wizard, use openclaw onboard --classic instead.

    If you accidentally entered the TUI, type /quit and press Enter to exit.

  3. The wizard guides you through a series of steps. Use the arrow keys to navigate and press Enter to confirm.

    Note on configurations

    To get you started quickly, this tutorial skips several advanced settings in the wizard. You can configure or modify them later.

    SettingsOption
    I understand this is
    personal-by-default and shared/multi-user use
    requires lock-down.
    Continue?
    Select Yes.
    Setup modeSelect QuickStart.
    Model/auth providerSelect More, and then select Ollama.
    Ollama auth methodSelect Ollama.
    Ollama modeSelect Local only.
    Ollama base URLRemove the default placeholder text, and then enter the Base URL copied in Step 1.
    Default modelSelect Browse all models, and then select the installed model ollama/gemma4:26b.
    Select channelSelect Skip for now.
    (You can configure channels later)
    Search providerSelect Skip for now.
    (You can configure the search provider later)

    Once you complete the onboarding wizard, OpenClaw starts to install skill dependencies automatically. This might take a while depending on your network.

    Installation errors can be ignored

    You might see Install failed or similar errors during this process. These do not block the setup. Wait for the installation to complete.

  4. Wait until the installation finishes. OpenClaw opens the Terminal User Interface (TUI) automatically.

    OpenClaw TUI after setup

  5. Type /quit and press Enter to exit.

  6. Keep the OpenClaw CLI window open. You need it in the next step.

Step 4: Pair device

Connect the Control UI to the OpenClaw CLI to use the graphical dashboard.

Step 5: Configure context window

OpenClaw requires a large "context window" (that is the AI's short-term memory) to handle complex tasks without forgetting your previous instructions.

  1. Open the Files app, and then go to Data > clawdbot > config.

  2. Double-click the openclaw.json file to open it.

  3. Click edit_square in the upper-right corner to enter the edit mode.

  4. Find the models section and locate the configuration block for your model.

  5. Update the contextWindow value to at least 65536 (64K). If your hardware VRAM permits, it is highly recommended to increase it to 204800 (200K).

    Configure context window in config file

  6. Click save in the upper-right corner.

  7. Restart OpenClaw for the changes to take effect.

Step 6: Personalize OpenClaw

To make your OpenClaw bot more personalized, it is highly recommended to complete the persona setup process.

This process establishes the agent's identity, behavioral boundaries, and long-term memory through persona files. These files keep your agent's behavior consistent across all platforms and channels.

  1. In the Control UI, select agent:main:dashboard under SESSIONS from the left sidebar.

  2. In the chat area, ensure your model is selected.

    The indicator in the bottom-right corner (for example, gemma4:26b · Off) shows the current model and reasoning status. Off means reasoning is disabled, not that the model is unavailable.

  3. (Optional) Enable reasoning.

    By default, reasoning is off for faster responses. To enable or adjust it, click the model indicator to open the model panel, drag the REASONING slider to an appropriate position between Faster and Smarter, and then click Save.

    Model selection panel

  4. Type and send a simple message to start. For example:

    text
    Wake up please!
  5. The agent responds and starts interviewing you. You can establish rules, personality traits, and preferences. For example:

    text
    - Call me Bella. I like simple language without technical jargon and 
    concise bulleted answers.
    - You are John, a witty assistant who uses emojis.
    - Never access my calendar without asking first, and never execute any 
    financial operations.
  6. As you chat with the agent, you can see the agent is writing your preferences to its core persona files, such as IDENTITY.md, USER.md, and SOUL.md.

    Persona files editing by OpenClaw

    TIP

    If you do not see the intermediate persona file operations, click right_panel_close at the upper-right corner and then click refresh, or press F5 to refresh the page.

  7. (Optional) If the agent fails to update the persona files, explicitly instruct it to do so in the chat.

    If the issue persists, resolve it using one of the following methods:

    • Increase the context window: Open the Files app, go to Data > clawdbot > config > openclaw.json, and then increase the contextWindow value to at least 64K (200K is recommended).

      TIP

      Note that a larger context window consumes more VRAM, so choose a value that your hardware can support.

    • Change the model: Switch to a model with better tool-calling and instruction-following capabilities.

  8. Continue the conversation until the agent gathers enough information.

  9. Verify that the persona files were successfully updated:

    a. Open the Files app from the Launchpad.

    b. Go to Application > Data > clawdbot > config > workspace.

    c. Check the modified time of the .md files to identify which ones were recently updated, such as USER.md, IDENTITY.md, and SOUL.md.

    Persona files generated by OpenClaw

    d. (Optional) Download a file to view it in a supported text editor, and verify that it contains your newly established rules, such as your name, language style, and restrictions.

    e. If the temporary BOOTSTRAP.md file exists, delete it.

    Modify persona settings

    To change these settings in the future, use one of the following methods:

    • Ask the agent in the chat to update its rules.
    • Download the .md files from this folder, edit them in a text editor, and re-upload them to overwrite the old ones.

Next steps

  1. Integrate with Discord to chat with your agent remotely.
  2. Enable web search to give your agent access to the live internet information.
  3. Install skills and plugins to enhance your agent's capabilities.

Troubleshooting and FAQs

Find solutions to common errors and behavioral issues in Common issues.

Learn more