trucmunroc.ai automation

Openclaw (TrucBot) Installation Tips

Decisions to make before, during, and just after the install

Companion to the Openclaw (TrucBot) Setup Guide

Field Notes, Not a Manual

The official OpenClaw documentation does a good job of explaining how to run each command. This guide is about the thinking — the choices you'll wish you'd made on Day 1, the small decisions that quietly determine whether you can run a second instance later, and the prep work that turns a bumpy install into a smooth one.

These notes were captured after standing up TrucBot1 from scratch and cleaning up a previous install that had drifted into an unrecoverable state. They focus on the operator-level decisions, not the OpenClaw CLI itself.

Read this in order. The decisions build on each other — choices made in Phase 1 are hard to undo by Phase 3. Spend the 10 minutes before installing; save yourself the hours after.

Decisions to Make First

These are the choices that bake themselves into your environment and become awkward to change later. Get them right up front.

  1. Pick a Mac user account name that you can live with

    macOS lets you rename a user's display name, but the underlying shortName and home directory path are fixed at creation. If you rename a user later, you can end up with a mismatch between $USER and $HOME — some tools resolve identity via one, others via the other, and they slowly tie themselves in knots.

    Pick a name that matches your bot identity from the start. If you plan to run TrucBot1, create user trucbot1 with home dir /Users/trucbot1. No mismatch, no drift.

  2. Plan the directory structure for multiple bots

    OpenClaw supports profiles via the --profile <name> flag. Each profile gets its own isolated state at ~/.openclaw-<name>/. This is the cleanest way to run multiple instances on the same machine without collisions.

    Three viable layouts, in order of isolation strength:

    • One macOS user per bot — strongest. Different home dirs, different credentials, different login sessions. Best when bots should not see each other's files.
    • One user, multiple profiles + working dirs — balanced. Same login, but each bot has its own ~/.openclaw-<name>/ state and a dedicated working directory like ~/openclaw-work-bot1/. Easiest to manage day-to-day.
    • One user, one profile, switchable configs — lightest. Useful for A/B testing prompts on the same skill set. Not real isolation.

    Whichever you pick, name profiles after bots: trucbot1, trucbot2, not main or default.

  3. Reserve a static IP for the OpenClaw server

    The server needs a known address for SSH aliases, dashboard tunnels, and any inbound webhooks. DHCP-assigned IPs that drift will break every shortcut you build.

    Two ways to do it: a static IP set on the Mac itself, or (better) a DHCP reservation on your router. The router approach keeps the binding in one place and avoids the occasional "IP already in use" surprise from a misconfigured DHCP pool.

  4. Plan your gateway port allocation

    OpenClaw's gateway defaults to 18789. If you plan to run multiple bots on the same machine, decide now which port each one will use. A simple scheme:

    • TrucBot1 → 18789
    • TrucBot2 → 18790
    • TrucBot3 → 18791

    Document this somewhere outside the bots themselves. Future-you will thank you.

Get Your Keys in Hand

The setup wizard will ask for credentials. Have them ready so you can run it end-to-end without bailing out partway through. Each bot gets its own keys — never share credentials between instances.

Anthropic API Key

Generate at console.anthropic.com → Settings → API Keys. Name it descriptively (e.g., TrucBot1-Production) so usage reports stay readable when you have multiple keys. The full key is shown once — save it to your password manager immediately.

Generate a new key per bot. Separate keys mean separate usage tracking, independent revocation, and clearer attribution when you hit a rate limit.

Telegram Bot Token (BotFather)

Open Telegram, search for @BotFather, send /newbot. You'll be asked for a display name and a unique username ending in bot. BotFather returns a token formatted <botID>:<secret> — save it immediately, it's shown once.

Each bot needs its own Telegram bot token. Sharing one token between OpenClaw instances will cause both to fight over getUpdates polling and lose messages at random.

While you're in BotFather, consider /setjoingroups → Disable if the bot is for personal DM only. Removes a whole category of group-chat abuse surface.

Your Own Telegram User ID

You'll need this to lock the bot down to your account via allowlist policy (don't skip this step — see Phase 4). Easiest source: message @userinfobot on Telegram, which replies with your numeric user ID. More private alternative: send your bot a test message after install, then check the gateway logs for your inbound message ID.

Other Service Tokens (As Needed)

Discord, WhatsApp, Slack, custom API keys for your own services — collect whatever integrations the bot needs before running the wizard. Treat them all as per-bot, not shared.

Storage: drop every token in your password manager before running the wizard. If a wizard step times out and you have to restart, you'll already have the values handy. Don't paste tokens into chat windows, screenshots, or shared documents.

Decisions During Setup

Use a user-owned npm prefix

