How to install an OpenClaw agent

This guide explains how to install and run an OpenClaw agent on a Virtual Private Server (VPS). Running OpenClaw on a VPS allows your AI assistant to operate 24/7 and execute automated tasks remotely.

What is OpenClaw?

OpenClaw is an open-source AI agent that runs locally on a server and can interact with files, APIs, terminals, and external services. It can automate workflows and execute commands based on natural language instructions.

Because the agent can execute system commands, it is recommended to run it inside a container to isolate it from the rest of your server environment.

Requirements

  • A VPS running Linux (Ubuntu 22.04 or newer recommended)
  • Root or sudo access
  • Docker and Docker Compose installed
  • Minimum recommended resources:
    • 2 CPU cores
    • 4 GB RAM
    • 40 GB disk space
  • An SSH client

Step 1: Connect to your VPS

Use SSH to connect to your server.

ssh root@YOUR_SERVER_IP

Step 2: Install Docker

If Docker is not installed, install it using the following commands:

apt update
apt install docker.io docker-compose -y
systemctl enable docker
systemctl start docker

Step 3: Create a working directory

mkdir openclaw
cd openclaw

Step 4: Create the Docker Compose configuration

Create a docker-compose.yml file:

nano docker-compose.yml

Example configuration:

version: '3'

services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    restart: always
    ports:
      - "3000:3000"
    volumes:
      - ./data:/app/data

Step 5: Start the OpenClaw agent

Run the following command:

docker compose up -d

This command downloads the OpenClaw container and starts the agent.

Step 6: Access the OpenClaw dashboard

Once the container is running, open your browser and go to:

http://YOUR_SERVER_IP:3000

You can now configure your AI agent and connect external services.

Security recommendations

  • Run OpenClaw inside Docker for isolation.
  • Restrict access with a firewall.
  • Use SSH keys instead of passwords.
  • Avoid exposing the dashboard publicly without authentication.

Conclusion

You have successfully installed an OpenClaw agent on your VPS. Your AI assistant can now run continuously and automate tasks directly from your server.

Was this article helpful?

Share this article