# How to 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.

**Published:** Mar 23, 2026 | **Author:** Alex Chen | **Read time:** 8 min read

Learn how to run OpenClaw on Hetzner VPS using Docker. Deploy your AI agent 24/7 with this complete beginner-friendly guide.

---

[OpenClaw](/blog/what-is-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.

[OpenClaw](/blog/what-is-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?


| {subject} | → {state} → | {result} |
| --- | --- | --- |

OpenClaw on Hetzner means running your AI agent 24/7 on a cloud server.

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](https://www.ampere.sh).


## Step-by-Step Deployment Guide


### 1️⃣ Create VPS

- 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:


### 3️⃣ Install Docker

Update your server and install Docker:

Verify:


### 4️⃣ Clone OpenClaw


### 5️⃣ Create Persistent Storage

This ensures your data is not deleted after restart.


### 6️⃣ Setup Environment (.env file)

Create `.env` file:

Generate secure token:


### 7️⃣ Setup Docker Compose

Create `docker-compose.yml` and ensure the following is included:


```bash
{`version: "3.8"

services:
  openclaw:
    image: \$
    container_name: openclaw
    restart: unless-stopped
    ports:
      - "\$:\$"
    volumes:
      - \$:/root/.openclaw
      - \$:/root/.openclaw/workspace
    env_file:
      - .env`}
```

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


### 8️⃣ Run OpenClaw

Once running, you can connect messaging channels like Telegram or [WhatsApp](/blog/connect-openclaw-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:

Then open in browser:

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.


## 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 →](https://www.ampere.sh/setup)


## 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.
