Run Moltbot in a Secure Daytona Sandbox
This guide walks you through setting up Moltbot inside a Daytona sandbox and configuring Telegram and WhatsApp channels.
Running Moltbot in a Daytona sandbox keeps your AI assistant isolated from your local machine, provides a secure environment for code execution, and ensures your bot stays online 24/7 without tying up your personal computer.
Prerequisites
- Daytona account and API key (Get it from Daytona Dashboard)
- Local terminal (macOS, Linux, or Windows)
Install the Daytona CLI
brew install daytonaio/cli/daytonapowershell -Command "irm https://get.daytona.io/windows | iex"Authenticate with Daytona
Log in to your Daytona account using your API key:
daytona login --api-key=YOUR_API_KEYReplace YOUR_API_KEY with your actual Daytona API key.
Create a Sandbox
Create a sandbox for running Moltbot:
daytona sandbox create --name moltbot --snapshot daytona-medium --auto-stop 0Moltbot comes preinstalled in the default Daytona snapshot, so the command above is all you need.
Connect to the Sandbox
SSH into your sandbox:
daytona ssh moltbotRun Moltbot Onboarding
Start the onboarding process:
clawdbot onboardFollow the prompts:
- Security acknowledgment: Accept to continue
- Onboarding mode: Select Quickstart
- Model/auth provider: Select Anthropic
- Anthropic auth method: Select Anthropic API key
- Enter Anthropic API key: Paste your API key
- Default model: Keep current (default:
anthropic/claude-opus-4-5) - Select channel: Choose Skip for now (we’ll configure channels later)
- Configure skills: Select No (configure later based on your needs)
- Enable hooks: Select Skip for now (configure later based on your needs)
- Gateway service: Select Skip (already installed)
When onboarding finishes, the output will display a Dashboard ready section with a dashboard link. Your gateway token is the value after ?token= in the URL. Save this token - you’ll need it to connect to the dashboard.
Start the Gateway
Run the gateway in the background:
nohup clawdbot gateway run > /tmp/gateway.log 2>&1 &The & runs the gateway as a background process, keeping your terminal free for other commands. The nohup ensures the gateway keeps running even after you close the SSH connection.
Access the Dashboard
The Moltbot dashboard is a web interface for managing your assistant, monitoring connections, and configuring channels. To access it, you need a preview URL that exposes the gateway port running inside your sandbox.
In your local terminal (not inside the sandbox SSH session), generate the preview URL:
daytona preview-url moltbot --port 18789This command generates a signed preview URL that securely exposes the port.
Open the URL in your browser, go to the Overview section, paste your gateway token in the Gateway Token field, and click Connect.
Pair Your Browser
Moltbot uses device pairing as a security measure - only approved devices can connect to and control your assistant. When you first attempt to connect from the dashboard, your browser registers as a new device that needs approval.
List pending device requests:
clawdbot devices listApprove your device:
clawdbot devices approve REQUEST_IDReplace REQUEST_ID with the value from the Request column.
Click Connect again in the dashboard.
Once connected, you should see a green status indicator - your Moltbot is now ready to use.
Security
Running Moltbot this way provides three layers of security:
- Preview URL: Time-limited access to the dashboard port
- Gateway token: Required to authenticate with the dashboard
- Device approval: Only approved devices can connect and control your assistant
Even if someone obtains your dashboard URL, they cannot connect without the gateway token and an approved device.
Configure Telegram
Set up a Telegram bot to chat with Moltbot.
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/start, then/newbot - Enter a name for your bot
- Enter a username for your bot
- Copy the bot token provided
Configure Moltbot
Enable Telegram and set your bot token:
clawdbot config set channels.telegram.enabled trueclawdbot config set channels.telegram.botToken YOUR_BOT_TOKENVerify the configuration:
clawdbot config get channels.telegramRestart the Gateway
clawdbot gateway stopnohup clawdbot gateway run > /tmp/gateway.log 2>&1 &Complete Verification
- Open your bot’s chat in Telegram and click Start
- A pairing code will appear. Approve the pairing request:
clawdbot pairing approve telegram PAIRING_CODEYou can now message your Moltbot through Telegram.
Configure WhatsApp
Set up WhatsApp to chat with Moltbot.
Run Configuration
clawdbot config --section channelsWhen prompted:
- Select Local (this machine) for gateway location
- Choose Configure/link
- Select WhatsApp (QR link)
- Select Yes for “Link WhatsApp now (QR)?”
Scan the QR Code
Open WhatsApp on your phone, go to Settings → Linked Devices → Link a Device, and scan the QR code displayed in your terminal.
Once paired, you’ll see:
✅ Linked after restart; web session ready.Set Up Your Phone Number
Select This is my personal phone number (or choose the other option if you have a separate phone for Moltbot) and enter your phone number when prompted.
Finish Configuration
When prompted to select another channel, choose Finished. You’ll see:
└ Configure complete.Start Chatting
Send a message to yourself in WhatsApp - Moltbot will respond. You can give it instructions and information on how to behave directly in the chat.