How to install an OpenClaw agent on a VPS
OpenClaw (successor to Moltbot and Clawdbot) is the new evolved version of the autonomous AI assistant. This guide uses Docker to protect your host system while ensuring your assistant remains online 24/7.
Requirements
- An active OVHcloud VPS (Debian 11/12 or Ubuntu 22.04+); refer to our guide "Getting started with a VPS"
- SSH access to your VPS
- An API key (Anthropic or OpenAI)
Instructions
Table of contents:
- Step 1 - Install Docker
- Step 2 - Prepare directories
- Step 3 - Deployment configuration (Docker Compose)
- Step 4 - Launch the agent
- Step 5 - Secure access via an SSH tunnel
Step 1 - Install Docker
On your VPS, install Docker and its Compose plugin:
Note: Log out and log back in via SSH for the Docker group addition to take effect.
Step 2 - Prepare directories
Docker needs folders on your VPS to store data permanently (WhatsApp sessions, memory).
Step 3 - Deployment configuration
Create a file named docker-compose.yml in this folder:
Copy the following configuration into it:
Security: By using 127.0.0.1:18789:18789, the port is exposed only within the VPS. No one can access it from the outside without the SSH tunnel.
Step 4 - Launch
Start your agent:
Step 5 - Secure access via an SSH tunnel
-
On your personal computer, create the tunnel.
The method remains the same. From your personal computer, open a terminal:
- Windows: PowerShell or Command Prompt (cmd).
- Linux / macOS: Terminal.
Keep this terminal window open for the entire duration of your use.
-
On your VPS (another terminal window), retrieve your access token:
Open your browser and go to:
http://127.0.0.1:18789.
Tip: If the interface remains disconnected, you can force the connection by using your token directly in the URL: http://127.0.0.1:18789/?token=YOUR_GATEWAY_TOKEN
The rest takes place in the Overview menu: enter your Gateway Token to log in.
Go further
Official OpenClaw documentation
Browse all the Virtual Private Servers guides.
Browse the rest of the OVHcloud US documentation for guides on our other products and services.
Learn more about VPS on the OVHcloud US website.