OpenClaw
OpenClaw is a personal AI assistant that is designed to run on your local device. It connects directly to the 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 webpages.
Learning objectives
- Install and initialize the OpenClaw environment.
- Pair and connect the OpenClaw CLI and the Control UI.
- Configure OpenClaw to use the local AI model Ollama.
- Personalize OpenClaw to establish its identity and behavior.
- Integrate OpenClaw with Discord.
- Enable the web search capability using Brave Search.
- Manage skills and plug-ins.
Prerequisites
Local model: Ensure Ollama is installed and running. You must have a tool-capable model installed, such as
glm-4.7-flash,qwen3.5:27b, andgpt-oss:20b. This tutorial usesqwen3.5:27b.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.
Discord account: Required to create the bot application.
Discord server: A server where you have permissions to add bots.
(Optional) Brave search API key: Required for the agent to search the web for real-time information.
TIP
You can obtain a free API key from the Brave Search API. The free tier of the "Data for Search" plan is usually sufficient for personal use.
Upgrade notes
If you are upgrading an existing OpenClaw installation, review the following version-specific changes and troubleshooting steps before proceeding.
Upgrade to 2026.02.25
The OpenClaw 2026.02.25 update introduced a security enhancement that requires existing users to explicitly declare the allowed Control UI access address. Therefore, if your Control UI fails to start after the upgrade, follow these steps to resolve the issue.
Open Control Hub on your desktop to check the container logs for clawdbot.

Look for the following error message. If it appears, proceed to the next step.
textGateway failed to start: Error: non-loopback Control UI requires gateway.controlUi.allowedOrigins (set explicit origins), or set gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true to use Host-header origin fallback mode
Open Settings, go to Application > OpenClaw > Control UI > Set up endpoint, and then copy the endpoint address.

Open Files, go to Application > Data > clawdbot > config, right-click the
openclaw.jsonfile, and then download it.
Open the downloaded file in a text editor, find the
gatewaysection, and then add acontrolUiblock with your endpoint address.json"controlUi": { "allowedOrigins": ["Endpoint-Address"] },
INFO
If you access the Control UI using multiple addresses such as local URLs or custom domains, add them to the
allowedOriginsarray separated by commas. For example,["https://url-one.com", "https://url-two.com"].Return to Files, rename the original
openclaw.jsonfile to keep it as a backup, and then upload your modifiedopenclaw.jsonfile.Return to Control Hub, click clawbot under Deployments, and then click Restart in the upper-right corner.

In the Restart clawdbot window, type
clawdbotexactly as shown, and then click Confirm. Wait for the program status to show as Running, which is indicated by a green dot.
Check the container logs again to verify the gateway has started successfully.

