Guide
OpenClaw on Hostinger — Self-Host Your AI Agent on Hostinger VPS
A complete walkthrough for deploying OpenClaw on a Hostinger VPS: install Docker, configure your AI agent, and optionally add a custom domain with auto-HTTPS.
Why Hostinger for OpenClaw?
Hostinger has become one of the most popular choices for running self-hosted apps thanks to its affordable VPS plans, solid global data center coverage, and reliable performance. Their KVM-based VPS plans give you full root access, dedicated resources, and Docker support out of the box — exactly what OpenClaw needs.
- Affordable pricing: KVM plans start around $5/mo, with the KVM 2 plan (recommended for OpenClaw) at roughly $10–13/mo.
- Global data centers: Locations in the US, EU, Asia, and South America — pick the region closest to your users.
- KVM virtualization: Full kernel-level isolation, so Docker runs natively without compatibility workarounds.
- Pre-installed Ubuntu: Ubuntu 22.04 and 24.04 are both supported, and Docker's official install script works perfectly on both.
Requirements
Before you start, make sure you have:
- A Hostinger VPS on the KVM 2 plan or higher (2 vCPU, 8 GB RAM, 100 GB SSD — ~$10–13/mo). The KVM 1 plan (1 vCPU, 4 GB RAM) is borderline and may cause out-of-memory issues under load.
- Ubuntu 22.04 or 24.04 as the operating system (selected during VPS setup).
- Root SSH access to your server.
- A domain name (optional — only needed if you want HTTPS access to the OpenClaw gateway).
- An OpenRouter API key (or any other supported model provider key) for your AI agent.
- A Telegram bot token and/or Discord bot token to connect channels.
Step 1: Get a Hostinger VPS
Head to hostinger.com and navigate to VPS Hosting. Choose the KVM 2 plan or higher. During setup:
- Select Ubuntu 22.04 or Ubuntu 24.04 as your OS.
- Choose the data center region closest to your users.
- Set a root password or upload your SSH public key (SSH key is strongly recommended).
- Complete the purchase and wait for provisioning — usually takes 1–3 minutes.
- Note your server's IP address from the Hostinger VPS dashboard.
Step 2: Connect via SSH
Once your VPS is provisioned, open a terminal and connect:
ssh root@your-server-ipIf you uploaded an SSH key during setup, this connects instantly. If you used a password, enter it when prompted. You should land at a root shell prompt.
First, update the system packages:
apt update && apt upgrade -yStep 3: Install Docker
Docker's official install script handles everything for Ubuntu:
# Install Docker using the official script
curl -fsSL https://get.docker.com | sh
# Verify Docker installed correctly
docker --version
# Enable Docker to start on boot
systemctl enable docker
systemctl start dockerThe install script automatically detects Ubuntu and installs the correct Docker CE version. After running it, docker --version should print something like Docker version 27.x.x.
Step 4: Run OpenClaw
Create the config directory and start the OpenClaw container:
# Create the config directory (with credentials subdirectory for DM pairing)
mkdir -p ~/openclaw/credentials
chmod 777 ~/openclaw
chmod 777 ~/openclaw/credentials
# Pull the OpenClaw image
docker pull ghcr.io/openclaw/openclaw:main
# Run the container
docker run -d \
--name openclaw \
--restart unless-stopped \
--memory=4g --memory-swap=6g \
-v ~/openclaw:/home/node/.openclaw \
-p 18789:18789 \
ghcr.io/openclaw/openclaw:main \
node openclaw.mjs gateway --allow-unconfiguredKey flags explained:
--memory=4g --memory-swap=6g— Allocates 4 GB RAM on the KVM 2 plan. OpenClaw needs at least 2 GB; 4 GB gives comfortable headroom.-v ~/openclaw:/home/node/.openclaw— Mounts your config directory into the container. The container writes config changes back to this path.-p 18789:18789— Exposes the OpenClaw web gateway on port 18789.--restart unless-stopped— Auto-restarts the container after crashes or server reboots.ghcr.io/openclaw/openclaw:main— Always use the:maintag, not:latest(which doesn't exist).
chmod 777 on the config directory is required because the container runs as user node (uid 1000), which is different from your host root user. Without it, OpenClaw can't write its config files.Step 5: Configure Your Bot
Create ~/openclaw/openclaw.json with your settings. Here's a complete example with Telegram and Discord:
{
"gateway": {
"port": 18789,
"auth": { "token": "your-random-secret-token" },
"controlUi": { "allowInsecureAuth": true }
},
"models": {
"providers": {
"openrouter": {
"apiKey": "sk-or-your-openrouter-api-key"
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openrouter/anthropic/claude-sonnet-4.6"
},
"systemPrompt": "You are a helpful AI assistant."
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456:ABC-your-telegram-bot-token",
"dmPolicy": "pairing"
},
"discord": {
"enabled": true,
"botToken": "your-discord-bot-token",
"dmPolicy": "open",
"allowFrom": ["*"]
}
},
"plugins": {
"entries": {
"telegram": { "enabled": true },
"discord": { "enabled": true }
}
}
}Important configuration notes:
gateway.authmust be an object with atokenproperty — not a plain string.- Both
channels.X.enabled: trueANDplugins.entries.X.enabled: trueare required for a channel to work. - Model IDs must be prefixed with the provider:
openrouter/anthropic/claude-sonnet-4.6, not justanthropic/claude-sonnet-4.6. - Telegram
dmPolicyshould always be"pairing"— never"open", as that allows anyone on the internet to use your bot. - Discord
dmPolicy: "open"requiresallowFrom: ["*"]to pass config validation.
After saving the config, restart the container to apply it:
docker restart openclawStep 6: Set Up a Domain (Optional)
If you want to access the OpenClaw gateway over HTTPS with a custom domain (e.g. bot.yourdomain.com), set up Caddy as a reverse proxy. Caddy automatically provisions and renews SSL certificates via Let's Encrypt.
First, point your domain's A record to your Hostinger VPS IP address. Then:
# Install Caddy
apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \
| gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' \
| tee /etc/apt/sources.list.d/caddy-stable.list
apt update && apt install caddyCreate /etc/caddy/Caddyfile:
bot.yourdomain.com {
reverse_proxy localhost:18789
}Restart Caddy to apply:
systemctl restart caddyCaddy will obtain an SSL certificate automatically. Your OpenClaw gateway will be accessible at https://bot.yourdomain.com.
Hostinger VPS Plans for OpenClaw
Here's how Hostinger's KVM plans stack up for running OpenClaw:
| Plan | vCPU | RAM | Storage | Est. Price | Verdict |
|---|---|---|---|---|---|
| KVM 1 | 1 | 4 GB | 50 GB SSD | ~$5–7/mo | Borderline — works but tight on RAM |
| KVM 2 | 2 | 8 GB | 100 GB SSD | ~$10–13/mo | Recommended for OpenClaw |
| KVM 4 | 4 | 16 GB | 200 GB SSD | ~$20–25/mo | Ideal for multiple bots or heavy workloads |
| KVM 8 | 8 | 32 GB | 400 GB SSD | ~$40+/mo | Overkill for a single OpenClaw instance |
Troubleshooting
Docker container exits immediately
Check the container logs:
docker logs openclawCommon causes: malformed openclaw.json (missing comma, wrong field name), or the config directory doesn't have write permissions. Re-check your JSON with cat ~/openclaw/openclaw.json | python3 -m json.tool.
Can't connect to port 18789
Hostinger VPS usually has an open firewall by default, but check if ufw is active:
ufw status
# If active and blocking port 18789:
ufw allow 18789/tcpAlso verify the container is actually running: docker ps. If it's not listed, it exited — check the logs.
Out-of-memory crashes
If Docker kills the container with an OOM error, increase the memory limit or upgrade your plan. Check for OOM events with:
dmesg | grep -i "killed process"On KVM 2, set --memory=4g --memory-swap=6g. If crashes persist, consider the KVM 4 plan or switch to OpenClaw Launch for fully managed hosting.
Telegram bot not responding to messages
Make sure the credentials/ subdirectory exists inside your openclaw directory:
ls -la ~/openclaw/credentialsWithout this directory, dmPolicy: "pairing" silently drops incoming messages. Create it with mkdir -p ~/openclaw/credentials && chmod 777 ~/openclaw/credentials, then restart the container.
Or Skip the Setup Entirely
Self-hosting on Hostinger gives you full control, but it also means managing updates, monitoring uptime, handling Docker issues, and maintaining your server. If you'd rather just focus on your AI agent:
OpenClaw Launch deploys a fully managed OpenClaw instance in 10 seconds — no VPS, no Docker, no server maintenance. Visual configuration editor, automatic updates, built-in skills, and plans starting at $3/mo.
| Hostinger VPS (Self-Hosted) | OpenClaw Launch | |
|---|---|---|
| Setup time | 2–4 hours | 10 seconds |
| Monthly cost | ~$10–13/mo (KVM 2) + your time | From $3/mo |
| Maintenance | Manual updates, backups, monitoring | Fully managed |
| Visual config editor | No — edit JSON manually | Yes — point-and-click |
| Automatic updates | Manual docker pull + restart | Automatic |
| Uptime monitoring | Set up yourself | Built-in |