· 5 min read

How to Install OpenClaw on a VPS in 10 Minutes (2026)

Install Node.js 22+, clone OpenClaw, run npx openclaw init, configure your first channel — done. Complete step-by-step guide.

TL;DR: Install Node.js 22+, clone OpenClaw, run npx openclaw init, configure your first channel, and you're done. Total time: under 10 minutes for a basic setup with Telegram.

If you are weighing OpenClaw against the alternatives, our comparison database keeps a live scorecard of how the leading AI Agent tools stack up.

Prerequisites

Before you start, you need:

  • A VPS running Ubuntu 22.04 or Debian 12 (minimum 1 vCPU, 2GB RAM)
  • SSH access to your VPS
  • A Telegram bot token from @BotFather

Step 1: Connect to Your VPS

class="language-bash">ssh root@your-vps-ip

Step 2: Install Node.js

OpenClaw requires Node.js 22 or later. Install it from NodeSource [source]:

class="language-bash">curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
node -v

Verify the version — you should see v22.x.x or higher.

Step 3: Create a User

Running services as root is bad practice. Create a dedicated user:

class="language-bash">adduser openclaw
usermod -aG sudo openclaw
su - openclaw

Step 4: Install OpenClaw

class="language-bash">npx openclaw init
cd openclaw
npm install

This downloads the latest OpenClaw release and installs dependencies. It takes about 2 minutes on a standard VPS.

Step 5: Configure Your First Channel (Telegram)

Open the config file:

class="language-bash">nano openclaw.yaml

Find the channels section and add your Telegram bot token:

class="language-yaml">channels:
 telegram:
 enabled: true
 botToken: "YOUR_BOT_TOKEN"

Get your bot token from @BotFather on Telegram. Create a new bot, copy the token, paste it in.

Step 6: Configure Your LLM Provider

Add your preferred LLM provider in the providers section:

class="language-yaml">providers:
 openai:
 apiKey: "YOUR_OPENAI_KEY"
 model: gpt-4o-mini

OpenClaw supports OpenAI, Anthropic, Google, Mistral, OpenRouter, Ollama (local), and 15+ other providers.

Step 7: Start OpenClaw

class="language-bash">npx openclaw start

You should see output like:

[2026-05-04 12:00:00] INFO: Starting OpenClaw v2026.4.24
[2026-05-04 12:00:01] INFO: Telegram channel connected
[2026-05-04 12:00:01] INFO: Agent is ready

OpenTelegram, message your bot, and you're talking to your own AI agent.

Running OpenClaw as a Service

To keep your agent running after you close the SSH session, set it up as a systemd service. Create a service file at /etc/systemd/system/openclaw.service with the openclaw user and the working directory set to your OpenClaw installation. Then run systemctl enable openclaw && systemctl start openclaw. The agent will start automatically on boot and restart if it crashes.

For production deployments, consider adding a reverse proxy like Nginx if you plan to expose the web interface, and set up automatic SSL certificates with Certbot. You can also configure log rotation to prevent the agent logs from filling your disk over time — OpenClaw can generate significant log output during active conversations with multiple channels connected simultaneously.

Memory configuration is the next important step after basic setup. Out of the box, OpenClaw uses in-memory storage which resets on restart. For persistent memory, configure LanceDB or SQLite backends — these let your agent remember past conversations, user preferences, and task history across sessions. This turns your agent from a stateless chatbot into a system that accumulates context and improves over time.

Troubleshooting Common Issues

Most installation problems fall into a handful of predictable categories. If the Telegram channel fails to connect, the first thing to check is your bot token — tokens are only valid for the exact bot they were issued to, and a common mistake is pasting a token with a trailing space or newline. Recreate the token from @BotFather, paste it carefully, and restart OpenClaw.

If npx openclaw init hangs or times out, the usual cause is a network issue reaching the npm registry. Run npm config get registry to confirm you are pointed at the default registry, and if you are behind a corporate proxy, set HTTPS_PROXY before running the install command. On very small VPS instances with 1GB of RAM, npm install can be killed by the out-of-memory killer — add a swap file (fallocate -l 2G /swapfile, then mkswap and swapon) to give the build process headroom.

Finally, check the logs. OpenClaw writes structured logs to ~/.openclaw/logs/ by default — if the agent starts but never responds to messages, the logs will show whether the LLM provider call is failing (invalid API key, exhausted quota) or whether the channel webhook is unreachable. Nine times out of ten, the fix is a corrected API key or a restarted service.

Security Best Practices

Your agent holds API keys and has access to your messaging accounts, so a few hardening steps are worth the five minutes they take. First, never run OpenClaw as root — the dedicated user created in Step 3 should own the installation directory, and the systemd service should run under that same account so a compromised agent process cannot take over the whole machine.

Second, keep your API keys out of the config file whenever possible. OpenClaw supports environment variables for provider credentials, which keeps secrets out of version control and out of shell history. If you must store keys in openclaw.yaml, restrict the file permissions (chmod 600 openclaw.yaml) so only the service user can read it.

Third, lock down your VPS at the network level. Disable password SSH authentication and use key-based login only, keep the firewall configured to expose just ports 22 and 80/443 (plus your Telegram webhook port if you use one), and enable automatic security updates with unattended-upgrades. These steps are cheap insurance — the agent is only as secure as the server it runs on.

What's Next?

  • Connect additional channels (Discord, Signal, WhatsApp)
  • Configure memory backends (LanceDB, SQLite, wiki)
  • Add search plugins (Brave, Tavily, Perplexity)
  • Write custom skills for your specific use cases

See the OpenClaw Plugin Directory → for a full list of everything you can enable.

That's it. You now have a self-hosted AI agent running on your own infrastructure. Total time from start to first message: under 10 minutes.

Dig deeper: OpenClaw review · IronClaw review.

  • NiteAgent — AI agent development, frameworks, and production patterns
  • ToolBrain — tool reviews, LLM comparisons, and AI workflow guides

Cross-links automatically generated from None.

Back to all posts