Installation Guide

Run OpenClaw on Hetzner VPS

Deploy OpenClaw on Hetzner VPS using Docker. Simple step-by-step guide to run your AI agent with secure access and setup.

8 min read
Mar 23, 2026
Ampere Team

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 laptopturns offOpenClaw stops ❌
Hetzner VPSalways onOpenClaw runs continuously ✅

This makes your AI agent always available, without depending on your personal device.

System Requirements

ComponentRequirement
RAM4 GB minimum (8 GB recommended)
CPU2 vCPU or higher
OSUbuntu / Debian
Storage20 GB+
DependenciesDocker, 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_IP

3️⃣ 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 | sh

Verify:

docker --version docker compose version

4️⃣ Clone OpenClaw

git clone https://github.com/openclaw/openclaw.git cd openclaw

5️⃣ Create Persistent Storage

mkdir -p /root/.openclaw/workspace chown -R 1000:1000 /root/.openclaw

This 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/workspace

Generate secure token:

openssl rand -hex 32

7️⃣ 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: - .env

Important: restart: unless-stopped — this keeps OpenClaw running even after server reboot.

8️⃣ Run OpenClaw

docker compose up -d

Once 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_IP

Then open in browser:

http://127.0.0.1:18789/

Enter your token → Access your AI dashboard.

Common Setup Issues

IssueCauseSolution
OpenClaw not startingDocker not installed correctlyReinstall Docker
Cannot access UIPort not tunneledUse SSH tunnel
Data lost after restartNo persistent storageCreate /root/.openclaw
Permission errorsWrong folder ownershipRun 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?
OpenClaw Gateway is the main service that runs your AI agent and provides a web interface to manage and control it.
Do I need a VPS to run OpenClaw?
No, you can run it locally, but it won't stay active 24/7. A VPS like Hetzner keeps it running continuously.
Is this setup suitable for beginners?
It requires basic knowledge of SSH, Docker, and server setup. Beginners can follow the steps, but it's not fully beginner-friendly.
How do I access OpenClaw after setup?
You can access it securely using an SSH tunnel and open it in your browser at http://127.0.0.1:18789.
Will my data be saved after restarting the server?
Yes, if you configure persistent storage (/root/.openclaw), your data will remain safe after restarts.
Can I connect OpenClaw with Telegram or WhatsApp?
Yes, you can integrate it using API tokens like Telegram bot token or WhatsApp QR during setup.

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 →