Open the Control UI. Refresh the browser page if an error still displays.
Install OpenClaw
From the Olares Market, search for "OpenClaw".

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

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 in the OpenClaw CLI.
Open the OpenClaw CLI app from the Launchpad.
Enter the following command to generate the dashboard access credentials:
bashopenclaw dashboard --no-openLocate the Dashboard URL in the terminal output.
Find and copy the token at the end of the URL (the text immediately following
#token=). This is your Gateway Token.
Open the Control UI app from the Launchpad.
On the Overview page, in the Gateway Access panel, specify the following settings:
- Gateway Token: Enter the token you copied in the previous step.
- Default Session Key: Enter
agent:main:main.
Click Connect.
The connection error
pairing requiredoccurs. This is expected and means the device connection is waiting for approval.Return to the OpenClaw CLI window and enter the following command:
bashopenclaw devices approve --latestWhen the terminal displays the approval message, return to the Control UI.

Now the STATUS in the Snapshot panel should be OK.

For advanced users
If you prefer to fully customize your initial setup, you can run the openclaw onboard command instead to launch the interactive configuration wizard.
(Optional) Pair device manually
When to use manual pairing
The quick setup in the previous section uses the openclaw devices approve --latest command to automatically approve the most recent pairing request. If you have multiple pending requests and need to manually select which device to approve, follow the steps in this section instead.
Connect the Control UI to the OpenClaw CLI to use the graphical dashboard.
Open the Control UI app from the Launchpad.
On the Overview page, in the Gateway Access panel, specify the following settings:
- Gateway Token: Enter the token you copied in the previous step.
- Default Session Key: Enter
agent:main:main.
Click Connect.
The connection error
pairing requiredoccurs. This is expected and means the device connection is waiting for approval.Return to the OpenClaw CLI window and enter the following command:
bashopenclaw devices listIn the Pending table, find the Request ID associated with your current device.
INFO
The Request ID has a time limit. If the authorization fails, re-run
openclaw devices listto obtain a new valid ID.
Authorize the device by entering the following command:
bashopenclaw devices approve {RequestID}When the terminal displays the approval message, return to the Control UI. Now the STATUS in the Snapshot panel should be OK.

Configure local AI model
In the Control UI, select Config from the left sidebar.
Switch to the Raw tab to edit the configuration JSON file directly.
Find the
agentssection and update thedefaultsblock to specify your primary model. Ensure that the model name matches the one installed in Ollama.json"agents": { "defaults": { "model": { "primary": "ollama/qwen3.5:27b" }, "workspace": "/home/node/.openclaw/workspace", "maxConcurrent": 4, "subagents": { "maxConcurrent": 8 } } },Click Save in the upper-right corner. The system validates the config and restarts automatically to apply the changes.
Manual restart
If you need to restart OpenClaw manually, do not use the OpenClaw CLI. Use one of the following methods:
- Restart the app from Settings or Market:
- Open Settings, go to Applications > OpenClaw, click Stop, and then click Resume.
- Open Market, go to My Olares, find OpenClaw, click keyboard_arrow_down next to the operation button, select Stop, and then select Resume.
- Restart the container: Open Control Hub, click
clawdbotunder Deployments, and then click Restart.
- Restart the app from Settings or Market:
(Optional) 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.
In the Control UI, select Chat from the left sidebar.
Ensure neurology at the upper-right corner is enabled. This allows you to watch the agent think and edit persona files in real time.
Enter and send the following message to start:
textWake up please!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 jargons 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.As you chat with the agent, look for the Edit messages. These indicate the agent is successfully writing your preferences to its core persona files, such as
IDENTITY.md,USER.md, andSOUL.md.
TIP
If you do not see the intermediate persona file operations, refresh the page by clicking refresh at the upper-right corner or by pressing F5.
Continue the conversation until the agent gathers enough information. Then, it automatically deletes the temporary
BOOTSTRAP.mdfile to finish the personalization process.
(Optional) If the agent fails to update the persona files or delete
BOOTSTRAP.md, 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: Select Config from the left sidebar, switch to the Raw tab, find the
modelssection, and then increase thecontextWindowvalue 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.
Verify your agent's persona files are updated:
a. Open Files from the Launchpad.
b. Go to Application > Data > clawdbot > config > workspace.
c. Check the modified time of the
.mdfiles to identify which ones were recently updated, such asUSER.mdandIDENTITY.md.
d. (Optional) Double-click a file to verify that it contains your newly established rules such as name, language style, and restrictions.
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
.mdfiles from this folder, edit them in a text editor, and re-upload them to overwrite the old ones.
Integrate with Discord
To chat with your agent remotely, connect it to a Discord bot.
Step 1: Create a Discord bot
Log in to the Discord Developer Portal with your Discord account.
Click New Application.

Enter a name for the new app, agree to terms, and then click Create.

From the left sidebar, select Bot.
Scroll down to the Privileged Gateway Intents section and enable the following settings:
- Presence Intent
- Server Members Intent
- Message Content Intent
Click Save Changes.
Scroll up to the Token section, click Reset Token, and then copy the generated token for your Discord bot. You need the token for channel configuration later in Control UI.

Step 2: Invite the bot to server
From the left sidebar, select OAuth2, and then find the OAuth2 URL Generator section:
a. In Scopes, select Bot and applications.commands.

b. In Bot Permissions, set as the following image. You can modify the settings later.

Copy the Generated URL at the bottom.
Paste the URL into a new browser tab, select your Discord server, and then click Authorize. The bot is added to your server.

Step 3: Configure channel
Connect OpenClaw to your Discord bot by adding its configuration in the Control UI.
About channel configuration
This tutorial provides the basic setup to get your bot running in Discord quickly. For more detailed configurations, see the official OpenClaw documentation.
Return to the Control UI > Config > Raw tab.
Add the following
channelssection to the configuration file.This configuration enables Discord Direct Messages (DMs) and sets the DM policy to pairing for security.
json"channels": { "discord": { "enabled": true, "token": "{YOUR_BOT_TOKEN}", "allowBots": true, "dm": { "enabled": true, "policy": "pairing" } } },
Replace
{YOUR_BOT_TOKEN}with your Discord bot token.Click Save.
From the left sidebar, select Channels. On the Discord card, Probe ok indicates successful connection.

Step 4: Authorize your account
For security, the bot does not talk to unauthorized users. You must pair your Discord account with the bot.
Open Discord and send a Direct Message to your new bot. The bot will reply with an error message containing a Pairing Code.
Open the OpenClaw CLI and enter the following command:
bashopenclaw pairing approve discord {Your-Pairing-Code}Once approved, you can start chatting with your agent in Discord.
Optional: Enable web search
By default, OpenClaw answers questions only based on its training data, which means it doesn't know about current events or real-time news. To give your agent access to the live internet, you can enable the web search tool.
OpenClaw officially recommends Brave Search. It uses an independent web index optimized for AI retrieval, ensuring your agent finds accurate information.
Open the OpenClaw CLI.
Run the following command to start the web configuration wizard:
bashopenclaw configure --section webConfigure the basic settings as follows:
Settings Option Where will the Gateway run Local (this machine) Enable web_search (Brave Search) Yes Brave Search API key Your BraveSearchAPIkeyEnable web_fetch (keyless HTTP
fetch)Yes Finalize the configuration in Control UI.
The CLI wizard sets up the API key, but you can customize specific tool parameters such as timeouts and limits in the Control UI.
a. Return to the Control UI > Config > Raw tab.
b. Find the
toolssection and update as follows:json"tools": { "web": { "search": { "enabled": true, "provider": "brave", "apiKey": "{Your-Brave-Search-API-Key}", "maxResults": 10, "timeoutSeconds": 30 }, "fetch": { "enabled": true, "timeoutSeconds": 30 } } },Now you can ask the agent in Discord to answer questions that require real-time internet data.
Manage skills and plugins
OpenClaw can be extended using skills and plugins:
- Skills add new capabilities to the AI. For example, managing Model Context Protocol servers.
- Plugins extend the system to support additional channels or community features. For example, adding iMessage via BlueBubbles.
Why manual installation required
To protect your device, OpenClaw runs in a restricted, non-root environment without administrative privileges. This prevents the agent from modifying your system or self-installing software.
Step 1: Install ClawHub
To manage skills and plugins, install ClawHub. It is the package manager for OpenClaw.
Open the OpenClaw CLI.
Enter the following command:
bashnpx clawhubWhen prompted to proceed, press Y.
Step 2: Install and enable skills
Check the list of available skills by entering the following command:
bashopenclaw skills
Find the target skill name in the Skill column, and then install by entering the following command:
bashnpx clawhub install {SkillName}For example, to install mcporter, enter the following command:
bashnpx clawhub install mcporterIf prompted to Install anyway, select Yes.
When the installation is completed, verify by entering the following command:
bashopenclaw skillsThe status of mcporter is ready, indicating the installation is successful.

Open the Control UI, go to the Skills page and find mcporter:
- If it is enabled, click Disable, and then click Enable again to force the system to save the configuration.
- If it is disabled, click Enable.

Click Save in the upper-right corner. The system validates the config and restarts automatically to apply the changes.
Step 3: Install plug-ins
In the OpenClaw CLI, check the list of compatible plug-ins by entering the following command:
bashopenclaw plugins listFind the target plug-in name in the Name column, and then install by entering the following command:
bashopenclaw plugins install {Name}For example, to install BlueBubbles, enter the following command:
bashopenclaw plugins install @openclaw/bluebubblesWhen the installation is completed, close OpenClaw CLI and open it again to load the new plug-in.
Verify by checking the plugin status:
bashopenclaw plugins listNow the status of the plug-in is loaded.
Open the Control UI, go to Config > Plugins, and then find @openclaw/bluebubbles on the All tab:
- If it is enabled, turn off the toggle switch, and then turn on again to force the system to explicitly save the configuration.
- If it is disabled, turn on the toggle switch.

Click Save in the upper-right corner. The system validates the config and restarts automatically to apply the changes.
Manual restart
If you need to restart OpenClaw manually, do not use the OpenClaw CLI. Use one of the following methods:
- Restart the app from Settings or Market:
- Open Settings, go to Applications > OpenClaw, click Stop, and then click Resume.
- Open Market, go to My Olares, find OpenClaw, click keyboard_arrow_down next to the operation button, select Stop, and then select Resume.
- Restart the container: Open Control Hub, click
clawdbotunder Deployments, and then click Restart.
- Restart the app from Settings or Market:
FAQ
Cannot restart OpenClaw in CLI
If you attempt to manually start, stop, or restart OpenClaw using commands like openclaw gateway or openclaw gateway stop in the OpenClaw CLI, you receive the following error messages:
Gateway failed to start: gateway already running (pid 1); lock timeout after 5000msGateway service check failed: Error: systemctl --user unavailable: spawn systemctl ENOENT
Cause
OpenClaw is deployed as a containerized app in Olares, where the gateway runs as the primary container process pid 1 and is always active. This environment does not use standard Linux system and service management tools such as systemd and systemctl, so these commands do not work.
Solution
Do not use the OpenClaw CLI to manage the gateway service. Instead, restart OpenClaw using one of the following methods:
- Restart OpenClaw from Settings or Market:
- Open Settings, go to Applications > OpenClaw, click Stop, and then click then Resume.
- Open Market, go to My Olares, find OpenClaw, click keyboard_arrow_down next to the operation button, select Stop, and then select Resume.
- Restart the container: Open Control Hub, click
clawdbotunder Deployments, and then click Restart.