You’re running a lean operation. Maybe it’s a personal knowledge base, a niche community forum, or a specialized data analysis pipeline. You need the power of an AI assistant, but the recurring cloud costs for dedicated services are eating into your budget faster than a forgotten cron job. This is where self-hosting OpenClaw on a lean Hetzner VPS becomes not just a viable option, but a genuine game-changer.
Looking to get a VPS for your project? Vultr offers reliable VPS hosting starting at $5/month with global data centers. Many OpenClaw users self-host on Vultr for consistent uptime and affordable pricing.
\n
For under $10 a month, you can get a powerful, private AI companion without compromising on performance for your specific, optimized workloads. The core challenge with low-cost VPS hosting for AI is often resource allocation, especially RAM and CPU cycles for model inference. A common mistake is to try and squeeze a large language model onto a tiny instance, leading to constant swap thrashing and glacial response times. The trick here is to leverage smaller, optimized models, often quantized, and pair them with an efficient inference engine. Let’s dive into how to set this up.
\n
Choosing Your Hetzner VPS: The Sweet Spot
\n
Hetzner Cloud offers excellent bang for your buck, providing robust virtual servers at competitive prices. For our OpenClaw setup, we’re looking for a balance of CPU cores and RAM that won’t break the bank but can still handle model inference without choking.
\n
- \n
- CX11 (€4.75/month): This is our entry-level recommendation. It comes with 1 vCPU, 2 GB RAM, and 20 GB NVMe SSD. While 2GB RAM sounds modest, it’s perfectly capable of running highly quantized 7B parameter models (like Mistral 7B in a 4-bit GGUF format) for light to moderate usage.
- CX21 (€7.90/month): If your budget allows for a little more headroom, the CX21 is the sweet spot. With 2 vCPUs, 4 GB RAM, and 40 GB NVMe SSD, it provides a significantly smoother experience, allowing for slightly larger models or more concurrent requests without performance degradation. This is often the ideal choice for a personal assistant that sees regular use.
\n
\n
\n
For this guide, we’ll assume a CX11 or CX21 instance running Ubuntu 22.04 LTS, which is a stable and well-supported operating system for our purposes. When provisioning your server, ensure you set up SSH keys for secure access – password authentication should be disabled after initial setup.
\n
Initial Server Setup and Security Hardening
\n
Once your Hetzner VPS is provisioned, connect to it via SSH. Replace your_server_ip with your actual server IP address.
\n
ssh root@your_server_ip
\n
First, let’s update our system and ensure we have basic utilities.
\n
apt update && apt upgrade -y\napt install -y curl wget git
\n
For security, it’s best practice to create a non-root user and disable root login. We’ll also set up a basic firewall.
\n
adduser openclawuser\nusermod -aG sudo openclawuser\nmkdir -p /home/openclawuser/.ssh\ncp ~/.ssh/authorized_keys /home/openclawuser/.ssh/\nchown -R openclawuser:openclawuser /home/openclawuser/.ssh\nchmod 700 /home/openclawuser/.ssh\nchmod 600 /home/openclawuser/.ssh/authorized_keys
\n
Now, log out of root and log back in as openclawuser.
\n
exit\nssh openclawuser@your_server_ip
\n
Configure the Uncomplicated Firewall (UFW) to allow SSH and OpenClaw’s default port (which we’ll define later, usually 8000 or 8080).
\n
sudo ufw allow OpenSSH\nsudo ufw allow 8000/tcp # Or your chosen OpenClaw port\nsudo ufw enable
\n
When prompted, type y and press Enter. Your firewall is now active.
\n
Installing Docker and Docker Compose
\n
Docker is essential for our setup. It allows us to containerize OpenClaw and its inference engine, making deployment and management incredibly straightforward. Docker Compose will help us define and run multi-container applications.
\n
Install Docker:
\n
curl -fsSL https://get.docker.com -o get-docker.sh\nsudo sh get-docker.sh\nsudo usermod -aG docker openclawuser # Add your user to the docker group\nnewgrp docker # Apply group changes without logging out
\n
Install Docker Compose (ensure you get the latest stable version):
\n
sudo mkdir -p /usr/local/lib/docker/cli-plugins\nsudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64" -o /usr/local/lib/docker/cli-plugins/docker-compose\nsudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
\n
Verify installations:
\n
docker --version\ndocker compose version
\n
Setting Up OpenClaw with Optimized Models
\n
This is where the magic happens. OpenClaw itself is relatively lightweight, but the inference engine that runs the Large Language Models (LLMs) is the resource hog. To keep costs under $10/month, we absolutely *must* leverage quantized models and efficient inference engines.
\n
For CPU-only inference, llama.cpp (or tools built on it like Ollama) is the gold standard. It allows us to run models in the GGUF format, which are highly optimized and quantized versions of popular models.
\n
Let’s create a directory for our OpenClaw project and a docker-compose.yml file:
\n
mkdir openclaw-hetzner\ncd openclaw-hetzner\ntouch docker-compose.yml
\n
Now, open docker-compose.yml with your favorite editor (e.g., nano docker-compose.yml) and paste the following configuration. We’ll use Ollama as our inference engine for simplicity, as it handles model downloads and serves a compatible API.
\n
version: '3.8'
\n
services:
\n ollama:
\n image: ollama/ollama:latest
\n container_name: openclaw_ollama
\n ports:
\n - "11434:11434" # Ollama API port
\n volumes:
\n
\n
Written by: Alex Torres, Editor at OpenClaw Resource
\n
Last Updated: May 2026
\n
Our Editorial Standards | How We Review Skills | Affiliate Disclosure
\n
Need to protect your home server from power outages? See our guide to the best UPS for home server protection →
Leave a Reply