← All Guides
Intermediate 30 min

>Install OpenClaw on VPS

Rent a VPS on Hetzner, set up SSH, install OpenClaw, and configure a domain.

1

Rent a VPS on Hetzner

Sign up at hetzner.cloud and create a server:

  • Type: CX22 (2 vCPU, 4 GB RAM) — from €4/mo
  • OS: Ubuntu 24.04
  • Location: Nuremberg or Helsinki
  • Add your SSH key during creation
2

Connect via SSH

If you don't have an SSH key yet, generate one:

ssh-keygen -t ed25519 -C "your@email.com"

Connect to the server (find the IP in the Hetzner panel):

ssh root@YOUR_SERVER_IP
3

Set Up the Server

Update the system and create a user:

apt update && apt upgrade -y
adduser --disabled-password --gecos '' claw
usermod -aG sudo claw
mkdir -p /home/claw/.ssh
cp ~/.ssh/authorized_keys /home/claw/.ssh/
chown -R claw:claw /home/claw/.ssh

Install dependencies:

apt install -y curl git build-essential ufw
ufw allow OpenSSH
ufw allow 80
ufw allow 443
ufw --force enable
4

Install OpenClaw

Switch to the new user and install OpenClaw:

su - claw
curl -fsSL https://get.openclaw.ai | bash
source ~/.bashrc
openclaw --version
5

Configure Keys and Launch

openclaw setup

Create your first bot and launch as a service:

mkdir ~/bots && cd ~/bots
openclaw new morning-briefing
openclaw service install
openclaw service start

Service mode runs the bot as a systemd service — it survives server reboots.

6

Set Up a Domain (Optional)

In your domain's DNS, add an A record pointing to your server IP. Then install Caddy for automatic SSL:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install -y caddy

Configure Caddyfile:

echo "your-domain.com {
    reverse_proxy localhost:3100
}" | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
7

Verify Everything Works

openclaw service status
openclaw logs --tail 20

✓ Done! OpenClaw is running on your VPS 24/7.