How to Install and Set Up OpenClaw: A Step-by-Step Guide
Setting up OpenClaw can seem intimidating if you're not technical, but I promise it's easier than it looks.I'm going to walk you through the entire process step by step, from installation to your first conversation with your new AI assistant.
What You'll Need
Before we start, make sure you have:
A computer or server where you can run OpenClaw (Linux, Mac, or Windows with WSL)
Basic command-line knowledge (don't worry, I'll explain everything)
An OpenAI API key (you can get one from platform.openai.com)
About 30 minutes of time
Optional but recommended:
A Telegram account (for mobile access to OpenClaw)
A server or VPS if you want OpenClaw to run 24/7
Step 1: Install Prerequisites
OpenClaw requires Python 3.10 or higher and a few other tools.
On Ubuntu/Debian:
sudo apt update
sudo apt install python3 python3-pip git
On Mac (using Homebrew):
brew install python git
On Windows:
Install WSL (Windows Subsystem for Linux) and follow the Ubuntu instructions.
Step 2: Clone the OpenClaw Repository
Open your terminal and run:
git clone https://github.com/blackforestlabs/openclaw.git
cd openclaw
This downloads the OpenClaw code to your computer.
Step 3: Install Dependencies
OpenClaw uses Python, so we need to install its dependencies:
pip3 install -r requirements.txt
This might take a few minutes. Grab a coffee.
Step 4: Configure OpenClaw
OpenClaw uses a configuration file to store your settings.
Copy the example config:
cp config.example.yaml config.yaml
Now open config.yaml in a text editor:
nano config.yaml
You'll need to add your OpenAI API key:
openai:
api_key: "your-api-key-here"
Save and close the file (Ctrl+X, then Y, then Enter in nano).
Step 5: Set Up Telegram Integration (Optional but Recommended)
OpenClaw works great with Telegram, so you can interact with it from your phone.
Create a Telegram bot:
Open Telegram and search for @BotFather
Send /newbot and follow the instructions
Copy the bot token you receive
Add the bot token to your config.yaml:
telegram:
bot_token: "your-telegram-bot-token"
Step 6: Initialize the Database
OpenClaw uses a database to store memory and context.
Run:
python3 setup.py
This creates the necessary database files.
Step 7: Start OpenClaw
You're ready to launch OpenClaw!
python3 main.py
You should see output indicating that OpenClaw is running.
If you set up Telegram, open Telegram and search for your bot. Send it a message like "Hello!" and it should respond.
Step 8: Test It Out
Try these commands to test OpenClaw:
"What can you do?"
"Remember that my favorite color is blue."
"What's my favorite color?"
"Search the web for the latest AI news."
OpenClaw should respond intelligently and remember information across conversations.
Running OpenClaw 24/7
If you want OpenClaw to run continuously (even when you close your terminal), you have a few options.
Option 1: Use screen or tmux
screen -S openclaw
python3 main.py
Press Ctrl+A then D to detach. OpenClaw will keep running in the background.
Option 2: Use a systemd service (Linux)
Create a service file:
sudo nano /etc/systemd/system/openclaw.service
Add:
[Unit]
Description=OpenClaw AI Assistant
After=network.target
[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/openclaw
ExecStart=/usr/bin/python3 /path/to/openclaw/main.py
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl enable openclaw
sudo systemctl start openclaw
Option 3: Use a VPS or cloud server
Rent a cheap VPS (like DigitalOcean, Linode, or AWS) and run OpenClaw there. This ensures it's always online.
Troubleshooting Common Issues
Issue: "ModuleNotFoundError"
Solution: Make sure you installed all dependencies:
pip3 install -r requirements.txt
Issue: "OpenAI API key not found"
Solution: Double-check that you added your API key to config.yaml correctly.
Issue: Telegram bot not responding
Solution: Make sure you added the correct bot token and that OpenClaw is running.
Issue: High API costs
Solution: OpenClaw can use a lot of API calls if it's very active. Monitor your usage and adjust settings if needed.
Next Steps
Now that OpenClaw is running, here's what to explore next:
Customize the system prompt: Edit config.yaml to change how OpenClaw behaves.
Add skills: OpenClaw supports custom skills (like plugins). Check the documentation for how to add them.
Set up automation: Use OpenClaw to monitor websites, manage your calendar, or handle repetitive tasks.
Explore multi-agent features: Spawn multiple OpenClaw agents for different tasks.
Final Thoughts
Setting up OpenClaw takes a bit of effort, but once it's running, it's incredibly powerful.
You now have a 24/7 AI assistant that can help with research, automation, and productivity.
If you run into issues, the OpenClaw community is helpful and active. Don't hesitate to ask for help.
What are you going to use OpenClaw for? Let me know in the comments!