DEV Community

zac
zac

Posted on • Originally published at remoteopenclaw.com

OpenClaw Tutorial for Beginners: Your First AI Agent in...

Originally published on Remote OpenClaw.

OpenClaw Tutorial for Beginners: Your First AI Agent in 30 Minutes

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

Join the Community

Join 1k+ OpenClaw operators sharing deployment guides, security configs, and workflow automations.

Join the Community →

What You Need Before Starting

Before you begin, make sure you have:

  • A computer (Mac, Windows, or Linux) or a VPS for always-on operation
  • An internet connection
  • A Telegram account (free to create if you do not have one)
  • 30 minutes of uninterrupted time

You do not need any coding experience. You do not need to pay for anything — we will use free tools and free AI model tiers throughout this tutorial.

By the end of this tutorial, you will have an AI agent running on your machine, connected to Telegram, that you can chat with and that can run scheduled tasks on your behalf.


Step 1: Install Docker (5 minutes)

Docker is the container platform that runs OpenClaw. Think of it as a lightweight virtual machine that keeps OpenClaw and its dependencies neatly isolated from the rest of your system.

On Mac:

  1. Go to docker.com/products/docker-desktop
  2. Download Docker Desktop for Mac (choose Apple Silicon or Intel based on your chip)
  3. Open the downloaded .dmg file and drag Docker to Applications
  4. Open Docker Desktop from Applications and wait for it to start (you will see the Docker icon in your menu bar)

On Windows:

  1. Go to docker.com/products/docker-desktop
  2. Download Docker Desktop for Windows
  3. Run the installer and follow the prompts
  4. Restart your computer if prompted
  5. Open Docker Desktop and wait for it to start

On Linux (Ubuntu/Debian):

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Log out and log back in for group changes to take effect
Enter fullscreen mode Exit fullscreen mode

To verify Docker is working, open your terminal (Terminal on Mac, Command Prompt or PowerShell on Windows) and run:

docker --version
Enter fullscreen mode Exit fullscreen mode

You should see something like Docker version 27.x.x. If you get an error, Docker is not running — open Docker Desktop and wait for it to start.


Step 2: Create Your Project Files (5 minutes)

Create a folder for your OpenClaw project. Open your terminal and run:

mkdir ~/openclaw
cd ~/openclaw
Enter fullscreen mode Exit fullscreen mode

Now create the Docker Compose file. This tells Docker how to run OpenClaw. Create a file called docker-compose.yml with this content:

version: '3.8'
services:
 openclaw:
 image: openclaw/openclaw:latest
 container_name: openclaw
 ports:
 - "3000:3000"
 volumes:
 - ./data:/data
 env_file:
 - .env
 restart: unless-stopped
Enter fullscreen mode Exit fullscreen mode

Next, create a .env file for your configuration. This file stores your API keys and settings:

# .env file
# AI Model Configuration
MODEL_PROVIDER=google
GOOGLE_API_KEY=your-gemini-api-key-here

# Gateway Token (change this to a random string)
GATEWAY_TOKEN=my-secret-token-change-me

# Telegram Configuration
TELEGRAM_BOT_TOKEN=your-telegram-bot-token-here
TELEGRAM_ALLOWED_USERS=your-telegram-user-id
Enter fullscreen mode Exit fullscreen mode

Do not fill in the real values yet — we will get those in the next steps.

Finally, create the data directory:

mkdir -p data
Enter fullscreen mode Exit fullscreen mode

Step 3: Get Your AI Model API Key (3 minutes)

We will use Google Gemini 2.0 Flash because it is free and requires no credit card.

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the key (it starts with "AIza...")

Open your .env file and replace your-gemini-api-key-here with your actual key:

GOOGLE_API_KEY=AIzaSyB...
Enter fullscreen mode Exit fullscreen mode

While you are editing the .env file, generate a random gateway token. You can use any random string — the longer and more random, the better. This token protects your OpenClaw dashboard from unauthorized access.


Step 4: Connect Telegram (5 minutes)

Telegram is how you will talk to your agent. Here is how to set it up:

Create a Telegram bot:

  1. Open Telegram and search for @botfather
  2. Send the command /newbot
  3. Choose a name for your bot (e.g., "My OpenClaw Agent")
  4. Choose a username for your bot (must end in "bot", e.g., "my_openclaw_bot")
  5. BotFather will give you a token. Copy it.

Update your .env file with the bot token:

