How to Self-Host an AI Agent on Your Laptop
Most AI tools run in someone else’s cloud. Your prompts, your files, your data, all passing through third-party servers. Self-hosting puts you back in control.
This guide covers setting up PocketPaw as a private AI agent on your own machine. By the end, you’ll have a working assistant that can browse the web, manage files, search the internet, and talk to you through a clean web interface. All running locally.
What You’ll Need
- A computer running macOS, Linux, or Windows (even an older laptop works)
- Python 3.11+ installed
- Either an API key (Anthropic, OpenAI, or Google) or Ollama for free local models
- About 10 minutes
Step-by-Step Setup
Install PocketPaw
The quickest path is the interactive installer:
curl -fsSL https://pocketpaw.xyz/install.sh | shOr install directly with pip:
pip install pocketpawFor the full feature set (browser automation, memory, desktop tools):
pip install pocketpaw[recommended]Choose your AI provider
You have two paths: cloud models (smarter, costs money) or local models (free, private, needs decent hardware).
Cloud option, Anthropic Claude (recommended):
export POCKETPAW_ANTHROPIC_API_KEY="sk-ant-your-key-here"Free option, Ollama (runs on your machine):
# Install Ollamacurl -fsSL https://ollama.com/install.sh | sh
# Pull a modelollama pull qwen2.5:7b
# Tell PocketPaw to use itexport POCKETPAW_LLM_PROVIDER="ollama"export POCKETPAW_OLLAMA_MODEL="qwen2.5:7b"Ollama models run entirely on your hardware. A 7B parameter model needs about 4GB of RAM. For better results, try a 14B or 32B model if your machine can handle it.
Start PocketPaw
pocketpawThat’s it. The web dashboard opens at http://localhost:8888. You’re now running your own AI agent.
Try it out
Open the dashboard and try these prompts:
- “Search the web for the latest Python release notes”
- “Create a file called notes.txt with today’s date”
- “What files are in my home directory?”
PocketPaw can execute code, browse websites, read/write files, and use 50+ built-in tools, all from your local machine.
What You Get
A self-hosted PocketPaw instance gives you:
| Feature | What it does |
|---|---|
| Web dashboard | Chat interface at localhost:8888 with session history |
| 50+ tools | Web search, file management, browser, image gen, voice, OCR |
| Memory | Conversations persist across sessions |
| Multiple channels | Add Telegram, Discord, Slack later without reinstalling |
| Security | Injection scanning, audit logs, Guardian AI safety checks |
Adding Channels Later
Once your agent is running, you can connect messaging platforms:
# Add Telegrampip install pocketpaw[telegram]export POCKETPAW_TELEGRAM_BOT_TOKEN="your-bot-token"
# Add Discordpip install pocketpaw[discord]export POCKETPAW_DISCORD_BOT_TOKEN="your-bot-token"Restart PocketPaw and all configured channels start automatically. Same agent, same memory, multiple platforms.
Running on a Home Server
For always-on access, run PocketPaw as a system service:
# Using systemd (Linux)sudo cp pocketpaw.service /etc/systemd/system/sudo systemctl enable pocketpawsudo systemctl start pocketpawOr use Docker for a contained setup:
git clone https://github.com/pocketpaw/pocketpaw.gitcd pocketpawcp .env.example .env # Add your API keysdocker compose up -dSee the full deployment guide for production configurations.
Privacy and Security
Self-hosting means:
- No data leaves your machine (unless you use a cloud LLM provider)
- No usage tracking: PocketPaw collects zero telemetry
- Full audit trail: every tool execution is logged locally
- You control updates: upgrade when you want, not when a vendor decides
For maximum privacy, use Ollama with local models. Your conversations never touch the internet.
Next Steps
Add Telegram
Connect your self-hosted agent to Telegram for mobile access.
Run with Ollama
Set up free local models for completely offline operation.
Security Model
Learn about PocketPaw’s 7-layer security architecture.