Automating Landing Page Management with OpenClaw and a Telegram Bot
OpenClaw enables you to manage multiple landing pages via a Telegram bot: delete elements, add content, change styles, create pages, roll back changes, and collect form statistics. This reduces time-to-market from weeks to minutes. Setup requires a VPS with Ubuntu 22.04+ and 3 GB RAM for simple single-page sites.
Preparing the Server and Installing OpenClaw
Choose an OpenClaw version (e.g., nanobot). Specify the Telegram bot token with an allowlist for nicknames. Use the gpt-5.2+ or gpt-5.3-codex model. Deploy it as a systemd daemon with sudo privileges.
Create the service /etc/systemd/system/nanobot-gateway.service:
[Unit]
Description=SiteBot
After=network.target
Wants=network-online.target
[Service]
Type=simple
User=root
Group=root
ExecStart=%h/.local/bin/nanobot gateway
Restart=always
RestartSec=10
ProtectSystem=yes
# Resource limits
MemoryHigh=1G
MemoryMax=2G
MemorySwapMax=0
[Install]
WantedBy=multi-user.target
Activate it:
sudo systemctl daemon-reload
sudo systemctl enable --now nanobot-gateway
sudo systemctl start nanobot-gateway
ProtectSystem=yes prevents system damage from incorrect commands.
Integrating Playwright for Testing
Install Node.js LTS:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
Check: node --version (v20.x/v22.x), npm --version (10.x+).
Install Playwright:
npm install @playwright/mcp@latest
npx playwright install --with-deps
Add to the OpenClaw config:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--browser=firefox",
"--headless",
"--no-sandbox"
]
}
}
}
This enables automated testing of changes via a browser.
Organizing the Landing Page Storage
Create /var/www/Landings and an empty GitHub repository for version history:
git clone <repo-url> /var/www/Landings
Configuring Nginx to Serve the Sites
Install Nginx:
sudo apt update
sudo apt install nginx
sudo systemctl enable --now nginx
For a site /var/www/Landings/site1, create /etc/nginx/sites-available/site1.conf:
server {
listen 80;
server_name site1.example.com www.site1.example.com;
root /var/www/Landings/site1;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
Activate it:
sudo ln -s /etc/nginx/sites-available/site1.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Repeat for site2, site3, etc. The bot can do this automatically.
Migrating Existing Sites
Via the Telegram bot: "Clone the site example.com into /var/www/Landings/site1."
Or manually:
scp -r "/path/to/site/folder" username@ip or host of our VPS:/var/www/Landings/site1
Key Operations via the Bot
- Deleting elements: "Remove this from site X."
- Adding content: "Add that to site Y."
- Changing styles: "Change the style of site Z to..."
- Creating pages: "Create a new page for..."
- Rolling back changes: "Roll back the latest changes on site X."
- Updating icons: "Replace the icon on site X with a more modern one."
- Collecting statistics: "Collect form submission statistics from sites X, Y, Z."
Playwright will test changes in headless mode.
What's Important
- Time-to-market savings: changes with testing in minutes instead of weeks.
- Git history for rollbacks and version control.
- Restricted access via allowlist in the TG bot.
- Resource limits (MemoryHigh=1G, MemoryMax=2G) for stability.
- ProtectSystem=yes minimizes risks from AI commands.
— Editorial Team
No comments yet.