How to Install OpenClaw on a VPS

A comprehensive guide for setting up your personal AI assistant on any Virtual Private Server.

By TONNIC AI Agency

© TONNIC AI Agency

Prerequisites

Before you begin the installation process, make sure you have everything ready. Having these prerequisites in place will ensure a smooth setup experience.

VPS Provider

  • Hostinger, DigitalOcean, Hetzner, or any Linux VPS
  • Ubuntu 24.04 LTS (recommended)
  • Minimum 2GB RAM, 4GB+ recommended

On Your Computer

  • Terminal/SSH client
  • VPS IP address
  • API keys / Subscriptions (ie Claude, ChatGPT, etc.)

© TONNIC AI Agency

Step 1: Connect to Your Server

The first step is establishing a secure connection to your VPS. You'll use SSH (Secure Shell) to access your server remotely.

SSH into your VPS:

ssh root@YOUR_SERVER_IP

Create a dedicated user:

sudo adduser openclaw
sudo usermod -aG sudo openclaw
sudo su - openclaw

© TONNIC AI Agency

Step 2: Install Node.js 22

OpenClaw requires Node.js version 22 or newer to run properly. This step ensures you have the correct runtime environment installed on your server.

01

Download and run the Node.js setup script

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
02

Install Node.js package

sudo apt-get install -y nodejs
03

Verify the installation

node -v

Should show v22.x.x or higher.

© TONNIC AI Agency

Step 3: Install OpenClaw

Now it's time to install OpenClaw itself. The official installer automates most of the setup process, making it quick and easy to get started.

Run the official installer:

curl -fsSL https://openclaw.ai/install.sh | bash

Launch the setup wizard:

openclaw onboard --install-daemon

The wizard will guide you through the configuration process and set up everything automatically, including the system service and initial settings.

© TONNIC AI Agency

Step 4: Choose Your AI Provider

OpenClaw supports multiple AI providers, giving you flexibility in how you access AI capabilities. Choose the option that best fits your needs and budget.

Option A: Claude Subscription

Prerequisites: Install Claude Code CLI first

curl -fsSL https://claude.ai/install.sh | bash

Then follow setup at code.claude.com/docs/en/setup

Then generate setup-token:

claude setup-token
openclaw models auth paste-token --provider anthropic

Option B: Anthropic API Key

For direct API access:

openclaw models auth login --provider anthropic

Option C: OpenAI Codex

ChatGPT/Codex subscription via OAuth:

openclaw onboard --auth-choice openai-codex

Or run OAuth directly:

openclaw models auth login --provider openai-codex

Option D: OpenAI API Key

For usage-based billing:

openclaw onboard --auth-choice openai-api-key

© TONNIC AI Agency

Step 5: Access the Dashboard

Once OpenClaw is installed and configured, you'll want to access the web dashboard to manage your assistant. This requires creating a secure SSH tunnel from your local computer to the server.

Create an SSH tunnel from your computer:

ssh -N -L 18789:127.0.0.1:18789 openclaw@YOUR_SERVER_IP

Then open in your browser:

http://127.0.0.1:18789/

© TONNIC AI Agency

Step 6: Run as a Service

To ensure OpenClaw runs continuously and starts automatically after server reboots, it needs to be configured as a system service. The onboard wizard sets this up automatically, but it's useful to know how to manage it.

Check Service Status

sudo systemctl status openclaw-gateway.service

Start the Service

sudo systemctl start openclaw-gateway

Stop the Service

sudo systemctl stop openclaw-gateway

Restart the Service

sudo systemctl restart openclaw-gateway

View Live Logs

sudo journalctl -u openclaw-gateway -f

© TONNIC AI Agency

Troubleshooting

If you encounter any issues during or after installation, OpenClaw provides several diagnostic commands to help identify and resolve problems.

Diagnostic Commands:

openclaw status
openclaw doctor
openclaw logs --follow

Common Issues:

Port in use → Another process is running on port 18789

Command not found → Add npm bin directory to PATH

Auth errors → Check your API key or token

Service won't start → Verify binary path in service file

© TONNIC AI Agency

What You Get

After completing the installation, you'll have a powerful, self-hosted AI assistant at your fingertips. Here's what OpenClaw brings to your workflow:

24/7 AI Assistant

  • Responds via WhatsApp, Telegram, Discord
  • Runs continuously in the cloud
  • Never sleeps, always available

Complete Privacy

  • No third-party hosting
  • Full control over everything

Powerful Automation

  • Email management, calendar scheduling
  • Code generation, file organization
  • Custom skills and integrations

© TONNIC AI Agency

Next Steps

Congratulations on installing OpenClaw! Now it's time to customize and enhance your AI assistant to fit your specific needs.

Configure Channels

Set up WhatsApp, Telegram, and other messaging platforms

Browse Skills

Explore available capabilities at clawhub.com

Customize

Edit AGENTS.md and SOUL.md files

Set Up Backups

Protect your configuration and data


Resources:

Documentation
docs.openclaw.ai

GitHub Repository
github.com/openclaw/openclaw

Community Discord
discord.gg/openclaw

© TONNIC AI Agency

Choosing the Right AI Tool for Your Needs

Understanding the unique strengths of agentic AI like OpenClaw versus traditional workflow automation tools is crucial for maximizing efficiency and innovation.

OpenClaw (Agentic AI Assistant)

  • Multi-turn conversational interactions with memory and context across sessions
  • Autonomous task planning and execution without predefined workflows
  • Self-directed problem solving where the agent decides what tools to use and when
  • Operating as a persistent assistant that proactively suggests actions
  • Handling completely novel requests that weren't anticipated in advance

Workflow Automation (n8n, Zapier, Make)

  • Predictable, repeatable workflows with fixed logic
  • Deterministic outcomes with exact results every time
  • High-volume data processing
  • Lower latency for simple operations
  • Scheduled tasks on exact triggers
  • Visual workflow builders
  • Cost-effective for high-frequency automations

General AI Chats (ChatGPT, Claude, Gemini)

  • One-off conversations and quick questions
  • Content generation and creative writing
  • Research and information synthesis
  • Code snippets and debugging help
  • No persistent memory or automation
  • Manual copy-paste workflows

IDE AI Coders (Claude Code, Cursor, Google Antigravity)

  • Deep integration with your development environment
  • Multi-file code editing and refactoring
  • Understanding entire codebases
  • Real-time code suggestions and completions
  • Terminal command execution
  • Limited to development workflows only

© TONNIC AI Agency