Tutorials

How to Install OpenClaw on a VPS, Step by Step

A complete walkthrough for installing OpenClaw on DigitalOcean, Hostinger, or any VPS. From zero to a working AI assistant in under an hour.

Dewaldt HuysamenMarch 3, 2026Updated March 10, 202610 min read
Share

This walkthrough takes you from a blank VPS to a fully working OpenClaw AI assistant. No prior experience required. By the end you will have a private assistant connected to your first messaging channel, secured with basic hardening, and ready for daily use.

What You Need Before Starting

  • A VPS with at least 2 vCPU, 4 GB RAM, and 40 GB SSD storage
  • Ubuntu 22.04 or 24.04 LTS (Debian 12 also works)
  • An SSH client (Terminal on Mac/Linux, PuTTY or Windows Terminal on Windows)
  • An AI API key from Anthropic, OpenAI, Google, or another supported provider
  • A messaging channel token (Telegram bot token, WhatsApp Cloud API key, Discord bot token, etc.)
If you plan to run a local model like Llama 4 via Ollama, you need at least 8 GB RAM (16 GB recommended). For cloud-only API models, 4 GB is plenty since the heavy computation happens on the provider's servers.

Choosing a VPS Provider

Any Linux VPS works. Two popular options for OpenClaw users are:

  • Hostinger VPS — Plans start at $5.99/month with 2 vCPU and 8 GB RAM. Best value for the specs. Data centres in the US, EU, Asia, and South America.
  • DigitalOcean Droplets — The $12/month droplet (2 vCPU, 2 GB RAM) works for light usage. The $24/month droplet (2 vCPU, 4 GB RAM) handles moderate traffic comfortably. Strong API and CLI tooling.

Both providers offer hourly billing, so you can test for a few days and destroy the server if you change your mind.

Step 1 — Provision and Access Your VPS

Create your VPS through the provider's dashboard. Select Ubuntu 24.04 LTS, pick the region closest to you, and add your SSH key during setup. Once the server is ready, connect:

ssh root@YOUR_SERVER_IP

If this is your first connection, your terminal will ask you to confirm the server fingerprint. Type yes and press Enter.

Step 2 — Update the System

Before installing anything, bring the system packages up to date:

apt update && apt upgrade -y

This takes one to three minutes depending on how many packages need updating.

Step 3 — Run the One-Line Installer (Method 1)

The OpenClaw team maintains an official install script that handles all dependencies, downloads the latest release, and runs the interactive setup wizard:

curl -fsSL https://get.openclaw.dev | bash

The script installs Node.js 20 LTS, Docker (if not present), pulls the OpenClaw container image, and launches the setup wizard. The wizard asks four questions:

  1. Which AI provider do you want to use? (Select and paste your API key)
  2. Which model should be the default? (e.g., Sonnet 4.6, GPT-5 mini)
  3. Which messaging channel do you want to connect first?
  4. What name should the assistant use?

After the wizard completes, OpenClaw starts automatically and listens on port 3100. You can send a test message through your connected channel right away.

Step 3 (Alternative) — Docker Compose (Method 2)

If you prefer more control over the setup, use Docker Compose directly. First, install Docker if you have not already:

curl -fsSL https://get.docker.com | sh

Then create a project directory and download the compose file:

mkdir -p /opt/openclaw && cd /opt/openclaw
curl -fsSL https://raw.githubusercontent.com/openclaw/openclaw/main/docker-compose.yml -o docker-compose.yml

Create an environment file with your configuration:

cat > .env << 'EOF'
OPENCLAW_AI_PROVIDER=anthropic
OPENCLAW_AI_KEY=sk-ant-your-key-here
OPENCLAW_DEFAULT_MODEL=sonnet-4.6
OPENCLAW_TELEGRAM_TOKEN=your-telegram-bot-token
OPENCLAW_ASSISTANT_NAME=MyAssistant
OPENCLAW_PORT=3100
EOF

Start the stack:

docker compose up -d

Check the logs to confirm everything started cleanly:

docker compose logs -f --tail 50

Step 4 — Post-Install Configuration

Connect Additional Channels

Open the web UI at http://YOUR_SERVER_IP:3100 and navigate to Settings > Channels. You can add WhatsApp, Discord, Slack, and other channels alongside your initial one. Each channel gets its own configuration card with paste-in-token setup.

Configure Memory

By default, OpenClaw uses SQLite for memory storage. For production use with multiple users, switch to PostgreSQL. The Docker Compose file includes an optional PostgreSQL service you can enable by uncommenting the relevant section.

Install Skills

Browse the skill registry in the web UI under Settings > Skills. Popular first installs include web search, weather, and the code interpreter. Each skill installs with one click.

Only install skills from verified publishers. Of the 191+ community skills available, 341 submissions to the unofficial registry were flagged as malicious or insecure. Stick to the verified tab.

Step 5 — Basic Security Hardening

Do not skip this step. Of the 42,665 OpenClaw instances found on the public internet, 93.4% had zero authentication. That means anyone can read your conversations, change your AI settings, or inject prompts.

The minimum security steps you should take right now:

  1. Enable authentication — In the web UI, go to Settings > Security > Enable Password. Set a strong password.
  2. Set up a firewall — Allow only ports 22 (SSH) and 443 (HTTPS). Block direct access to port 3100 from the internet.
  3. Add a reverse proxy with HTTPS — Use Caddy or Nginx with a free Let's Encrypt certificate.
  4. Change the default SSH port — Reduces automated brute-force attempts by 90%+.
# Quick UFW firewall setup
ufw allow 22/tcp
ufw allow 443/tcp
ufw deny 3100/tcp
ufw enable

For the complete 12-point security audit, read our security checklist or the full security guide.

Common Installation Errors and Fixes

Error: port 3100 already in use

Another service is occupying the port. Find it with lsof -i :3100 and either stop that service or change OpenClaw's port in the .env file.

Error: Docker daemon not running

Start Docker manually:

systemctl start docker && systemctl enable docker

Error: insufficient memory

If your VPS has only 1 GB RAM, the installer may fail during the build step. Either upgrade to a 4 GB plan or add a 2 GB swap file:

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab

Error: AI API key rejected

Double-check that you pasted the full key with no trailing spaces. For Anthropic keys, make sure it starts with sk-ant-. For OpenAI, it starts with sk-.

What Comes Next

Once OpenClaw is running and secured, explore these next steps:

  • Set up a custom AI persona with tone, name, and conversation rules
  • Enable Supermemory for persistent 6-layer recall (85.9% accuracy vs 58.3% for classic mode)
  • Connect additional messaging channels for a unified inbox
  • Install productivity skills (calendar, email, web search)

If managing servers is not your thing, consider OpenClawPro's managed plans where we handle installation, security, updates, and monitoring so you can focus on using the assistant instead of maintaining it.

Read our detailed installation guide for the expanded version of this tutorial with screenshots and video walkthroughs.

Need help setting up OpenClaw?

Skip the hours of configuration and security hardening. Get a professionally installed, secured, and optimized OpenClaw instance.

View Plans

Related Articles