What you’ll need
Before starting, make sure you have:- An AWS account (free tier eligible for some services)
- A Telegram account
- An API key from either:
Cost overview
The recommended AWS Lightsail instance costs approximately $20/month for a 4GB RAM instance, which provides sufficient resources for running OpenClaw reliably.Create your Lightsail instance
Step 1: Access AWS Lightsail
- Sign in to the AWS Console
- Search for “Lightsail” in the services search bar
- Click Create instance
Step 2: Configure the instance
- Select your instance location: Choose the AWS Region closest to you for better latency
- Select a platform: Choose Linux/Unix
- Select a blueprint: Choose OS Only → Ubuntu 24.04 LTS
- Choose your instance plan: Select the $20 USD plan (4 GB RAM, 2 vCPUs, 80 GB SSD)
- Name your instance: Enter a descriptive name like
openclaw-server - Click Create instance
Access your instance
You have two options for connecting to your server.Option 1: Browser-based SSH (easiest)
- In the Lightsail console, find your instance
- Click the terminal icon or Connect using SSH
- A browser-based terminal opens automatically
Option 2: SSH with keys (recommended for regular use)
- In Lightsail, go to Account → SSH keys
- Download your default key or create a new one
- Save the
.pemfile securely on your computer - Set proper permissions and connect:
Terminal
YOUR_INSTANCE_IP with your instance’s public IP address (found in the Lightsail console).
Install dependencies
Once connected to your instance, update the system and install Node.js.Update system packages
Terminal
Install Node.js 22+
OpenClaw requires Node.js version 22 or higher. Install it using NodeSource:Terminal
Verify installation
Terminal
Install and configure OpenClaw
Install OpenClaw globally
Terminal
Run the onboarding wizard
OpenClaw includes an interactive setup wizard:Terminal
- Choosing your AI provider (Anthropic or OpenAI)
- Entering your API key
- Configuring basic settings
Configure your AI provider
After onboarding, you can customize your configuration. Edit the config file:Terminal
For Anthropic Claude
Anthropic configuration
For OpenAI
OpenAI configuration
Ctrl+O, then exit with Ctrl+X.
Set up Telegram integration
Create a Telegram bot
- Open Telegram and search for @BotFather
- Start a chat and send
/newbot - Follow the prompts to:
- Choose a name for your bot (e.g., “My OpenClaw Assistant”)
- Choose a username (must end in
bot, e.g.,myopenclaw_bot)
- BotFather responds with your bot token - save this securely
Configure OpenClaw for Telegram
Add the Telegram channel to your OpenClaw configuration:Terminal
Full configuration with Telegram
YOUR_TELEGRAM_BOT_TOKEN with the token from BotFather.
Extend OpenClaw with skills
Skills extend OpenClaw’s capabilities with specialized functionality for onchain interactions.Add Base skills with Bankr
The Bankr skills library provides onchain capabilities for Base, including trading, messaging, and DeFi automation.Terminal
Example conversations
Enable self-learning for onchain actions
Create a skill that teaches OpenClaw to build its own skills when it learns new onchain patterns:Terminal
SKILL.md
Terminal
Example
Running OpenClaw
Start the agent
Run OpenClaw to start your assistant:Terminal
Test your setup
- Open Telegram and find your bot
- Send a message like “Hello!”
- Your OpenClaw assistant should respond
Access the Gateway Dashboard
OpenClaw includes a Gateway Dashboard UI on port 18789 for monitoring and managing your agent. Since this port isn’t exposed publicly, use SSH tunneling to access it securely from your local machine. Set up the tunnel:Terminal
Ensure port 443 (HTTPS) is open for IPv4 in your Lightsail instance’s networking settings. In the Lightsail console, go to your instance → Networking → IPv4 Firewall and add a rule for HTTPS (port 443).
Security best practices
Configure the firewall
Enable and configure Ubuntu’s firewall (UFW):Terminal
Protect your API keys
Your API keys are stored in~/.openclaw/openclaw.json. Ensure proper permissions:
Terminal
Use SSH keys only
For enhanced security, disable password authentication:- Edit the SSH config:
Terminal
- Find and set:
sshd_config
- Restart SSH:
Terminal