Home » Openclaw» Install OpenClaw on Hetzner (Step-by-Step Guide)

Install OpenClaw on Hetzner

This guide shows how to install openclaw on hetzner using an Ubuntu 24.04 VPS with Docker and Node.js. Direct answer: yes — you can run OpenClaw reliably on a Hetzner VPS; this tutorial gives the exact commands, update and security steps, troubleshooting tips, and a screenshots checklist so beginners can complete the deployment.

Install OpenClaw on Hetzner — Prerequisites

  • A Hetzner VPS running Ubuntu 24.04 (root SSH access)
  • Basic SSH knowledge and a non-root sudo user
  • Docker and Docker Compose (we install these below)
  • Git and Node.js (for build or local tooling)
  • Read server requirements before provisioning hardware
  • Consider reading about securing your machine: secure VPS

Set up the Hetzner VPS

After provisioning a Hetzner VPS, connect as root or your sudo user and run the initial system update and basic user setup.

# update packages
sudo apt update && sudo apt upgrade -y

# create a non-root sudo user (replace alice)
sudo adduser alice
sudo usermod -aG sudo alice

# enable UFW defaults (allow SSH)
sudo ufw allow OpenSSH
sudo ufw enable

Install Docker and Docker Compose

Use the official Docker repository to install the latest stable Docker and the compose plugin.

# install prerequisites
sudo apt install -y ca-certificates curl gnupg lsb-release

# add Docker's official GPG key and repo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# install Docker Engine and Compose plugin
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

# allow your user to run docker (log out/in required)
sudo usermod -aG docker $USER

# enable and start docker
sudo systemctl enable --now docker.service

Install Node.js

OpenClaw includes Node.js tooling for parts of the stack. Install a current LTS Node.js release from NodeSource.

# install Node.js LTS (example: 20.x)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# verify
node -v
npm -v

Deploy OpenClaw with Docker Compose

Clone the OpenClaw repository, provide environment variables, and start the containers with Docker Compose.

# clone the repo (replace repo URL with the official OpenClaw repo)
git clone https://github.com/openclaw/openclaw.git /opt/openclaw
cd /opt/openclaw

# copy the example env and edit as needed
cp .env.example .env
# edit .env with your preferred editor to set DB credentials, domain, etc.

# start services with Docker Compose v2
sudo docker compose up -d

# follow logs
sudo docker compose logs -f

Configuration tips

  • If you run behind a reverse proxy, set the proxy vars in your .env and ensure the proxy forwards X-Forwarded headers.
  • Use persistent volumes for database and uploaded files; confirm mounts in your docker-compose file.
  • See best hosting options for guidance when selecting a provider or region.

Resource tiers and RAM/CPU guidance

Match your VPS tier to expected load. Typical guidance:

  • Small (testing / single developer): minimal CPU and RAM suitable for local testing or CI previews.
  • Medium (light production): moderate CPU and RAM for small teams or low-traffic deployments.
  • Large (production / multiple users): more CPU cores and memory for concurrency, background jobs, and database load.

Update

To update OpenClaw and its containers, pull the latest repo changes, fetch newer images, and recreate containers.

# update code
cd /opt/openclaw
git pull --rebase

# pull latest container images and restart
sudo docker compose pull
sudo docker compose up -d

# check migrations or release notes in the repo before running any DB migrations

Security

Secure your Hetzner VPS and OpenClaw deployment:

  • Use SSH keys and disable password authentication in /etc/ssh/sshd_config.
  • Restrict access with UFW: allow SSH, HTTP, HTTPS only as needed.
  • Run containers without exposing the Docker socket to untrusted processes.
  • Consider fail2ban, automatic security updates, and regular backups of volumes and the database.

Troubleshooting

  • If services fail to start: check container status with
    sudo docker ps -a
  • View logs for errors:
    sudo docker compose logs -f
  • Check systemd and Docker service status:
    sudo systemctl status docker
    journalctl -u docker.service --no-pager -n 200
  • Permission errors: ensure your user is in the docker group or prefix commands with sudo.
  • Database connection problems: confirm env vars and that DB container is healthy.

Screenshots checklist

  • Hetzner VPS control panel showing the server (region, OS, plan)
  • Terminal: successful apt update and docker service enabled
  • Terminal: docker compose up -d showing containers started
  • Browser: OpenClaw UI after first login or health endpoint
  • Backup and security settings confirmation (UFW rules, SSH key list)

Recommendation

If you want to run OpenClaw on a self-managed Hetzner VPS, follow this guide step-by-step and keep backups and security checks in place. For beginners who prefer a managed or simpler entry option, Hostinger.com is a neutral alternative to consider. When you’re ready, Get a Hetzner VPS and use the steps above to deploy OpenClaw; also consult server requirements, secure VPS, and best hosting options for more context.

Clara
Written by Clara

Clara is an OpenClaw specialist who explores everything from autonomous agents to advanced orchestration setups. She experiments with self-hosted deployments, API integrations, and AI workflow design, documenting real-world implementations and performance benchmarks. As part of the AutomationCompare team, Clara focuses exclusively on mastering OpenClaw and helping developers and founders deploy reliable AI-driven systems.

Keep Reading

Scroll to Top