Openclaw Hetzner VPS Setup Guide
Deploy Openclaw on Hetzner Cloud for reliable European hosting. Complete guide covering server setup, configuration, security, and optimization.
Hetzner Cloud offers excellent price-performance for hosting Openclaw in Europe. This comprehensive guide covers everything you need for a successful openclaw hetzner deployment.
Why Choose Hetzner for Openclaw?
Hetzner is a popular choice for openclaw vps hosting due to:
- Competitive Pricing: Starting at €3.79/month for capable servers
- European Data Centers: GDPR-compliant hosting in Germany and Finland
- Excellent Performance: NVMe SSDs and fast network connectivity
- Green Energy: 100% renewable energy powered data centers
- Reliable Infrastructure: 99.9% uptime SLA
Hetzner Server Requirements for Openclaw
For a reliable openclaw hetzner setup, we recommend:
| Plan | vCPU | RAM | Storage | Price | Use Case |
|---|---|---|---|---|---|
| CX22 | 2 | 4GB | 40GB | €3.79/mo | Personal/Testing |
| CX32 | 4 | 8GB | 80GB | €7.59/mo | Production |
| CX42 | 8 | 16GB | 160GB | €15.19/mo | High Traffic |
Sign up for Hetzner Cloud to start your openclaw deployment. New accounts receive free credits to test their infrastructure.
Step 1: Create Your Hetzner Server
1.1 Sign Up and Create Project
- Create a Hetzner Cloud account
- Navigate to the Cloud Console
- Create a new project for your openclaw installation
1.2 Launch a New Server
- Click "Add Server"
- Select location (Falkenstein, Nuremberg, or Helsinki)
- Choose Ubuntu 22.04 LTS as the image
- Select CX32 or higher for production use
- Add your SSH key for secure access
- Click "Create & Buy Now"
1.3 Note Your Server IP
After creation, note your server's public IP address. You'll need this for SSH access.
Step 2: Initial Server Configuration
Connect to your new Hetzner server:
ssh root@YOUR_SERVER_IP
2.1 Update System Packages
apt update && apt upgrade -y
2.2 Create a Non-Root User
adduser openclaw
usermod -aG sudo openclaw
2.3 Configure SSH Security
Edit SSH configuration:
nano /etc/ssh/sshd_config
Update these settings:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
Copy your SSH key to the new user:
mkdir -p /home/openclaw/.ssh
cp ~/.ssh/authorized_keys /home/openclaw/.ssh/
chown -R openclaw:openclaw /home/openclaw/.ssh
chmod 700 /home/openclaw/.ssh
chmod 600 /home/openclaw/.ssh/authorized_keys
Restart SSH:
systemctl restart sshd
Step 3: Install Openclaw Dependencies
Switch to the openclaw user:
su - openclaw
3.1 Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Verify installation:
node --version
npm --version
3.2 Install Additional Tools
sudo apt install -y git build-essential
Step 4: Openclaw Installation on Hetzner
4.1 Clone the Repository
mkdir -p ~/apps
cd ~/apps
git clone https://github.com/openclaw/openclaw.git
cd openclaw
4.2 Install Dependencies
npm install
4.3 Configure Environment
cp .env.example .env
nano .env
Configure your openclaw hetzner installation:
ANTHROPIC_API_KEY=your_api_key_here
NODE_ENV=production
PORT=3000
HOST=0.0.0.0
4.4 Build the Application
npm run build
Step 5: Configure Systemd Service
Create a systemd service for automatic startup:
sudo nano /etc/systemd/system/openclaw.service
Add the following configuration:
[Unit]
Description=Openclaw AI Agent
After=network.target
[Service]
Type=simple
User=openclaw
WorkingDirectory=/home/openclaw/apps/openclaw
ExecStart=/usr/bin/node dist/index.js
Restart=on-failure
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=openclaw
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw
Check status:
sudo systemctl status openclaw
Step 6: Configure Firewall
Set up UFW firewall for your openclaw vps:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Step 7: Set Up Nginx Reverse Proxy
Install Nginx:
sudo apt install -y nginx
Create Nginx configuration:
sudo nano /etc/nginx/sites-available/openclaw
Add:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/openclaw /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Step 8: Install SSL Certificate
Use Let's Encrypt for free SSL:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
Monitoring Your Openclaw Hetzner Deployment
View Logs
sudo journalctl -u openclaw -f
Check Resource Usage
htop
Monitor Disk Space
df -h
Troubleshooting Openclaw Hetzner Issues
Issue: Service Won't Start
Check logs for errors:
sudo journalctl -u openclaw --no-pager -n 50
Issue: High Memory Usage
Consider upgrading to CX42 or implementing memory limits:
NODE_OPTIONS="--max-old-space-size=3072" npm start
Issue: Connection Timeouts
Verify firewall rules and Nginx configuration.
Next Steps
Your openclaw hetzner deployment is now complete. Consider:
- Setting up automated backups
- Configuring monitoring alerts
- Reading our VPS Deployment Overview
Need help with your openclaw hetzner setup? Our $100 deployment service includes complete configuration and security hardening.