OpenClaw is an AI agent that can automate tasks, respond to commands, and run workflows, while Hetzner is a cloud VPS that keeps your setup running continuously.
What is OpenClaw on Hetzner?
OpenClaw on Hetzner means running your AI agent 24/7 on a cloud server.
| Your laptop | → turns off → | OpenClaw stops ❌ |
| Hetzner VPS | → always on → | OpenClaw runs continuously ✅ |
This makes your AI agent always available, without depending on your personal device.
System Requirements
| Component | Requirement |
|---|---|
| RAM | 4 GB minimum (8 GB recommended) |
| CPU | 2 vCPU or higher |
| OS | Ubuntu / Debian |
| Storage | 20 GB+ |
| Dependencies | Docker, Docker Compose |
If these feel complex, you can skip everything and deploy OpenClaw instantly on Ampere.sh.
Step-by-Step Deployment Guide
1️⃣ Create VPS
- Go to hetzner.com and create an account
- Click Create Server
- Select Ubuntu
- Pick the plan
- Click Create & Buy Now
- Copy your server's public IP address from the dashboard
2️⃣ Connect to VPS
Open your terminal and connect via SSH:
ssh root@YOUR_VPS_IP3️⃣ Install Docker
Update your server and install Docker:
apt-get update
apt-get install -y git curl ca-certificates
curl -fsSL https://get.docker.com | shVerify:
docker --version
docker compose version4️⃣ Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw5️⃣ Create Persistent Storage
mkdir -p /root/.openclaw/workspace
chown -R 1000:1000 /root/.openclawThis ensures your data is not deleted after restart.
6️⃣ Setup Environment (.env file)
Create .env file:
OPENCLAW_IMAGE=openclaw:latest
OPENCLAW_GATEWAY_TOKEN=your-secret-token
OPENCLAW_GATEWAY_PORT=18789
OPENCLAW_CONFIG_DIR=/root/.openclaw
OPENCLAW_WORKSPACE_DIR=/root/.openclaw/workspaceGenerate secure token:
openssl rand -hex 327️⃣ Setup Docker Compose
Create docker-compose.yml and ensure the following is included:
version: "3.8"
services:
openclaw:
image: ${OPENCLAW_IMAGE}
container_name: openclaw
restart: unless-stopped
ports:
- "${OPENCLAW_GATEWAY_PORT}:${OPENCLAW_GATEWAY_PORT}"
volumes:
- ${OPENCLAW_CONFIG_DIR}:/root/.openclaw
- ${OPENCLAW_WORKSPACE_DIR}:/root/.openclaw/workspace
env_file:
- .envImportant: restart: unless-stopped — this keeps OpenClaw running even after server reboot.
8️⃣ Run OpenClaw
docker compose up -dOnce running, you can connect messaging channels like Telegram or WhatsApp from your dashboard. Check the AI agent hosting guide if you're comparing VPS options.
Access OpenClaw Dashboard via SSH Tunnel
Use SSH tunnel:
ssh -N -L 18789:127.0.0.1:18789 root@YOUR_VPS_IPThen open in browser:
http://127.0.0.1:18789/Enter your token → Access your AI dashboard.
Common Setup Issues
| Issue | Cause | Solution |
|---|---|---|
| OpenClaw not starting | Docker not installed correctly | Reinstall Docker |
| Cannot access UI | Port not tunneled | Use SSH tunnel |
| Data lost after restart | No persistent storage | Create /root/.openclaw |
| Permission errors | Wrong folder ownership | Run chown -R 1000:1000 |
Still facing issues? Skip setup and run OpenClaw instantly on Ampere.sh without any configuration.
Frequently Asked Questions
What is OpenClaw Gateway in this setup?
Do I need a VPS to run OpenClaw?
Is this setup suitable for beginners?
How do I access OpenClaw after setup?
Will my data be saved after restarting the server?
Can I connect OpenClaw with Telegram or WhatsApp?
Deploy OpenClaw without handling servers.
Run OpenClaw instantly on Ampere.sh and start using your AI agent without dealing with complex configuration.
Run on Ampere.sh →