🦞 Clawdbot on FreeBSD
Run your own AI assistant natively on FreeBSD
Contents
Overview
Clawdbot is a self-hosted AI assistant that connects to messaging platforms (Telegram, WhatsApp, Discord, Slack, Signal) and provides an always-on AI assistant powered by Claude, GPT, or other LLM providers.
This port enables Clawdbot to run natively on FreeBSD by building the required native Node.js modules from source.
Requirements
- FreeBSD 14.0 or later
- Root access (for installation)
- ~4GB disk space
- Internet connection
- An AI provider API key (Claude, OpenAI, etc.)
Installation
The easiest way to install is using our automated script:
fetch -o - https://bsdmacao.org/install/clawdbot.sh | sh
This script will:
- Install Node.js 22, npm, and build tools (Rust, GCC, Python)
- Install Clawdbot via npm
- Build native modules for FreeBSD (clipboard, sharp)
- Create the
clawdbotsystem user - Install the rc.d service script
Manual Installation
If you prefer to install manually:
# Install dependencies
pkg install node22 npm-node22 git rust gcc python311 pkgconf vips
# Install Clawdbot
npm install -g clawdbot
# Build native modules
cd /usr/local/lib/node_modules/clawdbot
npm install node-addon-api node-gyp --save-dev
# Build clipboard for FreeBSD
cd node_modules/@mariozechner/clipboard
npm install @napi-rs/cli
npx napi build --platform --release
# Rebuild sharp
cd /usr/local/lib/node_modules/clawdbot
npm rebuild sharp
Configuration
After installation, initialize Clawdbot:
# As the clawdbot user
su -m clawdbot -c 'clawdbot onboard --mode local --workspace /var/db/clawdbot/workspace'
Then configure your AI provider:
su -m clawdbot -c 'clawdbot configure'
You'll need an API key from one of:
- Anthropic (Claude)
- OpenAI (GPT)
- OpenRouter (multiple providers)
Running as a Service
Enable and start Clawdbot as a system service:
# Enable the service
sysrc clawdbot_enable=YES
# Start Clawdbot
service clawdbot start
# Check status
service clawdbot status
# View logs
tail -f /var/log/clawdbot.log
gateway run (foreground mode) wrapped by the FreeBSD daemon utility. The standard clawdbot gateway start/stop commands expect systemd/launchd and won't work on FreeBSD.
Telegram Setup
To connect Clawdbot to Telegram:
- Message @BotFather on Telegram
- Create a new bot with
/newbot - Copy the bot token
- Add the token to your config:
su -m clawdbot -c 'clawdbot config set channels.telegram.botToken "YOUR_BOT_TOKEN"'
Restart the service to apply:
service clawdbot restart
Troubleshooting
Gateway won't start
Check that the config exists:
ls -la /var/db/clawdbot/.clawdbot/clawdbot.json
If missing, run the onboard command again.
Native module errors
If you see errors about missing .node files, rebuild them:
cd /usr/local/lib/node_modules/clawdbot/node_modules/@mariozechner/clipboard
npx napi build --platform --release
Permission errors
Ensure the clawdbot user owns its home directory:
chown -R clawdbot:clawdbot /var/db/clawdbot
Check logs
Service logs go to /var/log/clawdbot.log. Clawdbot also logs to:
/tmp/clawdbot/clawdbot-YYYY-MM-DD.log