Deploy Openclaw on VPS: Production-Ready Setup Guide

Running Openclaw on a Virtual Private Server (VPS) gives you a dedicated, always-on AI gateway that you control completely. This guide walks you through the fastest, most secure way to deploy Openclaw to any Linux VPS using the official automated installer.
For developers who prefer cloud platforms, you might also want to check our guides on Flyio Deployment or Hetzner Setup for specific provider configurations.
Quick Start: Automated Installation
The Openclaw-ansible installer handles everything: firewall setup, Tailscale VPN, Docker, and a hardened systemd service. This is the recommended path for production deployments.
Step 1: Run the One-Command Installer
SSH into your fresh VPS and execute:
curl -fsSL https://raw.githubusercontent.com/Openclaw/Openclaw-ansible/main/install.sh | bash
This script will:
- Configure UFW firewall with secure defaults
- Set up Tailscale for private VPN access
- Install Docker CE for agent sandboxes
- Create a hardened systemd service
- Set up a dedicated openclaw user
Step 2: Switch to the Openclaw User
Once installation completes, switch to the newly created user:
sudo -i -u openclaw
Step 3: Authenticate Your Channels
Run the channel login command to connect your messaging platforms:
openclaw channels login
Follow the prompts to authenticate Telegram, Discord, WhatsApp, or any other channels you want to use.
Manual Configuration (Optional)
If you prefer manual setup or need custom configurations, you can install Openclaw directly:
curl -fsSL https://openclaw.ai/install.sh | bash
Then configure your model provider and channels manually in ~/.openclaw/openclaw.json.
Best Practices & Troubleshooting
Enable Service Lingering: By default, Linux systemd user services stop when you log out. To keep Openclaw running 24/7:
sudo loginctl enable-linger $USER
Firewall Rules: The automated installer opens only necessary ports. If configuring manually, ensure port 18789 (default Gateway port) is accessible.
Memory Requirements: A VPS with 2GB RAM is sufficient for most use cases. For heavy agent workloads with multiple channels, consider 4GB.
Pairing Devices: After setup, approve new device connections using:
openclaw devices list
openclaw devices approve <request-id>
Your Openclaw Gateway is now running on your VPS, ready to route messages between your AI models and chat platforms.