Hostinger VPS Deploy
Deploy Koda (OpenClaw) on Hostinger VPS servers with GUI access for AI virtual employees.
Overview
This skill automates:
- 1. API-driven provisioning — Deploy VPS instances via Hostinger API MCP tools
- Server hardening — SSH keys, firewall, fail2ban
- GUI installation — XFCE desktop + VNC/XRDP for remote access
- Docker setup — Container runtime for Koda
- Koda deployment — AI assistant with webchat interface
- Identity config — Unique name/persona for each virtual employee
Hostinger API Integration (MCP)
Dashboard Tab
OpenClaw has a built-in Hostinger tab in the Control dashboard (Integrations group).
From the tab you can:
- - Enter your Hostinger API token (stored securely in vault)
- Set your GitHub repo URL (OpenClaw fork to install on new VPS instances)
- View all available MCP tools grouped by category
- Reference the Key VPS Tools quick guide
Getting Your API Token
- 1. Log into hPanel
- Go to API Tokens → Create new token
- Copy the token and paste it in the OpenClaw Hostinger tab
MCP Server
The hostinger-api-mcp npm package is Hostinger's official MCP server.
- - Install:
npm install -g hostinger-api-mcp (already installed) - Auth: Bearer token via
API_TOKEN env var - Transport: stdio (default) or HTTP streaming
Important: The API token is stored in ~/.openclaw/secrets.json (the vault), not in plaintext in mcporter config. A SecretRef points to the vault key HOSTINGER_API_TOKEN.
Key API Endpoints
| Tool | Method | Path |
|---|
| INLINECODE6 | GET | INLINECODE7 |
| INLINECODE8 |
POST |
/api/vps/v1/virtual-machines |
|
vps_getDataCenterListV1 | GET |
/api/vps/v1/data-centers |
|
vps_getOsListV1 | GET |
/api/vps/v1/os |
|
vps_startVirtualMachineV1 | POST |
/api/vps/v1/virtual-machines/{id}/start |
|
vps_stopVirtualMachineV1 | POST |
/api/vps/v1/virtual-machines/{id}/stop |
|
vps_restartVirtualMachineV1 | POST |
/api/vps/v1/virtual-machines/{id}/restart |
|
vps_resetPasswordV1 | POST |
/api/vps/v1/virtual-machines/{id}/reset-password |
|
vps_getMetricsV1 | GET |
/api/vps/v1/virtual-machines/{id}/metrics |
|
billing_getCatalogItemListV1 | GET |
/api/billing/v1/catalog |
|
billing_getPaymentMethodListV1 | GET |
/api/billing/v1/payment-methods |
Using Tools via mcporter
CODEBLOCK0
API Documentation Links
| Resource | URL |
|---|
| API Reference | https://developers.hostinger.com/ |
| Overview |
https://developers.hostinger.com/#description/overview |
| Authentication | https://developers.hostinger.com/#description/authentication |
| SDKs & Tools | https://developers.hostinger.com/#description/sdks--tools |
| Official MCP Server (GitHub) | https://github.com/hostinger/api-mcp-server |
| Postman Collection | https://app.getpostman.com/run-collection/36145449-4a733c4f-6704-49f6-832a-0ccd28c37021 |
| hPanel API Tokens | https://hpanel.hostinger.com/api-tokens |
VPS Deployment Workflow
Step 1: Get a VPS
CODEBLOCK1
Step 2: Set Up the Server
Once the VPS is running (get IP from vps_getVirtualMachineListV1):
CODEBLOCK2
Step 3: Install OpenClaw Fork
If a GitHub repo is configured (via the Hostinger tab), Koda will:
- 1. SSH into the new VPS
- Clone the configured repo (e.g.,
https://github.com/your-org/openclaw) - Run the install script
Manual Step-by-Step Scripts
CODEBLOCK3
Scripts
| Script | Purpose |
|---|
| INLINECODE30 | Updates, firewall, fail2ban, create user |
| INLINECODE31 |
XFCE desktop + XRDP (Windows Remote Desktop) |
|
03-install-docker.sh | Docker + Docker Compose |
|
04-deploy-koda.sh | Pull/build Koda, start container |
|
05-configure-identity.sh | Set agent name, create workspace |
|
deploy-all.sh | Run all scripts in sequence |
Connecting to Your VPS
After deployment:
- - Remote Desktop (RDP): Connect with Windows Remote Desktop or Remmina to INLINECODE36
- VNC: Connect to
SERVER_IP:5901 (if VNC installed) - Webchat: Open
http://SERVER_IP:18789 in browser - SSH: INLINECODE39
Default credentials (change after first login):
- - Username: INLINECODE40
- Password: Set during deployment
Firewall Ports
| Port | Service | Customizable |
|---|
| 22 (default) | SSH | ✅ Set via SSH_PORT |
| 3389 |
XRDP (Remote Desktop) | ❌ |
| 18789 (default) | Koda webchat | ✅ Set via KODA_PORT |
Security
Vault Storage
The Hostinger API token is stored in ~/.openclaw/secrets.json under the key HOSTINGER_API_TOKEN. It is never stored in plaintext in mcporter.json — only a SecretRef pointer is stored there.
Post-Deployment Hardening
CODEBLOCK4
| Script | Purpose |
|---|
| INLINECODE44 | SSH key-only auth |
| INLINECODE45 |
Zero-trust VPN mesh |
|
security/setup-cloudflare-tunnel.sh | HTTPS via Cloudflare |
|
security/setup-wireguard.sh | Self-hosted VPN |
|
security/setup-https.sh | Let's Encrypt SSL + Nginx |
|
security/harden-server.sh | Kernel hardening, auto-updates |
|
security/lockdown-public.sh | Remove all public port access |
Reference Files
| File | Purpose |
|---|
| INLINECODE51 | Gateway RPC handlers for Hostinger API |
| INLINECODE52 |
UI tab rendering (Lit) |
|
references/hostinger-controller.ts | UI state management |
|
references/hostinger-notes.md | hPanel navigation notes |
|
references/identity-setup.md | Per-agent identity configuration |
|
references/security-options.md | Security comparison guide |
VPS Plans
Recommended for Koda/OpenClaw:
- - KVM 2 (2 GB RAM) — Minimum for headless Koda
- KVM 4 (4 GB RAM) — Recommended for GUI + Koda
- KVM 8 (8 GB RAM) — Comfortable for heavy workloads
OS: Ubuntu 22.04 or 24.04 LTS
Troubleshooting
Can't connect via RDP?
- - Ensure port 3389 is open: INLINECODE57
- Check XRDP status: INLINECODE58
Koda not starting?
- - Check Docker: INLINECODE59
- View logs: INLINECODE60
GUI slow?
- - XFCE is lightweight but VPS needs 2GB+ RAM
- Consider headless mode if GUI not needed
MCP tools not loading?
- - Verify token is saved: check
~/.openclaw/secrets.json for INLINECODE62 - Run: INLINECODE63
Hostinger VPS 部署
在 Hostinger VPS 服务器上部署 Koda(OpenClaw),并提供图形界面访问,用于 AI 虚拟员工。
概述
本技能自动化实现:
- 1. 基于 API 的资源调配 — 通过 Hostinger API MCP 工具部署 VPS 实例
- 服务器加固 — SSH 密钥、防火墙、fail2ban
- 图形界面安装 — XFCE 桌面 + VNC/XRDP 远程访问
- Docker 环境搭建 — Koda 的容器运行时
- Koda 部署 — 带网页聊天界面的 AI 助手
- 身份配置 — 为每个虚拟员工设置唯一名称/角色
Hostinger API 集成(MCP)
仪表盘标签页
OpenClaw 在控制仪表盘(集成组)中内置了 Hostinger 标签页。
在该标签页中,您可以:
- - 输入您的 Hostinger API 令牌(安全存储在保险库中)
- 设置您的 GitHub 仓库 URL(要在新 VPS 实例上安装的 OpenClaw 分支)
- 查看按类别分组的全部可用 MCP 工具
- 参考 关键 VPS 工具 快速指南
获取 API 令牌
- 1. 登录 hPanel
- 进入 API 令牌 → 创建新令牌
- 复制令牌并粘贴到 OpenClaw 的 Hostinger 标签页中
MCP 服务器
hostinger-api-mcp npm 包是 Hostinger 官方的 MCP 服务器。
- - 安装:npm install -g hostinger-api-mcp(已安装)
- 认证:通过 API_TOKEN 环境变量的 Bearer 令牌
- 传输方式:stdio(默认)或 HTTP 流式传输
重要提示: API 令牌存储在 ~/.openclaw/secrets.json(保险库)中,而非以明文形式存储在 mcporter 配置中。SecretRef 指向保险库中的 HOSTINGERAPITOKEN 键。
关键 API 端点
| 工具 | 方法 | 路径 |
|---|
| vpsgetVirtualMachineListV1 | GET | /api/vps/v1/virtual-machines |
| vpscreateVirtualMachineV1 |
POST | /api/vps/v1/virtual-machines |
| vps_getDataCenterListV1 | GET | /api/vps/v1/data-centers |
| vps_getOsListV1 | GET | /api/vps/v1/os |
| vps_startVirtualMachineV1 | POST | /api/vps/v1/virtual-machines/{id}/start |
| vps_stopVirtualMachineV1 | POST | /api/vps/v1/virtual-machines/{id}/stop |
| vps_restartVirtualMachineV1 | POST | /api/vps/v1/virtual-machines/{id}/restart |
| vps_resetPasswordV1 | POST | /api/vps/v1/virtual-machines/{id}/reset-password |
| vps_getMetricsV1 | GET | /api/vps/v1/virtual-machines/{id}/metrics |
| billing_getCatalogItemListV1 | GET | /api/billing/v1/catalog |
| billing_getPaymentMethodListV1 | GET | /api/billing/v1/payment-methods |
通过 mcporter 使用工具
bash
列出所有 VPS 实例
mcporter call hostinger-api.vps_getVirtualMachineListV1
查看可用 VPS 套餐(价格单位为分)
mcporter call hostinger-api.billing_getCatalogItemListV1 category=VPS
列出数据中心
mcporter call hostinger-api.vps_getDataCenterListV1
列出操作系统选项
mcporter call hostinger-api.vps_getOsListV1
部署新 VPS(需要套餐项目 ID、操作系统 ID、数据中心 ID)
mcporter call hostinger-api.vps_createVirtualMachineV1 ...
API 文档链接
| 资源 | URL |
|---|
| API 参考 | https://developers.hostinger.com/ |
| 概述 |
https://developers.hostinger.com/#description/overview |
| 认证 | https://developers.hostinger.com/#description/authentication |
| SDK 与工具 | https://developers.hostinger.com/#description/sdks--tools |
| 官方 MCP 服务器(GitHub) | https://github.com/hostinger/api-mcp-server |
| Postman 集合 | https://app.getpostman.com/run-collection/36145449-4a733c4f-6704-49f6-832a-0ccd28c37021 |
| hPanel API 令牌 | https://hpanel.hostinger.com/api-tokens |
VPS 部署工作流程
步骤 1:获取 VPS
bash
1. 检查可用套餐
mcporter call hostinger-api.billing_getCatalogItemListV1 category=VPS
2. 选择数据中心
mcporter call hostinger-api.vps_getDataCenterListV1
3. 选择操作系统(推荐 Ubuntu 24.04)
mcporter call hostinger-api.vps_getOsListV1
4. 部署
mcporter call hostinger-api.vps_createVirtualMachineV1 \
--args {plan:..., datacenter
id: ..., osid: ...}
步骤 2:设置服务器
VPS 运行后(从 vps_getVirtualMachineListV1 获取 IP):
bash
一键完整部署
scripts/deploy-all.sh SERVER
IP Agent Name [KODAPORT] [SSH_PORT]
示例:
scripts/deploy-all.sh 1.2.3.4 Alex
scripts/deploy-all.sh 1.2.3.4 Alex 9443 2222
步骤 3:安装 OpenClaw 分支
如果配置了 GitHub 仓库(通过 Hostinger 标签页),Koda 将:
- 1. SSH 进入新 VPS
- 克隆配置的仓库(例如 https://github.com/your-org/openclaw)
- 运行安装脚本
手动分步脚本
bash
1. 初始服务器设置(使用自定义端口)
ssh root@SERVER_IP bash -s 9443 2222 < scripts/01-server-setup.sh
2. 安装图形界面 + 远程桌面
ssh -p 2222 root@SERVER_IP bash -s < scripts/02-install-gui.sh
3. 安装 Docker
ssh -p 2222 root@SERVER_IP bash -s < scripts/03-install-docker.sh
4. 部署 Koda(使用自定义端口)
ssh -p 2222 root@SERVER_IP bash -s 9443 < scripts/04-deploy-koda.sh
5. 配置身份
ssh -p 2222 root@SERVER_IP bash -s < scripts/05-configure-identity.sh Agent Name
脚本
| 脚本 | 用途 |
|---|
| 01-server-setup.sh | 更新、防火墙、fail2ban、创建用户 |
| 02-install-gui.sh |
XFCE 桌面 + XRDP(Windows 远程桌面) |
| 03-install-docker.sh | Docker + Docker Compose |
| 04-deploy-koda.sh | 拉取/构建 Koda,启动容器 |
| 05-configure-identity.sh | 设置代理名称,创建工作区 |
| deploy-all.sh | 按顺序运行所有脚本 |
连接到您的 VPS
部署后:
- - 远程桌面(RDP):使用 Windows 远程桌面或 Remmina 连接到 SERVERIP:3389
- VNC:连接到 SERVERIP:5901(如果安装了 VNC)
- 网页聊天:在浏览器中打开 http://SERVERIP:18789
- SSH:ssh koda@SERVERIP
默认凭据(首次登录后请更改):
防火墙端口
| 端口 | 服务 | 可自定义 |
|---|
| 22(默认) | SSH | ✅ 通过 SSH_PORT 设置 |
| 3389 |
XRDP(远程桌面) | ❌ |
| 18789(默认) | Koda 网页聊天 | ✅ 通过 KODA_PORT 设置 |