TELEGRAM_BOT_TOKEN=7123456789:AAH...
Enter fullscreen mode Exit fullscreen mode

Get your Telegram user ID:

  1. Search for @userinfobot on Telegram
  2. Send it any message
  3. It will reply with your user ID (a number like 123456789)

Update your .env file with your user ID:

TELEGRAM_ALLOWED_USERS=123456789
Enter fullscreen mode Exit fullscreen mode

This setting ensures only you can talk to your bot. Without it, anyone who finds your bot can use it (and your API key).


Step 5: Start OpenClaw (2 minutes)

Everything is configured. Time to launch. In your terminal, make sure you are in the ~/openclaw directory and run:

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Docker will download the OpenClaw image (about 200MB — this takes a minute or two on the first run) and start the container.

Check that it is running:

docker compose logs -f
Enter fullscreen mode Exit fullscreen mode

You should see log messages indicating OpenClaw is starting up. Look for lines like:

OpenClaw v3.23.1 starting...
Telegram bot connected
Gateway listening on port 3000
Ready.
Enter fullscreen mode Exit fullscreen mode

If you see errors, check your .env file for typos. The most common issue is a missing or incorrect API key.

Press Ctrl+C to stop watching the logs (the container keeps running in the background).


Step 6: Your First Conversation (3 minutes)

Open Telegram and find your bot (search for the username you created in Step 4). Send it a message:

Hello! What can you do?
Enter fullscreen mode Exit fullscreen mode

Your agent should reply within a few seconds. The reply comes from the AI model (Gemini) through OpenClaw. Try a few more messages:

  • "What time is it?" — Tests basic conversation
  • "Summarize the latest news about AI agents" — Tests the agent's knowledge
  • "Help me draft an email to a client about a project delay" — Tests practical utility

Congratulations — you have a working AI agent. Everything from here is about making it more useful.

You can also access the OpenClaw web UI by opening http://localhost:3000 in your browser. Enter your gateway token when prompted. The web UI shows conversation logs, settings, and system status.


Step 7: Your First Scheduled Task (7 minutes)

An agent that only responds when you message it is just a chatbot. The real power of OpenClaw is scheduled tasks — things the agent does automatically on a timer.

Let us set up a morning briefing that runs every day at 7:00 AM.

Option A: Through the web UI

  1. Open http://localhost:3000 in your browser
  2. Navigate to Settings then Scheduled Tasks
  3. Click "Add Task"
  4. Set the schedule to "0 7 * * *" (this is cron syntax for every day at 7:00 AM)
  5. Set the message to: "Give me a morning briefing. List today's date, day of the week, and 3 interesting things happening in the AI industry today. Keep it concise."
  6. Save the task

Option B: Through Telegram

Send this message to your bot:

/schedule 0 7 * * * Give me a morning briefing. List today's date, day of the week, and 3 interesting things happening in the AI industry today. Keep it concise.
Enter fullscreen mode Exit fullscreen mode

The agent will confirm the scheduled task was created.

To test it immediately without waiting until 7 AM, you can trigger it manually by sending the briefing prompt as a regular message. The scheduled version will run automatically every morning.

This is the foundation that everything else builds on. From here, you can add more scheduled tasks, install skills from ClawHub, connect additional integrations, and build increasingly sophisticated workflows.


Next Steps

You now have a working AI agent. Here is what to do next, in order of priority:

  1. Use it daily for a week. Chat with it. Ask it to help with real tasks. Learn what it does well and where it falls short. This hands-on experience is invaluable.
  2. Add more scheduled tasks. Set up an inbox summary, a daily to-do reminder, or an end-of-day recap. See our 50 Automation Ideas for inspiration.
  3. Secure your deployment. If you plan to keep OpenClaw running long-term, follow our Safety Best Practices guide. At minimum, set up HTTPS and enable sandbox mode.
  4. Install skills from ClawHub. Browse the marketplace and install skills that match your use case. Each skill extends what your agent can do.
  5. Move to a server for 24/7 operation. If you want your agent running all the time (not just when your computer is on), deploy to a VPS. Our Beginner Setup Guide covers VPS deployment.
  6. Join the community. The Remote OpenClaw community has 1k+ operators sharing configurations, troubleshooting help, and workflow ideas. You will learn faster with the community than alone.

The most important thing is to start using it. Every operator's journey is different because every person's workflow is different. The agent becomes more valuable the more you customize it to your specific needs.

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

Top comments (0)