Introduction to OpenClaw: How to Self-Host a Local LLM Agent with a Single Line of Messenger
Operating AI agents directly has always been accompanied by three barriers: external API costs, privacy risks associated with storing data on external servers, and the hassle of building a separate UI dedicated to the agent. OpenClaw solves these three issues at once. Simply by sending a single line of text to a familiar messenger (Telegram, WhatsApp, etc.), a locally running LLM analyzes the CSV, registers calendar events, checks server status, and returns the results.
OpenClaw, which has surpassed 247,000 GitHub stars as of March 2026 and is recording the fastest growth in the open-source AI agent field, was first unveiled in November 2025 by Austrian developer Peter Steinberger under the name Clawdbot, then went through Moltbot, and finally acquired its current name in January 2026. Behind this explosive growth lies a simple philosophy: it uses the messenger that developers use every day as the agent interface and protects the host system by isolating execution inside a Docker container.
This article is intended for backend and full-stack developers or those with DevOps experience, and covers a wide range of topics from OpenClaw's operating principles and skills system to practical pipeline configuration and security precautions. By the time you finish reading this article, you will have all the concepts necessary to install OpenClaw locally and run your first autonomous agent.
Key Concepts
OpenClaw's 4 Operation Axes
OpenClaw operates with four core elements working together.
| Components | Roles |
|---|---|
| LLM Backend | Local models such as Claude, GPT-4o, DeepSeek, Gemini, or Ollama·LM Studio |
| Messaging Channels | 22+ platforms including WhatsApp, Telegram, Signal, Discord, Slack, etc. (As of March 2026) |
| Docker Sandbox | Protect the host by running shell commands and file operations in isolated containers |
| Skills System | SKILL.md Functionality extended with file-based plugin architecture |
What is a Docker Sandbox? All commands executed by the agent take place exclusively within a container isolated from the host operating system. Even if the agent malfunctions, it does not affect the actual server or PC.
What is an OpenAI-compatible API? It is an HTTP API specification in the /v1/chat/completions format defined by OpenAI. Since various local and cloud LLM servers such as Ollama, LM Studio, and vLLM implement this specification, OpenClaw can connect to any model by simply changing base_url.
How does LLM decide which skill to call?
Understanding the core mechanisms of OpenClaw makes the operation of the Skills system much clearer. When an agent receives a user message, the following process takes place.
- Collect SKILL.md: OpenClaw reads all
SKILL.mdfrom the workspace, global, and bundle skill directories and inserts them into the system prompt to pass to the LLM. - Tool Use Call: LLM refers to the inserted skill description (trigger condition, parameter schema) to determine the skill that best matches the user's intent, and generates a call command in the Function Calling / Tool Use format.
- Run Skills Dispatcher: OpenClaw's Skills Dispatcher finds executable files (
handler.sh,analyze.py, etc.) in the corresponding skill directory and executes them inside the Docker sandbox. - Return Result: The execution result (text, file) is delivered to the messaging channel.
In other words, SKILL.md is the "documentation" read by the LLM, and the executable file in the same directory (handler.sh or *.py, *.js) is responsible for the actual operation. The executable file is specified in the Entrypoint field within SKILL.md, or by convention, handler.sh is used as the default entry point.
Skills System: Agent Function Expansion Structure
The core mechanism responsible for OpenClaw's scalability is Skills.
my-workspace/
├── skills/
│ ├── weather/
│ │ ├── SKILL.md # LLM이 읽는 스킬 설명 및 트리거 조건
│ │ └── handler.sh # 실제 실행 로직 (진입점)
│ └── calendar/
│ ├── SKILL.md
│ └── gcal.py
└── openclaw.config.ymlSkills are managed by priority hierarchy.
- Workspace Skills — Custom skills applicable only to the current project (Highest priority)
- Global Skill — Applies to all workspaces
- Bundle Skills — Built-in skills provided by OpenClaw by default
As of March 2026, there are over 700 community skills registered on the official skill marketplace, ClawHub (clawhub.ai).
Overall Architecture Flow
[사용자 메신저]
│ "내일 오전 10시 회의 잡아줘"
▼
[OpenClaw 메시징 어댑터] ← Telegram / WhatsApp / Slack ...
│
▼
[LLM 추론 엔진] ← Claude / GPT-4o / Ollama ...
│ (SKILL.md를 시스템 프롬프트에 삽입 → Tool Use로 스킬 선택)
│ "calendar.create 스킬 호출"
▼
[Skills 디스패처] ← 해당 스킬 디렉터리의 실행 파일 탐색
│
▼
[Docker 샌드박스] ← 실제 명령 실행 (gcal API 호출 등)
│
▼
[응답 반환 → 메신저]Practical Application
Now that you understand the core concepts, let's look at three examples of how to configure an actual pipeline.
Example 1: Building a Local Data Analysis Bot with Ollama + Telegram
Hardware Requirements: The llama3.2 model (3B parameters) requires a minimum of 8GB of RAM, and CPU inference is possible without a GPU. For models with 8B or more parameters, an environment with 16GB of RAM or more is recommended.
This is a pipeline that analyzes CSV data using only local LLM without cloud API costs.
First, declare environment variables in the .env file. Since entering keys directly into the configuration file can expose them to version control, it is strongly recommended to use this method.
# .env (프로젝트 루트 — .gitignore에 추가 필수)
TELEGRAM_BOT_TOKEN=your_bot_token_hereNext, create the main configuration file.
# openclaw.config.yml
llm:
provider: ollama
model: llama3.2
base_url: http://localhost:11434/v1
channels:
- type: telegram
token: "${TELEGRAM_BOT_TOKEN}" # .env에서 자동 로드
sandbox:
engine: docker
image: openclaw/sandbox:latest
volumes:
- ./output:/output # 분석 결과 파일 저장 경로 마운트
skills:
- path: ./skills/data-analystCreate a skill description file.
<!-- skills/data-analyst/SKILL.md -->
# Data Analyst Skill
## Description
CSV 파일을 받아 pandas로 분석하고 요약 및 시각화 결과를 반환합니다.
## Trigger
사용자가 CSV 파일을 업로드하거나 "분석해줘", "요약해줘" 같은 요청을 보낼 때 활성화됩니다.
## Entrypoint
analyze.py
## Usage
- 파일 첨부 후 "이 데이터 분석해줘" 메시지 전송
- "컬럼별 통계 알려줘", "이상치 찾아줘" 등의 자연어 명령 지원Write the actual analysis logic.
# skills/data-analyst/analyze.py
import pandas as pd
import matplotlib.pyplot as plt
import sys, json
def analyze(filepath: str) -> dict:
df = pd.read_csv(filepath)
summary = {
"shape": df.shape,
"columns": list(df.columns),
"stats": json.loads(df.describe().to_json()),
"nulls": df.isnull().sum().to_dict(),
}
# /output 디렉터리는 openclaw.config.yml의 volumes 설정으로
# 호스트의 ./output 디렉터리와 마운트됩니다.
# 이 경로에 저장된 파일은 OpenClaw가 자동으로 메신저로 전송합니다.
df.hist(figsize=(10, 8))
plt.tight_layout()
plt.savefig("/output/histogram.png")
return summary
if __name__ == "__main__":
result = analyze(sys.argv[1])
print(json.dumps(result, ensure_ascii=False, indent=2))Finally, here are the Docker Compose file and the execution command.
# docker-compose.yml
services:
openclaw:
image: ghcr.io/openclaw/openclaw:latest
env_file: .env
volumes:
- ./openclaw.config.yml:/app/openclaw.config.yml:ro
- ./skills:/app/skills:ro
- ./output:/output
ports:
- "3000:3000"
restart: unless-stopped# 실행
docker compose up -d
# 로그 확인
docker compose logs -f openclaw| Settings Items | Roles |
|---|---|
llm.provider: ollama |
Use local Ollama server instead of external API |
channels.type: telegram |
Connecting the Telegram Bot API to the Messaging Interface |
Share sandbox.volumes |
/output with the host to send the analysis result file via messenger |
SKILL.md Entrypoint |
Specify the file (analyze.py) called when the skill is executed |
| Environment variables loaded from | ${TELEGRAM_BOT_TOKEN} |
Example 2: Cron-based Periodic Reporting Agent
This is an agent that automatically reports weather, news, and server status to WhatsApp every day at 8 AM.
# .env
WHATSAPP_PHONE_NUMBER=+821012345678# openclaw.config.yml (발췌)
channels:
- type: whatsapp
phone: "${WHATSAPP_PHONE_NUMBER}"
wakeups:
- name: morning-report
cron: "0 8 * * *" # 매일 오전 8시
message: |
오늘의 모닝 리포트를 준비해줘:
1. 서울 날씨 확인
2. 기술 뉴스 상위 3개 요약
3. 서버 CPU/메모리 상태 점검
channel: whatsappWhat are Wakeups? They are OpenClaw's Cron trigger features. You can create regularly running agents using only YAML configuration, without the need for external schedulers (crontab, Airflow, etc.).
Note: After configuring wakeups, agents may periodically call external APIs or modify files. It is recommended to start with a read-only skill, such as a weather lookup, for the first wakeup, and then add skills with write permissions after sufficiently verifying the behavior with docker compose logs -f openclaw.
Example 3: Browser Automation — Web Scraping Chatbot
By connecting a Chromium node dedicated to OpenClaw, web automation is possible using only chat commands.
# openclaw.config.yml (발췌)
nodes:
- type: browser
engine: chromium
headless: true # Docker 환경에는 디스플레이가 없으므로 필수
skills:
- path: ./skills/web-scraperWhat is headless: true? This is a mode that runs the browser in the background without a screen (GUI). Since Docker containers do not have a display, you must enable this option when using browser automation in a server environment.
Create a skill description file.
<!-- skills/web-scraper/SKILL.md -->
# Web Scraper Skill
## Description
지정된 URL의 웹 페이지에서 콘텐츠를 스크래핑합니다.
## Trigger
사용자가 URL을 제공하며 "기사 제목 가져와줘", "스크래핑해줘" 같은 요청을 보낼 때 활성화됩니다.
## Entrypoint
scrape.pyWrite the actual scraping logic.
# skills/web-scraper/scrape.py
import sys
import json
from playwright.sync_api import sync_playwright
def scrape(url: str, limit: int = 5) -> list[dict]:
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto(url)
items = page.query_selector_all(".athing .titleline")
results = []
for item in items[:limit]:
anchor = item.query_selector("a")
if anchor:
results.append({
"title": anchor.inner_text(),
"url": anchor.get_attribute("href"),
})
browser.close()
return results
if __name__ == "__main__":
url = sys.argv[1]
limit = int(sys.argv[2]) if len(sys.argv) > 2 else 5
result = scrape(url, limit)
print(json.dumps(result, ensure_ascii=False, indent=2))<!-- 사용 예시 — Telegram 채팅창 -->
사용자: https://news.ycombinator.com 상위 5개 기사 제목 가져와줘
에이전트: 잠시만요, 스크래핑 중입니다...
1. [제목 1] — 링크
2. [제목 2] — 링크
3. [제목 3] — 링크
4. [제목 4] — 링크
5. [제목 5] — 링크Pros and Cons Analysis
Advantages
| Item | Content | Key Points |
|---|---|---|
| Fully Open Source | MIT License, 100% Self-Hosting Possible | No Need to Send Internal Data to External SaaS |
| Model-agnostic | Connects to any LLM exposing OpenAI-compatible APIs | Directly balance cost and privacy |
| Privacy Guaranteed | Data Not Stored on External SaaS Servers | Suitable for Processing Sensitive In-House Data |
| Rich Ecosystem | ClawHub's 700+ skills, 22+ messaging channels (as of March 2026) | Rapidly scale features without direct development |
| Docker Isolation | Protects the host system in case of agent malfunction | Safely test experimental skills |
| Familiar UX | Control agents with existing messengers without separate app installation | Team members do not need to learn new tools |
Disadvantages and Precautions
| Item | Content | Response Plan |
|---|---|---|
| Massive Codebase | 430,000+ Lines of Code, Wide Attack Surface | Review of Lightweight Forks Like NanoClaw or ZeroClaw |
| Credential exposure structure | No process-level credential isolation | Use of least privilege API keys, integration with secret management tools such as Vault |
| Lack of long-term memory | Cannot remember user preferences if session is disconnected | Combined with long-term memory specialized agents like memU |
| Autonomous Behavior Risk | Report instances of automatic purchases and spam sending upon misconfiguration | Add confirmation step for sensitive skills |
| Burden of self-hosting | Initial setup required, including Docker environment configuration and API key management | Recommended to refer to the official DigitalOcean tutorial |
What is the operator-trust model? In OpenClaw, it is a trust model in which an agent (LLM) has extensive access rights to connected tools and services. While convenient, it is important to carefully define the scope of permissions, as unintended actions can be executed if skill settings are incorrect.
The Most Common Mistakes in Practice
- If you hardcode the API key directly in
openclaw.config.yml— The key may be exposed when the configuration file is uploaded to version control. It is strongly recommended that you declare it in the.envfile and reference it in the${VAR_NAME}format. It is also a good idea not to forget to add.envto.gitignore. - If you do not check the scope of the agent's autonomous permissions after configuring
wakeups— Situations may occur where the regularly running agent calls unexpected external APIs or modifies files. We recommend starting with read-only skills (weather lookup, RSS summary, etc.) initially, and adding write-permission skills after thoroughly verifying the behavior through agent logs. - If you intend to run directly without Docker — Bypassing sandbox isolation allows agent commands to directly access the host file system. Since OpenClaw's security model is designed based on Docker isolation, it is strongly recommended to operate in a Docker environment for production.
In Conclusion
OpenClaw is a self-hosted AI agent platform that connects a messenger, local LLM, and Docker sandbox as Skills. Individual developers can build powerful autonomous agents without external API costs or privacy concerns.
Here are 3 steps you can start right now.
- Install Docker and Ollama first. After installing from the official Ollama website (ollama.com) and downloading the model using the
ollama pull llama3.2command, the local LLM environment will be ready. - Clone the official OpenClaw repository and create a default configuration file. After
git clone https://github.com/openclaw/openclaw, enter the Telegram bot token and Ollama connection settings inopenclaw.config.yml. - Select a skill you are interested in from ClawHub (clawhub.ai) and add it to your workspace. The point where the Telegram bot returns its first response marks the success milestone of the introductory stage. Afterwards, as you add simple skills one by one, such as checking the weather or summarizing RSS news, you will naturally experience how the Skills system works.
Next Post: OpenClaw Security Deep Dive — How to Operate Safely in Production Environments Through Credential Isolation, Designing Least Privilege Skills, and Comparisons with NanoClaw and ZeroClaw
Reference Materials
- [Official] OpenClaw GitHub | github.com/openclaw
- [Official] OpenClaw Official Documentation | docs.openclaw.ai
- [Official] OpenClaw Skills documentation | docs.openclaw.ai/tools/skills
- [튜토리얼] Using OpenClaw with Ollama: Building a Local Data Analyst | DataCamp
- [튜토리얼] How to Run OpenClaw with DigitalOcean | DigitalOcean
- [Introduction] What Is OpenClaw? Complete Guide | Milvus Blog
- [입문] OpenClaw Explained: The Free AI Agent Tool Going Viral | KDnuggets
- [심화] OpenClaw security: architecture and hardening guide | Nebius
- [심화] 6 OpenClaw Competitors That Are Gaining Ground in 2026 | emergent.sh
- [심화] Unleashing OpenClaw: The Ultimate Guide | DEV Community