AI agents & automation
How to install OpenClaw on a VPS safely
Install the open-source OpenClaw AI assistant on your own server, connect a chat app and apply the official security settings: pairing, allowlists, sandboxing and safe skills.

On this page
OpenClaw is one of the most popular open-source personal AI assistants. You run it on your own server and talk to it from WhatsApp, Telegram, Discord, Slack and many other apps. It's MIT-licensed and maintained by the independent OpenClaw Foundation.
That reach is also why it needs care: an agent that can read your messages and run tools on your server should be locked down from day one.
Before you start
- A Linux VPS. OpenClaw doesn't publish a RAM minimum; a small plan works for one personal assistant.
- Node.js 24 or 26. The installer can set it up for you. The docs recommend recent Node releases for security fixes.
- An API key from an AI model provider.
- A non-root user to run the assistant, not your root account.
Step 1: Install OpenClaw
The official installer detects your system, installs Node.js if needed, installs OpenClaw and starts the setup wizard:
curl -fsSL https://openclaw.ai/install.sh | bash
If you prefer npm:
npm install -g openclaw@latest --allow-scripts=openclaw
openclaw onboard --install-daemon
On npm 11.15 or older, leave out --allow-scripts=openclaw.
Step 2: Check it's running
openclaw --version
openclaw doctor
openclaw gateway status
The gateway listens on port 18789, and on a regular install it binds only to the local machine (127.0.0.1). Keep it that way.
Step 3: Connect a chat app
The docs call Telegram the fastest channel to set up, since it only needs a bot token from @BotFather. WhatsApp, Discord, Slack and others are supported too.
By default, when someone you don't know messages the assistant, they get a pairing code instead of access. You approve people one by one:
openclaw pairing approve telegram <code>
Step 4: Lock it down
These are the protections that matter most, taken from the official security guidance:
- Don't expose the gateway. Leave it on
127.0.0.1. To open the dashboard remotely, use an SSH tunnel or Tailscale, not an open port:
ssh -L 18789:127.0.0.1:18789 user@your-server
Then open http://127.0.0.1:18789/ in your own browser.
- Use allowlists for who can talk to the assistant, and require a mention in group chats.
- Sandbox tools. The docs note that tools run directly on the host unless you configure sandboxing. Turn on the Docker sandbox before you give the assistant access to anything important.
- Treat incoming messages as untrusted. Anyone who can message the assistant can try to trick it. Give it only the tools it really needs.
- Run the built-in audit:
openclaw security audit
Step 5: Be careful with skills
Skills and plugins come from ClawHub, a public registry where anyone can upload. Automated scans run on releases, but the official advice is clear: treat third-party skills as untrusted code and read them before enabling them. You can check a skill before installing it:
openclaw skills verify @owner/skill-name
openclaw skills install @owner/skill-name
Prefer skills from well-known authors, install as few as possible, and keep them updated with openclaw skills update --all.
What to read next
For a general security checklist that applies to any self-hosted agent, see securing a self-hosted AI agent. If you're still choosing a tool, our OpenClaw vs Hermes vs n8n comparison helps.
Frequently asked questions
Is OpenClaw safe to use?
The core project has sensible defaults: the gateway listens only on the local machine and unknown senders must be approved. Most risk comes from what you add: third-party skills, exposed ports and broad tool access. Follow the steps in this guide before connecting real accounts.
Does OpenClaw cost anything?
No. OpenClaw is MIT-licensed open-source software run by an independent foundation, with no paid tier. You pay for your server and the AI model you use.
Sources & references
Related reading
AI agents & automation
How to secure a self-hosted AI agent: a practical checklist
A checklist for running n8n, OpenClaw, Hermes Agent or any AI agent on your own server safely: server basics, closed ports, limited permissions, sandboxing and prompt injection.
3 min read
AI agents & automation
OpenClaw vs Hermes Agent vs n8n: which should you self-host?
Two personal AI agents and one automation platform, compared: what each is built for, how you talk to it, how it's licensed and how much care it needs to run safely.
2 min read
AI agents & automation
How much does it cost to run an AI agent 24/7?
The real costs of running an AI agent: the server, the AI model's API usage and the hidden extras. A simple formula to estimate your monthly bill before you start.
2 min read