
Moltbot: Control Your PC from WhatsApp with a Self-Hosted AI Agent
Learn how to set up Moltbot, a self-hosted Claude-powered agent that lets you search files, run shell commands, and automate workflows on your Mac from WhatsApp. Complete setup guide with security best practices.
Imagine you're out for coffee, and you suddenly realize you need a specific spreadsheet from your home office computer. Or perhaps you want to run a complex data analysis script while you're commuting. Usually, this would require a complicated remote desktop setup, a VPN, or waiting until you're back at your desk.
Enter Moltbot (formerly known as Clawdbot).
Moltbot is a revolutionary self-hosted AI agent that transforms your computer into a conversational partner accessible via WhatsApp. Powered by Anthropic's Claude models, it doesn't just chat—it acts. It can search your files, execute terminal commands, and automate complex workflows, all through a familiar chat interface that you already use every day.
What is Moltbot?
At its core, Moltbot is a "local-first" AI agent. Unlike many AI services that live entirely in the cloud, Moltbot runs directly on your hardware. This gives it the unique ability to interact with your local file system and applications while keeping your data under your control.
The Gateway Architecture
Moltbot utilizes a clever "Gateway" architecture to bridge the gap between your local machine and WhatsApp without requiring you to set up complex webhooks or expose your machine to the open internet:
- The Agent: Runs locally on your Mac, Linux, or WSL2 environment. It holds the "brain" (Claude) and the tools. It connects outbound to the Gateway using a secure WebSocket connection.
- The Gateway: A cloud-based component that handles the complex WhatsApp Business API integration and message routing. It acts as a postman, delivering messages between you and your agent.
- WhatsApp: Your interface. You send messages to the Gateway, which forwards them to your local Agent. Your Agent executes the request and sends the result (text, images, or files) back through the Gateway to your phone.
This separation ensures that while the messaging is handled conveniently through WhatsApp, the actual execution and data access remain strictly local and secure.
System Requirements
Before we dive into the installation, ensure your system meets the following requirements:
- Operating System: macOS (Intel or Apple Silicon), Linux (Ubuntu/Debian recommended), or Windows with WSL2.
- Node.js: Version 22 or higher. This is crucial as Moltbot leverages some of the latest features in the Node.js runtime, such as built-in WebSockets and improved security APIs.
- Anthropic API Key: Moltbot uses Claude (3.5 Sonnet is highly recommended) for its reasoning capabilities.
- WhatsApp Account: A standard WhatsApp account to interact with the agent.
Note on Costs: While Moltbot itself is open-source, you will incur costs from Anthropic for API usage. Claude 3.5 Sonnet is highly efficient; for typical tasks, you'll likely spend only a few cents per day. However, it's wise to set a monthly usage limit in your Anthropic dashboard to avoid surprises.
Step-by-Step Installation
Getting Moltbot up and running is designed to be as frictionless as possible.
1. Run the Installation Script
Open your terminal and run the following command:
npx moltbot@latest init
This command downloads the latest version of Moltbot and initiates the interactive setup process.
2. The Onboarding Wizard Walkthrough
The wizard will guide you through several key steps:
- Terms of Service: You'll be asked to acknowledge that Moltbot has the power to run commands on your system and that you are responsible for its configuration.
- API Key Entry: Paste your Anthropic API key when prompted.
- WhatsApp Pairing: The wizard will provide a link to the Moltbot Gateway. When you open it, you'll see a QR code. Open WhatsApp on your phone, go to "Linked Devices," and scan the code. Your phone is now paired with your local agent.
- Initial Preferences: You can choose your default shell (zsh or bash) and initial "safe" directories where the agent is allowed to read and write files.
Once the wizard finishes, Moltbot will start up. You can keep it running in the background using a process manager like PM2, and it will automatically reconnect if your computer restarts or wakes from sleep.
Built-in Capabilities
Moltbot comes pre-configured with a suite of "skills" that make it useful from minute one.
Example 1: Finding and Retrieving Files
We've all been in a situation where we need a file that's "somewhere on the computer."
You (on WhatsApp): "Find the invoice from 'EcoPower' that I saved last month and send it to me."
Moltbot: The agent searches your file system using native commands, filters by file type and date, identifies the most likely match, and uploads the file directly to your WhatsApp chat as a document.
Example 2: Remote System Administration
For developers and IT professionals, Moltbot is like having a junior sysadmin in your pocket.
You: "Is the local database running? If not, try to start it and show me the last 10 lines of the log."
Moltbot: Checks the process list, runs the start command if necessary, captures the log output, and sends it back to you as a code block.
Custom Skills: Extending Your Agent
One of Moltbot's greatest strengths is its extensibility. It uses the AgentSkills specification, a standard for defining tool capabilities for AI agents.
What are Skills?
Skills are essentially functions that the AI knows how to call. They consist of a JSON schema describing what the tool does and what parameters it needs, and a handler function that executes the code.
Step-by-Step: Your First Custom Skill
Suppose you want a skill to get the weather for a specific city. Here's how you'd implement it:
- Create the file: Create
skills/weather.ts. - Define the skill:
// skills/weather.ts
export const weatherSkill = {
name: "get_weather",
description: "Gets the current weather for a city",
parameters: {
type: "object",
properties: {
city: { type: "string", description: "The city name" }
},
required: ["city"]
},
handler: async ({ city }) => {
const response = await fetch(`https://api.weatherapi.com/v1/current.json?q=${city}`);
const data = await response.json();
return `The weather in ${city} is ${data.current.condition.text} at ${data.current.temp_c}°C.`;
}
};
- Restart Moltbot: The next time you chat with your agent, it will know it has the "get_weather" ability.
The Community Ecosystem
The Moltbot community is building a library of skills that you can easily drop into your setup, including integrations with:
- Spotify & Apple Music: Remote control for your tunes.
- Docker & Kubernetes: Manage your containers from your couch.
- Home Assistant: Voice-less home automation.
- Google Sheets & Notion: Update your trackers on the go.
Real-World Use Cases
How are people actually using Moltbot? Here are a few examples from the community:
The Traveling Executive
Sarah travels frequently for business. She uses Moltbot to access her home-based archive of research papers. If she needs a specific reference during a meeting, she can message Moltbot and have the PDF in seconds, without needing to mess with a VPN on a public Wi-Fi network.
The On-Call Developer
Marcus is a lead developer. When he's away from his desk and gets an alert, he uses Moltbot to check server health, tail logs, and even push small hotfixes to a staging environment—all from his phone while at the grocery store.
The Creative Professional
Elena uses Moltbot to manage long-running video renders. She can ask, "How's the render going?" and Moltbot will check the progress of her editing software and report back, or even send her a screenshot of the current frame.
Advanced Features
Persistent Memory
Moltbot doesn't "forget" who you are between sessions. It maintains three primary markdown files that act as its long-term memory:
SOUL.md: This is where you define the agent's personality. Want it to be a grumpy old Linux beard? Or a helpful, upbeat assistant? You define its voice and core directives here.USER.md: Stores facts about you that help the agent be more helpful. Your preferred programming languages, your project names, and your frequent contacts.MEMORY.md: A dynamic log of things the agent has learned. If you tell it, "I'm going on vacation next week," it will store that fact here and can remind you or use that context in future conversations.
Proactive Alerts (Heartbeats and Cron)
Moltbot can be proactive. You can configure:
- Heartbeats: "Check if my website is up every 5 minutes. Only message me if it returns a 500 error."
- Cron Jobs: "Every Friday afternoon, look at my 'Completed Tasks' folder and write a summary of what I accomplished this week."
Security and Sandboxing Deep Dive
We understand that giving an AI access to your terminal can be daunting. Moltbot is built with security as a priority:
- Sandboxing: You can run Moltbot inside a Docker container. This creates a "jail" for the agent, where it can run commands and manage files without having any access to your actual host machine unless you explicitly mount specific volumes.
- Approval Mode: For sensitive commands (like
rm,git push, orsudo), you can configure Moltbot to send you a confirmation button on WhatsApp. The command will only run once you tap "Approve." - Encrypted Communication: All communication between your agent and the Gateway is encrypted using industry-standard TLS, ensuring your data remains private.
- Local API Key Storage: Your Anthropic API key is stored locally on your machine and is never sent to the Moltbot Gateway.
Best Practices for a Secure Setup
To get the most out of Moltbot while keeping your system safe, we recommend the following:
- Use a Dedicated User: Create a separate limited user account on your Mac or Linux machine specifically for Moltbot.
- Restrict Scopes: Only give Moltbot access to the directories it absolutely needs.
- Monitor Logs: Regularly check the Moltbot logs to see what actions it has been taking.
- Rotate API Keys: Periodically rotate your Anthropic API keys for better security.
Troubleshooting Common Issues
- Node.js Version: If you see errors related to
fetchorWebSocket, double-check that you are running Node.js 22+. - Gateway Connection: If the agent says it's "Offline," check your internet connection and ensure that no firewall is blocking outbound WebSocket traffic.
- API Rate Limits: If Moltbot becomes unresponsive, check your Anthropic dashboard to see if you've hit your rate limits or exhausted your credits.
Moltbot vs. The Competition
How does Moltbot compare to other AI tools?
| Feature | Moltbot | Open Interpreter | ChatGPT Plus | | :--- | :--- | :--- | :--- | | Interface | WhatsApp | Terminal | Web/App | | Data Privacy | Local-first | Local-first | Cloud-based | | Remote Access | Native (WhatsApp) | Requires SSH/TMUX | N/A | | Persistence | Yes (Soul/Memory) | Limited | Yes (Memory) | | Custom Skills | Yes (Extensive) | Yes | Limited (GPTs) |
While tools like Open Interpreter are fantastic for local coding sessions, Moltbot's unique WhatsApp integration and persistence make it the superior choice for remote access and "always-on" productivity.
Conclusion: The Local-First Future
Moltbot is more than just a cool project; it's a glimpse into the future of personal computing. As Large Language Models become more capable, the bottleneck is no longer the AI's intelligence, but its ability to safely and effectively interact with our world and our data.
By keeping the agent local but the interface mobile, Moltbot provides the best of both worlds: the power of state-of-the-art AI like Claude and the privacy and control of your own hardware.
At AiRK, we are committed to empowering individuals through AI. We believe that tools like Moltbot are essential for anyone looking to reclaim their time, automate the mundane, and supercharge their capabilities in this new era of technology.
Ready to get started? Check out the Moltbot GitHub repository and join the revolution. If you have any questions or need help with a custom setup, feel free to reach out to the AiRK Team!
Published by the AiRK Team | Empowering Humanity through AI.
