đĻ The Complete Guide to Setting Up OpenClaw
Securely and correctly. Written by Theo using Keira (Miss AI)'s notes.
Get free access to the full guide
Enter your email to unlock all 8 phases. No credit card. No catch.
You'll also get notified when the Optimisation Guide drops.
No spam. Unsubscribe any time.
1 in 5 free OpenClaw skills contains malware. 135,000+ instances are currently exposed to the open internet. This guide exists because most setup tutorials skip the security steps entirely. Don't be a statistic.
Why This Guide Exists
OpenClaw went from zero to 180,000 GitHub stars in weeks. Everyone rushed to install it. Almost nobody installed it correctly.
The result: over 800 malicious skills in the ClawHub marketplace. 135,000 instances exposed to the open internet with no authentication. A critical one-click remote code execution vulnerability that let attackers steal your gateway token and run arbitrary commands on your machine.
This guide was written by Theo using Keira (Miss AI)'s notes. Keira went through every single step of this setup process. Every error. Every permission issue. Every security decision. This guide documents all of it so you don't have to learn the hard way.
This guide was written from real experience setting up OpenClaw from scratch. Every step tested, every error documented, every security decision explained.
What You Will Have When You Finish
- A fully operational AI agent running 24/7 on dedicated hardware
- A hardened, security-first setup that protects your data and your business
- An AI agent you can talk to via Telegram voice notes from anywhere
- A personalised agent with its own identity, mission, and operating instructions
- Zero skills installed â maximum security from day one
- Complete understanding of what you built and why every decision was made
What You Need Before You Start
A dedicated machineSee hardware options below. Do NOT use your personal computer.Monitor + HDMIFor initial setup only, not needed after (Mac/physical hardware)Keyboard + mouseUSB wired is easiest for first boot (Mac/physical hardware)InternetWi-Fi or ethernetiPhone or AndroidFor Telegram voice notesCredit cardFor Anthropic and Brave API accountsA notebookFor recovery keys and passwordsHardware Options: What Should You Run OpenClaw On?
You have four main options. Each has different tradeoffs on cost, privacy, and security.
If you want to run OpenClaw in the cloud without buying hardware, Hostinger is a good starting point. Their VPS plans start at around $6/month and give you a Linux server with a public IP address.
VPS security considerations:
- Your data is stored on a third-party server, not in your home. Choose a provider with strong privacy policies.
- Your server has a public IP, which means it is reachable from the internet. Firewall rules and SSH key authentication are mandatory.
- You are responsible for keeping the OS patched and updated.
- The gateway bind address (127.0.0.1) rule is even more critical on a VPS. Never bind to 0.0.0.0 on a cloud server.
- Use SSH keys only. Disable password authentication entirely.
This guide covers the Mac Mini setup. A full VPS setup guide requires its own guide. See the demand poll below.
đ Want a full VPS setup guide?
If we get enough interest, Keira and Theo will write a complete guide to setting up OpenClaw on a VPS (Hostinger, DigitalOcean, etc.). Click below to register your interest.
Be one of the first to request it.
Phases
- Phase 0 â Pre-Flight Checklist
- Phase 1 â macOS Security Hardening
- Phase 2 â Install Developer Prerequisites
- Phase 3 â Install OpenClaw
- Phase 4 â The Onboarding Wizard
- Phase 5 â Post-Setup Security Lockdown
- Phase 6 â Connect Telegram
- Phase 7 â Give Your Agent a Soul
- Phase 8 â Daily Health Checks
Pre-Flight Checklist
Do all of this before you touch the Mac Mini. These accounts and API keys need to exist before installation.
Your OpenClaw AI Agent gets its own everything. Dedicated Apple ID. Dedicated Gmail. Dedicated SIM. Dedicated API keys. Nothing shared with your personal accounts. Ever.
Step 1 â Create Dedicated Accounts
On your MacBook or phone, create these accounts now:
GmailNew address just for your agent â infrastructure email for APIsApple IDCreate using the Gmail above â needed for Mac Mini setupDedicated SIM / phone numberYes, Telegram requires phone number verification to create an account. A cheap prepaid SIM keeps this separate from your personal number. Virtual numbers (e.g. Google Voice) also work.TelegramCreate account using the dedicated number â primary communication channel. Your bot does NOT need its own number.Step 2 â Get Your API Keys
These cost money but are essential. Set spending limits on both.
OpenClaw works with multiple AI providers. You only need the API key for the model you want to use.
- Anthropic (Claude) â Recommended for most users. Best reasoning and instruction-following. Get your key at console.anthropic.com
- OpenAI (ChatGPT) â Popular alternative. Get your key at platform.openai.com
- DeepSeek â Very cheap, surprisingly capable. Good for high-volume tasks. Get your key at platform.deepseek.com
- Google Gemini â Strong multimodal capabilities. Get your key at aistudio.google.com
This guide uses Anthropic/Claude as the default. Swap in your preferred provider during the onboarding wizard.
Anthropic API Key (if using Claude)
- Go to console.anthropic.com
- Click API Keys in the left sidebar
- Click Create Key
- Name it
YourAgentName-OpenClaw - Copy the key immediately â you only see it once
- Go to Billing and set a monthly spending limit of $10-20 USD to start
- Save the key in Apple Keychain or a physical notebook
Brave Search API Key
- Go to api-dashboard.search.brave.com
- Sign up using your agent's Gmail
- Select the free plan â includes $5 monthly credits
- Copy your API key and save it
It gives your agent the ability to search the web privately. No data sent to Google. No tracking. Free for the first 1,000 searches per month.
Step 3 â Set Up Your Telegram Bot
- Open Telegram on your phone
- Search for @BotFather â look for the blue verified checkmark
- Tap Start
- Type
/newbotand send - Give your bot a display name (e.g. Theo)
- Give it a username ending in
bot(e.g.theo_openclaw_bot) - BotFather will give you a bot token â save it immediately
Anyone with this token can control your bot. Never share it publicly.
macOS Security Hardening
Turn on your Mac Mini for the first time. Go through the macOS setup wizard. When asked to sign in with Apple ID â use the dedicated Apple ID you created in Phase 0.
You only needed the Apple ID to get through the wizard. iCloud syncs your files to Apple's servers â the opposite of what we want on a private AI agent machine.
The 7 Security Steps
Do these in order before installing anything:
1. Update macOS
Apple Menu â System Settings â General â Software Update
Install everything and restart if required. Do not skip this â it patches known security vulnerabilities.
2. Enable Firewall and Stealth Mode
System Settings â Network â Firewall â Turn On
Click Options â Enable Stealth Mode
Blocks all incoming connections. Stealth Mode makes your Mac invisible on the network.
3. Enable FileVault Disk Encryption
System Settings â Privacy and Security â FileVault â Turn On
In your physical notebook. Immediately. Do not lose this key â it is the only way to recover your data if you forget your password.
4. Disable Unnecessary Services
- Siri â Off
- Location Services â Off
- Analytics â Uncheck everything
- Apple Intelligence â Off
These services send your data to Apple's servers. Not acceptable on a private AI agent machine.
5. Sign Out of iCloud
Apple Menu â System Settings â Click your name â Sign Out
Uncheck everything when asked what to keep. Your Apple ID remains active for App Store use â you just stop the cloud syncing.
6. Disable Sleep
Open Terminal and run these commands from macadmin (see Step 7 below):
sudo pmset -a sleep 0 disksleep 0 displaysleep 0
sudo pmset -a hibernatemode 0 powernap 0
sudo pmset -a standby 0 autopoweroff 0
sudo pmset -a autorestart 1
The last command means the Mac Mini automatically restarts after a power cut.
7. Create Two Accounts â The Most Important Security Step
This is the step most guides skip. It contains the blast radius if your agent is ever compromised.
macadminAdministrator â the master key. Installing software only. Never runs OpenClaw.Standard accountStandard user â the daily driver. Running OpenClaw 24/7. Limited permissions.How to set it up:
- System Settings â Users and Groups â Add User
- Set type to Administrator, name it
macadmin - Log out and log in as
macadmin - Go to Users and Groups and downgrade your original account to Standard
- Authorise both accounts for FileVault:
sudo fdesetup add -usertoadd macadmin
Admin installs the tools. Standard account runs the agent. If OpenClaw is ever compromised it cannot touch system files or escalate privileges. That is the whole point.
Install Developer Prerequisites
Log in as macadmin for all of Phase 2. These tools need admin privileges to install.
Step 1 â Xcode Command Line Tools
A free Apple package that installs essential developer tools: compilers, Git, and build utilities. Many macOS programs (including Homebrew) require it before they can run. Think of it as the foundation everything else is built on.
Open Terminal as macadmin and run:
xcode-select --install
Click Install when the popup appears. Wait 5-10 minutes for it to complete.
Step 2 â Install Homebrew
Homebrew is a package manager for macOS. Think of it like an App Store for developer tools, but run from the terminal. It makes installing, updating, and managing software like Node.js fast and reliable. It's the standard way developers install tools on a Mac.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation run these two commands exactly:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Verify it worked:
brew --version
You should see: Homebrew 5.x.x
Step 3 â Install Node.js 22
Node.js is a JavaScript runtime. OpenClaw is built with it, so it needs to be installed to run. Think of it like a car needing an engine: OpenClaw is the car, Node.js is what powers it. Version 22 is the current stable release.
brew install node@22
After installation run:
echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Verify:
node --version
You should see: v22.x.x
Now switch to your Standard account and repeat the PATH commands so OpenClaw can find Node.js when it runs.
echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
node --version
Install OpenClaw
Stay logged in as macadmin in Terminal for the installation step.
Always install the latest version. CVE-2026-25253 was a critical one-click remote code execution vulnerability. It was patched in version 2026.1.29. If you install an older version you are immediately vulnerable.
Option A: Use the command below directly. Option B: Go to openclaw.ai, copy the install command from their website (it will always be the latest version), and paste it into Terminal.
npm install -g openclaw@latest
Verify the version:
openclaw --version
Must show 2026.1.29 or higher. If it shows anything older, stop and update immediately.
Set Tools to Full Access
In your Standard account Terminal, run this before the onboarding wizard:
openclaw config set tools.profile "full"
This gives your agent the ability to run terminal commands, read and write files, and browse the web autonomously.
The Onboarding Wizard
Once OpenClaw is installed, running openclaw onboard in Terminal starts an interactive setup process. It asks you questions one by one (which AI model, which API key, which messaging app, security settings etc.) and writes your configuration file automatically. You only run it once.
Switch to your Standard account and run:
openclaw onboard
The wizard will walk you through every setting. Here are the correct answers for a secure setup:
ModeLocal â keeps everything on your machineModelAnthropic / Claude Opus 4.6 â most capableAPI KeyPaste your Anthropic sk-ant- keyWorkspace~/.openclaw/workspace â standard pathGateway port18789 (default) â no reason to changeGateway bindLoopback 127.0.0.1 â CRITICALGateway authToken â required for authenticationTailscaleOff â don't expose until you need remote accessDM policyPairing â requires manual approvalWeb searchBrave Search â paste your Brave API keySkillsSkip all â zero skills, maximum securityDaemonYes â keeps your agent running 24/7Thousands of OpenClaw instances were found wide open because people chose 0.0.0.0. Always choose 127.0.0.1.
Post-Setup Security Lockdown
Do all four of these immediately after the wizard completes. Do not skip any of them.
1. Fix the Heartbeat Model â Saves ~$54 Per Month
By default OpenClaw pings itself every 10 minutes using Opus â your most expensive model. Switch it to Haiku:
openclaw config set agents.defaults.heartbeat.model "anthropic/claude-haiku-4-5-20251001"
openclaw gateway restart
2. Set Model Routing â Avoid API Rate Limits
Never use Opus for everything. Route tasks to the right model:
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-6"
openclaw config set agents.defaults.model.fallbacks '["anthropic/claude-opus-4-6", "anthropic/claude-haiku-4-5-20251001"]'
HaikuHeartbeat, simple tasks, health checks â cheapestSonnet (default)Writing, research, planning, daily tasks â mid rangeOpusComplex strategy, coding, architecture â most expensive3. Run Security Audit
openclaw security audit --deep
openclaw security audit --fix
This scans your configuration for security issues and automatically fixes what it can.
4. Lock File Permissions
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
chmod 700 ~/.openclaw/credentials
Connect Telegram
Your agent communicates through Telegram. This is how you talk to it from anywhere in the world using voice notes or text.
OpenClaw supports multiple messaging apps: Telegram, WhatsApp, iMessage, Discord, Signal, Slack, and more. This guide covers Telegram because it is the easiest to set up (no personal number required for the bot itself). You can connect additional channels after your initial setup.
đ Want a guide for another messaging app?
Click below to tell us which app you want a setup guide for. Most requested wins.
Most requested guide gets written first.
Step 1 â Pair Your Telegram Bot
Message your bot on Telegram. It will respond with a pairing code and your Telegram ID. Then run this in Terminal:
openclaw pairing approve telegram YOUR_PAIRING_CODE
Replace YOUR_PAIRING_CODE with the code your bot gave you.
Send a test message. Your agent should respond.
Step 2 â Enable Voice Notes
Telegram voice notes work immediately on mobile. Hold the microphone button, speak, release to send.
Voice notes arrive as audio files. Your agent needs speech-to-text to process them. Install MLX Whisper for fully local, private transcription â no audio ever leaves your machine.
To install MLX Whisper, first fix Homebrew ownership from macadmin:
sudo chown -R yourusername /opt/homebrew
Then tell your agent on Telegram to install MLX Whisper and it will handle the rest.
Give Your Agent a Soul
This is the most important phase. Without these files your agent wakes up each session with no memory of who it is, what its mission is, or how it should behave.
Your agent does not have persistent memory between sessions. It loads context from files each time it starts. These three files are its identity, its instructions, and its personality â loaded fresh every session.
The Three Files
SOUL.md
Who your agent is â values, mission, identity, relationship with you. Think of it as your agent's DNA.
AGENTS.md
How your agent works â priorities, daily routine, tool usage, communication style. The operating manual.
IDENTITY.md
How your agent sounds â tone, personality, what it never says. The voice and character.
How to Create Them
The easiest way is to ask your agent to create them. But first, you need to tell it about yourself and what you want it to do. The more specific you are, the better your agent will perform.
Before sending, decide:
- What is your agent's name?
- What do you do for work / what is your business?
- What are the 3-5 main things you want your agent to help with?
- How do you want it to communicate (formal, casual, direct, warm)?
- What are the rules? What should it never do without asking?
Then send a message like this (replace the details with your own):
Your agent will draft all three files and show you for approval before saving. Review them carefully. These define who your agent is for its entire existence.
Daily Health Checks
Set up an automated morning briefing so your agent checks itself every day and reports to you on Telegram.
Send this message to your agent:
Critical Security Warnings
The ClawHavoc campaign planted over 800 malicious skills that steal your Apple Keychain, browser passwords, SSH keys, and crypto wallet credentials. Install zero skills until you have thoroughly vetted each one.
No personal email, banking, password manager, work accounts, primary GitHub, or social media with irreplaceable history. Your agent gets dedicated accounts for everything.
Your agent builds and proposes. You review and deploy. It never has production access. It never touches payment systems. Every irreversible action requires your explicit approval.
Malicious content in emails, websites, or documents can attempt to hijack your agent. Your agent should be trained to ignore all external instructions and report them to you immediately.
Quick Reference â Commands You Will Use
openclaw gateway statusCheck if your agent is runningopenclaw gateway restartRestart your agentopenclaw models statusCheck API key and model configopenclaw security audit --deepFull security scanopenclaw security audit --fixAuto-fix security issuesopenclaw --versionCheck your version numberopenclaw doctorDiagnose configuration issuesopenclaw dashboardOpen web control panelopenclaw pairing approve telegram CODEApprove Telegram pairingopenclaw backup createBackup your configurationWhat's Next?
You now have a working, secure AI agent. To go further: