DEV Community

Sixtus Anyanwu
Sixtus Anyanwu

Posted on

Setting Up Your Own AI Assistant (Clawdbot) on Hetzner

Clawdbot gives you a private, always-available AI companion that lives on your server and communicates via Telegram, WhatsApp, Discord, or similar apps. Unlike cloud-based chat interfaces, it stays online 24/7, retains full context from past interactions, and can even initiate contact when needed.

This tutorial walks you through deploying Clawdbot on a low-cost Hetzner Cloud VPS from scratch.

Phase 1: Provision Your Hetzner VPS

  1. Head to the Hetzner Cloud website Visit https://hetzner.com/cloud and sign up or log in.

  1. Start a fresh project

    In the console, select + New Project and give it a clear name like “Personal-AI” or “Clawdbot-Home”.

  2. Launch a server instance

    Inside your project, hit + Create Server.

  3. Select configuration options

    • Location: Choose a German datacenter (usually the most economical)
    • Operating system: Ubuntu 24.04
    • Instance type: Go with Shared vCPU → CX33 (4 vCPU / 8 GB RAM) — priced at roughly €5.49/month
    • IPv4 address: Leave public IPv4 enabled
  4. Attach an SSH public key

    If you need to generate a key pair:

    Open a terminal (on macOS/Linux) and execute:

   ssh-keygen -t ed25519 -C "you@example.com"
Enter fullscreen mode Exit fullscreen mode

Accept the default file path by pressing Enter. Then view and copy the public key:

   cat ~/.ssh/id_ed25519.pub
Enter fullscreen mode Exit fullscreen mode

Paste that entire line into the SSH keys section in Hetzner.

  1. Finalize and deploy Name the server something like “ai-assistant”, review, then click Create & Buy Now. Wait ~30–60 seconds. Once ready, copy the displayed public IPv4 address.

Phase 2: Server Access and Software Setup

  1. Establish an SSH connection In your terminal:
   ssh root@YOUR_SERVER_IP_HERE
Enter fullscreen mode Exit fullscreen mode

Accept the host key fingerprint by typing yes.

(If your key is in a non-default location, add the -i flag:

   ssh -i ~/.ssh/my-special-key root@YOUR_SERVER_IP_HERE
Enter fullscreen mode Exit fullscreen mode


)

  1. Refresh all packages
   apt update && apt upgrade -y
Enter fullscreen mode Exit fullscreen mode
  1. Install the latest Node.js (v22 recommended)
   curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
   apt install -y nodejs
Enter fullscreen mode Exit fullscreen mode

Confirm the version:

   node -v
Enter fullscreen mode Exit fullscreen mode

You should see something like v22.x.x.

  1. Install Clawdbot globally

    npm install -g clawdbot@latest
    
  2. Launch the setup assistant

    clawdbot onboard --install-daemon
    

    This interactive wizard handles model credentials, storage paths, messaging channels, and daemon/service registration so the bot runs persistently.

Phase 3: Connect Telegram (Most Popular Option)

  1. Register a new Telegram bot

    In Telegram, find @botfather

    Send: /newbot

    Choose a display name (e.g. “Personal Helper”)

    Choose a username ending in “bot” (e.g. myname_helper_bot)

    Copy the HTTP API token BotFather provides.

  2. Retrieve your own Telegram user ID

    Search for @userinfobot, send any message → it replies with your numeric ID. Copy that number.

  3. Provide details during the wizard

    When prompted:

    • Paste the bot token
    • Enter your user ID in the allowFrom field (this whitelist prevents unauthorized access)

Phase 4: Link Anthropic (Claude) Access

  1. Obtain an Anthropic API key

    Visit https://console.anthropic.com → create a new key (begins with sk-ant-…).

    Already have Claude Pro / Max?

    You may use subscription access instead of pay-per-token. (Some setups allow exporting a session token via the Claude desktop app or CLI—check current docs if needed.)

  2. Input credentials in the wizard

    Select API Key when asked for Anthropic authentication and paste your key.

Phase 5: Wrap Up and Verify

  1. Finish all wizard questions

    Stick with defaults for most remaining options unless you have specific preferences. The wizard sets up a background service so Clawdbot auto-starts and survives reboots.

  2. Check service status

    clawdbot status
    

    Look for “gateway: running” or similar healthy indicators.

  3. Send your first message!

    Open Telegram, search for your new bot, and type anything. It should reply quickly. Success! 🎉

Handy Commands Reference

Server / Process Control

  • clawdbot status → overall health snapshot
  • clawdbot logs --follow → tail live output
  • clawdbot gateway restart → quick reboot of the messaging layer
  • clawdbot health → run diagnostics

In-chat Telegram Commands

  • /new → reset current thread
  • /model → change active LLM
  • /compact → shorten long context
  • stop → interrupt active operation

Quick Fixes

  • Bot silent? → clawdbot status --all and clawdbot logs --follow
  • Want to restart setup? → clawdbot reset then re-run clawdbot onboard --install-daemon
  • SSH keeps asking for password? → Ensure you're using the correct key: ssh -i /path/to/key root@IP

Next Steps & Customization

After setup, personalize behavior by editing:

  • ~/clawd/SOUL.md → bot personality & tone
  • ~/clawd/USER.md → your preferences, routines, context

Enjoy your private, always-on AI companion!

Top comments (0)