How to install OpenClaw on a VPS
Objective
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 and ensure your assistant stays online 24/7.
Unlike a local installation via SSH tunnel, this method provides:
- Secure public access via HTTPS (Let's Encrypt)
- A scalable architecture behind Traefik (reverse proxy)
- The ability to add future services behind the same proxy (Nextcloud, n8n, Stoat, etc.)
The target architecture:
This guide explains how to deploy OpenClaw in production with Docker, Traefik and OVHcloud AI Endpoints on a VPS.
Requirements
- An OVHcloud VPS (Debian 11/12 or Ubuntu 22.04+). Refer to our guide "Getting started with a VPS".
- SSH access to your VPS
- A domain name pointing to your VPS. Refer to our guide "Adding a DNS A record" if needed.
- An OVHcloud AI Endpoints API key. Refer to our guide "AI Endpoints - Getting started" to generate one.
Table of Contents
- Step 1 - Installing Docker
- Step 2 - Creating the proxy network
- Step 3 - Installing Traefik
- Step 4 - Installing OpenClaw
- Step 5 - Configuring for Traefik
- Step 6 - Configuring OVHcloud AI Endpoints
- Step 7 - Final startup
- Step 8 - Device pairing
Instructions
Step 1 - Installing Docker
Check that Docker is installed on your machine:
If you get output similar to:
This means Docker is already installed on your machine. Otherwise, follow the Docker installation guide.
Configuring Docker permissions (important)
By default, Docker commands require sudo. However, the docker-setup.sh script must be run without sudo to avoid permission issues on generated files (.env, .openclaw, volumes, etc.).
Add your user to the docker group:
Then reload your session:
You can verify that Docker works without sudo:
If no permission error appears, continue with the installation.
Step 2 - Creating the proxy network
Traefik and OpenClaw must share a common Docker network:
Step 3 - Installing Traefik
Creating the directory
Configuring the docker-compose.yml file
Copy the following configuration into the docker-compose.yml file:
Remember to update the file by replacing YOUR_EMAIL with your email address.
Initialising Let's Encrypt storage
Create the directory and certificate storage file with the appropriate permissions:
Starting Traefik
Start the Traefik container in the background:
Step 4 - Installing OpenClaw
Prepare the directories:
Run the setup wizard:
At the end of the installation, make a note of the token provided to you, as you will need it to connect to OpenClaw.
You can retrieve this value at any time from the .env file in your OpenClaw directory:
Step 5 - Configuring for Traefik
Replace the contents of the generated docker-compose.yml with:
Remember to update the file by replacing YOUR_DOMAIN_NAME with your domain name.
Step 6 - Configuring OVHcloud AI Endpoints
Before modifying the configuration file, create a backup then open it in a text editor:
Copy the following configuration into the openclaw.json file. This configuration defines the connection settings, the gateway and the OVHcloud AI Endpoints provider:
Remember to update the file by replacing the following values:
YOUR_DOMAIN_NAMEwith your domain name.YOUR_OPENCLAW_TOKENwith the token OpenClaw provided at the end of the installation.YOUR_OVH_ENDPOINT_API_KEYwith your API key.
Step 7 - Final startup
Once the configuration is complete, restart the OpenClaw containers to apply the changes:
Check that the gateway is active by viewing the container logs:
If the startup was successful, you should see the following message (in cyan blue):
Step 8 - Device pairing
Access the OpenClaw web interface from your browser by opening the URL of your domain:
In the Overview section, enter your Gateway Token to authenticate.
When connecting for the first time from a new device, the interface displays the following message:
To authorise the device, list the pending devices then approve the desired one by replacing <ID> with the displayed identifier:
Go further
Official OpenClaw documentation
Join our community of users.