Don't sudo npm install -g. The clean pattern is to point npm at a per-user prefix, then add that to your PATH:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
npm install -g openclaw@latest

This avoids the EACCES errors you'll otherwise hit on Homebrew Node installs, and keeps the global packages owned by the user who installed them.

Always pass --profile from the very first command

The default OpenClaw state directory is ~/.openclaw/. The moment you run any command without --profile, state can land there and bleed across what you thought were isolated instances. Get in the habit from the first setup call:

openclaw --profile trucbot1 setup

Consider adding a shell alias on the server to make this automatic:

alias oc='openclaw --profile trucbot1'
Pick a dedicated working directory

The profile dir holds state; the working directory holds your stuff — skills, custom configs, scratch files. Don't run OpenClaw from ~/. Create something like ~/openclaw-work-trucbot1/ and live there. Keeps the agent's files separate from your personal home directory clutter.

Gateway token storage: pick "plaintext" on single-user machines

The wizard will ask how to store the gateway token. On a personal Mac where the home directory is locked to your user, plaintext storage in openclaw.json is fine — same threat model as your API keys, which live there anyway.

Use SecretRef (Keychain-backed) on shared machines, Docker images, or anywhere multiple users have shell access.

Skip channels you don't have credentials for yet

The wizard will offer to set up Telegram, Discord, etc. If you don't have a token ready for one, skip it — don't paste a placeholder. You can add channels later with openclaw --profile <name> channels. Wizards that get half-configured channels are harder to debug than channels added cleanly after the fact.

Lock It Down and Verify

Switch Telegram DM policy from "pairing" to "allowlist"

Default policy is pairing, which means any Telegram user who discovers your bot can send pairing requests. Switch to allowlist immediately:

openclaw --profile trucbot1 config set channels.telegram.dmPolicy "allowlist"
openclaw --profile trucbot1 config set channels.telegram.allowFrom '["YOUR_USER_ID"]'

After this, only your Telegram account can DM the bot. Test by sending yourself a message — should work as before. If your config has stale pairing approvals from before the switch, they become inert under allowlist, but cleaning them up with openclaw --profile trucbot1 pairing is good hygiene.

Verify the gateway with a simple health check

From the same machine OpenClaw is running on:

curl -s -o /dev/null -w "HTTP %{http_code}\n" http://localhost:18789/

Any HTTP response (200, 401, 404) confirms the gateway is alive. HTTP 000 or "connection refused" means the gateway isn't running — check openclaw --profile trucbot1 status.

Back up the profile directory before you build anything on top of it

Once the bot is talking on Telegram and the dashboard loads, back up ~/.openclaw-trucbot1/ to another machine via rsync or whatever your backup pattern is. Do it now — before you invest hours in skills, AGENTS.md, and session history that would be painful to recreate.

Document the configuration choices, not just the result

Note the profile name, gateway port, working directory path, and which credentials are in which password manager entry. Six months from now, when you stand up TrucBot2, you'll want to mirror the pattern — not reverse-engineer it from a running system.

Things That Bit Us

Username / home directory mismatch is poison

A previous install had user truc with home /Users/ccornum. Tools that resolved identity via $USER and tools that resolved via $HOME disagreed silently. Over months, that drift caused the install to become unrecoverable. Fix: pick matching names from Day 1.

Don't share npm prefixes between user accounts

A global install at /usr/local/lib/node_modules owned by one user blocks all others from updating or installing without sudo. Per-user ~/.npm-global prefixes keep installs isolated and avoid permission battles.

launchd jobs can resurrect "deleted" agents

A half-installed OpenClaw can leave a launchd agent that respawns processes after a rm -rf. If reinstalls fail mysteriously, check launchctl list | grep -i claw and unload anything that's still alive before retrying.

Bot tokens are not interchangeable

Reusing the same Telegram bot token across instances causes both to fight over getUpdates polling. Messages disappear, replies hit the wrong bot, debugging is nightmarish. Always generate a new bot per instance.

One-Page Pre-Install Checklist

StepDone?
macOS user name matches bot identityCreated with matching shortName + $HOME
Static IP or DHCP reservationReserved & verified with ipconfig getifaddr en0
Profile name chosene.g., trucbot1
Gateway port allocatede.g., 18789 for first bot
Anthropic API key generatedIn password manager
Telegram bot created in BotFatherToken in password manager
Your own Telegram user ID knownFrom @userinfobot or logs
npm prefix set to ~/.npm-globalPATH updated in ~/.zshrc
Working directory createde.g., ~/openclaw-work-trucbot1/
Backup destination readyTarget machine + rsync key tested
Run through this list before you type npm install -g openclaw@latest. Ten minutes of prep saves hours of cleanup.