PRACTICAL AI & AUTOMATION
Getting Started with OpenClaw and Local Agents on Ubuntu
Install OpenClaw, connect local Ollama inference, run the Gateway and configure a bounded agent workspace with practical verification steps.

Install OpenClaw, connect local Ollama inference, run the Gateway and configure a bounded agent workspace with practical verification steps.
Step 1: Understand what OpenClaw adds
A language model produces answers; an agent runtime connects a model to sessions, tools and a work environment. OpenClaw adds a Gateway, a Control UI and agent configuration so you can keep that environment running between individual requests. Start with one agent and one test workspace before arranging a team.
Local agent can mean a runtime on your workstation while its model is remote. A fully local setup also needs local inference and local supporting services. Keep that distinction explicit when choosing a provider. This guide starts with Linux, a browser and no external messaging channel.
Step 2: Check the runtime and install
Check node --version against the current OpenClaw requirements before installing. The official getting-started page checked on October 9, 2026 lists Node.js 24.16+ or 26.1+ and recommends Node 26. Recheck that page when you follow this guide: runtime requirements change.
Download and review the official installer, then run it. The current installer starts onboarding. Choose Custom setup when you want to deliberately select a local provider instead of reusing a detected cloud login. You can return with openclaw configure. See the official getting-started guide.
Open the complete copyable example — example-01.txt
# Open full code above.Step 3: Connect a local Ollama provider
Install Ollama and verify a direct answer first using the previous guide. In OpenClaw’s provider setup choose Ollama and its Local only route. Use http://127.0.0.1:11434 as the native base URL on the same machine; do not append /v1. OpenClaw’s Ollama integration uses the native chat API.
Select a downloaded model that the current provider discovery lists with the capabilities you need. A 3B text model is useful for learning about context, but a plain chat response does not qualify it for tool calls or long agent work. First check a short question, then one harmless tool call and its result. If a model prints tool JSON as text, investigate provider configuration and model capability rather than treating that text as successful execution.
Use the current Ollama provider overview and setup reference for your version. Keep the daemon and Gateway on loopback for this single-machine lab. Local-only selection should not silently fall back to a cloud model.
Step 4: Run the Gateway and open the dashboard
If onboarding left a foreground Gateway running, stop that foreground process with Ctrl+C before installing the background service. Then run the commands below and open the dashboard. The standard local Gateway port is 18789, but use the actual status output if you configured another one.
Send a simple question in the Control UI. Verify the selected agent and model, the response and the absence of unintended tools. A running service proves availability; one real completion proves that the provider route works for that request.
Open the complete copyable example — example-02.txt
openclaw gateway install
openclaw gateway status
openclaw dashboardStep 5: Give one agent a clear workspace
Use openclaw agents add lab-helper to enter the agent setup wizard, then list the configured agents. Give this agent a dedicated workspace. Inspect the generated files before editing; use AGENTS.md for operating rules and SOUL.md for tone and role where your workspace supports them.
A useful first brief is: ‘Summarize notes from this workspace. Read only the notes folder. Do not send messages, install packages or change files. State which file supports each answer.’ Apply matching read-only tool and sandbox settings; prose rules alone are not an access-control boundary.
Keep task results in the workspace and secrets in the supported credential store. Separate agents should have their own workspace/session configuration rather than share a single mutable conversation. See agent CLI commands and multi-agent routing.
Open the complete copyable example — example-03.txt
# Open full code above.Step 6: Verify a task before adding autonomy
Place a short public test note in the workspace and ask the selected agent to summarize it with its filename. Check that it actually used a file-reading tool, then compare the answer with the file. Next ask for a missing fact and expect an explicit unknown. Finally check that a write request is blocked under your configured policy.
Only after those checks should you add a bounded action such as creating a draft in a scratch folder. Give it an expected output, a maximum run duration and a review step. Persistent context, memory search and model training are different mechanisms; verify memory retrieval before claiming the agent remembers prior work.
Troubleshooting begins with openclaw gateway status and the current diagnostic commands in the docs. Provider failure, tool denial and a missing channel binding are separate problems. Read the actual error and inspect one layer at a time. Do not expose an unauthenticated Gateway to the internet to fix a local connection issue.
For Japanese reading, follow the marked sentence ‘The agent reads the file.’ When you need explicit branching, retries and approval gates across tasks, continue with the LangGraph guide.
Continue the series
UbuntuでOpenClawとローカルエージェントを始める
手順1:OpenClawの役割を理解する
モデルは回答を生成し、エージェントの実行基盤はモデル、セッション、ツール、作業環境をつなぎます。OpenClawはGateway、操作UI、継続的な設定を提供します。最初は1つのエージェントと試験フォルダーに絞ります。
ローカルエージェントでもモデルが外部の場合があります。完全ローカルには推論と補助サービスもローカルである必要があります。ここではLinuxとブラウザーを使い、外部メッセージサービスは接続しません。
手順2:実行環境を確認して導入する
node --versionを確認します。2026年10月9日に参照した公式ガイドはNode.js 24.16以上または26.1以上を示し、Node 26を推奨しています。実行時には現行要件を再確認してください。
公式インストーラーを取得して内容を読み、実行します。現在は初期設定が自動で始まります。検出されたクラウド認証ではなくローカルプロバイダーを選ぶ場合はCustom setupを使います。後からopenclaw configureで設定できます。公式導入ガイドを参照してください。
コピー可能な完全なコードを開く — example-01.txt
# Open full code above.手順3:ローカルOllamaへ接続する
前の記事でOllama単体の回答を確認します。OpenClawのプロバイダー設定でOllamaとLocal onlyを選びます。同じパソコンならhttp://127.0.0.1:11434を使い、/v1は付けません。統合はネイティブAPIを使います。
必要な機能付きで検出されるダウンロード済みモデルを選びます。3Bモデルが短い会話に答えても、ツール実行に対応する証明にはなりません。短い質問の後、無害なツールを1回試して結果を確認します。ツールJSONが文字列として出た場合は実行成功と扱いません。
現行のOllama概要と設定ガイドを参照します。単一端末のラボではloopbackを使い、Local onlyが勝手にクラウドへ切り替わらないことを確認します。
手順4:Gatewayと操作画面を開く
初期設定でGatewayが端末の前面で動いている場合はCtrl+Cで停止してからバックグラウンドサービスを入れます。下のコマンドで操作画面を開きます。通常は18789番ですが、実際の設定と状態を確認します。
簡単な質問を送り、エージェント、モデル、回答、意図しないツール利用の有無を確認します。サービス起動は利用可能性の証拠で、実際の回答はその要求で経路が動いた証拠です。
コピー可能な完全なコードを開く — example-02.txt
openclaw gateway install
openclaw gateway status
openclaw dashboard手順5:1つのエージェントの作業範囲を決める
openclaw agents add lab-helperで追加ウィザードへ進み、一覧で設定を確認します。専用ワークスペースを指定し、生成ファイルを読んでから編集します。AGENTS.mdは作業ルール、SOUL.mdは口調や役割に使えます。
最初の依頼は「このnotesフォルダーだけを読んで要約し、根拠ファイルを示す。送信、インストール、編集はしない」とします。ツールとサンドボックスにも読み取り専用設定を適用します。文章のルールだけではアクセス制御になりません。
結果はワークスペース、秘密情報は対応する認証ストアへ保存します。複数エージェントでは会話を混ぜず、作業場所とセッションを分けます。エージェントCLIと複数エージェントのルーティングを参照してください。
コピー可能な完全なコードを開く — example-03.txt
# Open full code above.手順6:自律性を増やす前に検証する
公開可能な試験メモを置き、ファイル名付きの要約を依頼します。実際に読み取りツールを使ったか、回答が原文と合うかを確認します。次に未知の情報への回答と、書き込み要求がポリシーで拒否されることを確認します。
検証後にscratchへの下書き作成など限定操作を追加し、期待結果、時間上限、レビューを決めます。文脈維持、記憶検索、モデル学習は別の仕組みです。以前の作業を覚えていると主張する前に検索を確認します。
gateway statusと現行診断コマンドから調べます。プロバイダー障害、ツール拒否、チャネルのルーティング不足を分け、1層ずつ確認します。ローカル接続問題の解決に未認証Gatewayをインターネットへ公開しません。
エージェントがファイルを読みます。明示的な分岐と承認にはLangGraphの記事へ進みます。
技術資料の確認日:2026年10月9日。コマンドとAPIは更新されることがあります。実行時に公式資料と利用中のバージョンを確認してください。
