Lesson 9 of 21

Install OpenClaw and Connect Telegram

Monthly cost: $0 (OpenClaw is free and open source) Expected time: ~15–20 minutes

The Main Event

This is where your server becomes an AI assistant. OpenClaw's install process uses a setup wizard that walks you through connecting your AI provider and messaging channels.

Step 1: Install OpenClaw

SSH into your server:

ssh claw@YOUR_SERVER_IP
cd ~/openclaw

Pull and start OpenClaw:

docker pull openclaw/openclaw:latest
docker run -d \
  --name openclaw \
  --restart unless-stopped \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/config:/app/config \
  -p 3838:3838 \
  openclaw/openclaw:latest

Verify the container is running:

docker ps

You should see an openclaw container listed with a status of Up. If it shows Restarting or isn't listed, check the logs:

docker logs openclaw --tail 20

You should see OpenClaw starting up and eventually showing a setup URL or onboarding prompt.

Step 2: Run the Setup Wizard

OpenClaw includes an onboarding wizard on first run. Follow it to:

  1. Skip the AI provider for now — we'll set up Claude (Anthropic) properly in Lesson 10
  2. Connect Telegram:
    • Select Telegram as your channel
    • Paste your bot token from Lesson 8
    • OpenClaw will automatically start polling for messages

Alternatively, you can configure Telegram directly in the config file:

nano ~/openclaw/config/default.yaml

Add your Telegram bot token in the channels section:

channels:
  telegram:
    botToken: "YOUR_BOT_TOKEN_HERE"

Restart OpenClaw after config changes:

docker restart openclaw

Step 3: Open the Firewall for OpenClaw

If you want to access the OpenClaw web interface:

sudo ufw allow 3838/tcp

Then visit http://YOUR_SERVER_IP:3838 in your browser.

Step 4: Send Your First Message

Open Telegram and send a message to your bot. Something simple:

Hello, are you there?

Watch the Docker logs in real time to confirm the message arrives:

docker logs openclaw --tail 10 -f

Press Ctrl+C to stop following the logs.

Troubleshooting

When You're Done

Further Reading