Published March 22, 2026 · 16 min read · by Seth, Founder of RunYourOwnAI

← All Articles

How to Install OpenClaw: The Complete Guide (2026)

This is the no-BS guide to getting OpenClaw running on your own server. We'll cover every step from choosing hardware to sending your first message. Estimated time: 1–2 hours if everything goes smoothly, 4–6 hours if you hit snags.

Or, if you'd rather skip all 8 steps and have it done professionally in 48 hours: we do that too, starting at $449.

Before You Start: Choose Your Hardware

🖥️ VPS (Recommended)

$5–6/mo

DigitalOcean, Hetzner, or Hostinger. Always on, accessible from anywhere. Best for most people.

Min specs: 2 CPU, 4GB RAM, 100GB disk

🍎 Mac Mini / Old Laptop

$0/mo

Any Mac or Linux machine. Needs to stay on 24/7. Good if you have spare hardware lying around.

Min specs: Basically anything made after 2018

🍓 Raspberry Pi 5

$80 one-time

Low power, silent, always on. Great for home use. Needs the 8GB model for comfortable performance.

Note: Pi setup has extra steps (ARM, Node.js quirks)

For this guide, we'll use a VPS — it's the most common setup and the easiest to follow remotely.

Step 1

Provision Your VPS

Sign up at DigitalOcean, Hetzner, or your preferred provider. Create a new server (called a "droplet" on DO) with these settings:

Once provisioned, you'll get an IP address. Save it — that's your server.

# Connect to your new server ssh root@YOUR_SERVER_IP
Step 2

Create a Non-Root User

Never run OpenClaw as root. Create a dedicated user:

# Create user and add to sudo group adduser openclaw usermod -aG sudo openclaw # Copy your SSH key to the new user mkdir -p /home/openclaw/.ssh cp ~/.ssh/authorized_keys /home/openclaw/.ssh/ chown -R openclaw:openclaw /home/openclaw/.ssh chmod 700 /home/openclaw/.ssh chmod 600 /home/openclaw/.ssh/authorized_keys # Switch to the new user su - openclaw
Step 3

Install Node.js v22

OpenClaw requires Node.js version 22 or higher. This is the #1 thing that trips people up — many systems ship with older versions.

# Install nvm (Node Version Manager) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash # Reload your shell source ~/.bashrc # Install Node.js 22 nvm install 22 nvm use 22 nvm alias default 22 # Verify node --version # Should output: v22.x.x
Common mistake: If you use apt install nodejs, you'll get an old version (v18 or v20). Always use nvm to install v22+. If node --version shows anything below v22, OpenClaw won't work.
Step 4

Install OpenClaw

# Install OpenClaw globally npm install -g openclaw # Verify installation openclaw --version # Run the diagnostic to check everything openclaw doctor

openclaw doctor checks your Node version, permissions, and system requirements. Fix anything it flags before continuing.

Step 5

Run the Setup Wizard

# Start the interactive setup openclaw setup

The wizard walks you through:

💡 Getting API keys:
Anthropic: console.anthropic.com → API Keys → Create Key
OpenAI: platform.openai.com → API Keys → Create Key
Google: aistudio.google.com → Get API Key

All three offer pay-as-you-go pricing. Google has a free tier. Budget $10–20/month for typical use.
Step 6

Connect a Messaging Channel

This is where OpenClaw becomes useful — connecting it to Telegram, Discord, WhatsApp, or other apps so you can message your AI from your phone.

Telegram (Easiest)

# 1. Open Telegram, message @BotFather # 2. Send /newbot, follow prompts, get your token # 3. Add to OpenClaw config: openclaw config set channels.telegram.token "YOUR_BOT_TOKEN" openclaw config set channels.telegram.allowFrom "YOUR_TELEGRAM_USER_ID" # 4. Restart OpenClaw openclaw gateway restart

Discord

# 1. Go to discord.com/developers/applications # 2. Create New Application → Bot → Reset Token # 3. Enable MESSAGE CONTENT intent # 4. Add to config: openclaw config set channels.discord.token "YOUR_BOT_TOKEN" openclaw config set channels.discord.allowFrom "YOUR_DISCORD_USER_ID" # 5. Invite bot to your server with the OAuth2 URL # 6. Restart openclaw gateway restart
Important: Always set allowFrom to YOUR user ID only. Without this, anyone who finds your bot can talk to your AI and access your data.
Step 7

Harden Security

This is the step most tutorials skip — and the reason 21,000+ OpenClaw instances were exposed in 2026. Don't skip this.

# Disable password authentication for SSH sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config sudo systemctl restart sshd # Set up UFW firewall sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow ssh sudo ufw enable # Install fail2ban sudo apt install -y fail2ban sudo systemctl enable fail2ban # Enable automatic security updates sudo apt install -y unattended-upgrades sudo dpkg-reconfigure -plow unattended-upgrades # Verify gateway is bound to localhost grep -i "bind" ~/.openclaw/config.yaml # Should show 127.0.0.1, NOT 0.0.0.0

For remote access to your OpenClaw instance (from outside your network), install Tailscale instead of opening firewall ports:

# Install Tailscale (free for personal use) curl -fsSL https://tailscale.com/install.sh | sh sudo tailscale up

Tailscale creates a private mesh VPN between your devices. Your OpenClaw stays on localhost — accessible only through Tailscale, invisible to the public internet.

Step 8

Customize and Launch

OpenClaw is running. Now make it yours:

# Set up auto-start with PM2 npm install -g pm2 pm2 start "openclaw gateway start" --name openclaw pm2 save pm2 startup # Follow the instructions PM2 gives you # Edit your AI's personality nano ~/.openclaw/workspace/SOUL.md # Install skills from ClawHub npx clawhub install weather npx clawhub install web-search

Send a message to your bot on Telegram or Discord. If it responds — congratulations, you have your own AI assistant. 🎉

That Was a Lot of Steps.

If you made it through — genuinely, nice work. If you got stuck somewhere around Step 3 and thought "why am I doing this on a Saturday" — that's completely valid.

We do this every day. Professional setup, security hardening included, done in 48 hours.

Skip All This — $449 Setup →

Troubleshooting

"openclaw: command not found" after installation

Your PATH doesn't include the npm global bin directory. Run source ~/.bashrc or start a new terminal session. If using nvm, make sure you ran nvm use 22.

Node.js version mismatch (need v22, have v18 or v20)

If you installed via apt, uninstall it: sudo apt remove nodejs. Then install via nvm as shown in Step 3. Run node --version to verify you have v22+.

Gateway won't start / port already in use

Something else is using port 3000. Check with ss -tlnp | grep 3000. Kill the process or change OpenClaw's port: openclaw config set gateway.port 3001

"Unsafe fallback OpenClaw temp dir" after update

Known issue with version 2026.3.x. Fix: mkdir -p /tmp/openclaw-$(whoami) && chmod 700 /tmp/openclaw-$(whoami). Then restart: openclaw gateway restart

Telegram bot doesn't respond

Check three things: (1) Your bot token is correct, (2) allowFrom matches your Telegram user ID (not username), (3) the gateway is running (openclaw gateway status). Increase the timeout if you get "Failed to resolve application" errors.

Discord bot shows offline / doesn't respond

Make sure you enabled the MESSAGE CONTENT intent in the Discord developer portal. Also verify the bot has been invited to your server with the correct permissions (Send Messages, Read Message History).

"Permission denied" errors during install

Don't use sudo with npm when using nvm. nvm installs to your home directory — no sudo needed. If you see permission errors, you likely have a conflicting system Node.js installation.

What's Next?

Once your AI is running, the real power comes from customization:

Want help with any of this? Check our pricing or compare setup services.

Professional setup includes all of the above — configured, secured, and tested.

Get Setup →

Related Articles

Is OpenClaw Safe in 2026? Security deep-dive after the ClawHavoc breach incidents OpenClaw Setup Cost Breakdown Real cost numbers — hosting, API usage, and setup fees explained