Set Up OpenClaw on a Linux Server

Author
Lukas von Kunhardt
Published
February 9, 2026
Tags
Essentials

I was watching a Y Combinator interview with Pete Steinberger, the creator of OpenClaw, and there was this moment that sold me on the whole thing.

Pete had just set up WhatsApp as a channel for OpenClaw. He sent a voice memo through WhatsApp to test it. Right after hitting send he realized: wait, I never told it how to handle voice memos. It's just going to get an empty message.

A minute later, he gets a response. Full, coherent, on-topic. He asks OpenClaw how it managed that. It says: "I received a message and it was empty. I figured it was probably a voice memo, so I extracted the audio using FFmpeg, transcribed it, and answered."

Nobody told it to do that. It just figured it out.

If you've been using Claude Code, you already know how much more capable AI becomes when you give it access to a command line. OpenClaw is that, but always on, running on your server, and reachable from your phone through WhatsApp. You don't need to SSH into anything. You don't need a stable internet connection. You just text it. Or send voice memos from the train with terrible reception.

That async, always-available thing is what makes this different from having the Claude app on your phone (which, honestly, I found too slow and limited compared to working in a real terminal).

This guide gets you from zero to a working OpenClaw setup: a server running the gateway, WhatsApp connected, your Mac and phone linked as nodes.

What You Need

Before you start, you need four things:

  1. A Linux server that's always on. I use a Hetzner VPS that costs about 6 euros a month. Any Ubuntu 24.04 server works. If you followed the self-hosting guide for n8n, you can use the same server.
  2. A Claude Max subscription. This is the expensive part. I pay 200 euros a month. You need it because OpenClaw uses Claude as its brain, and the Max tier gives you the usage limits that make always-on operation viable. You can also use OpenAI or API keys instead if you prefer.
  3. Tailscale installed on all your devices. Tailscale creates an encrypted mesh network between your machines. It's free for personal use. Your server, your Mac, and your phone all join the same network, so they can talk to each other without exposing anything to the public internet.
  4. A phone number for WhatsApp. Your personal number works fine. OpenClaw links to WhatsApp like any other "Linked Device."

How I Did This

I ran through this setup with Claude Code open in a separate terminal, SSHed into the same server. The onboarding wizard and WhatsApp QR scan are interactive, so you do those yourself. But whenever something broke (wrong permissions, missing PATH, systemd not finding the D-Bus session), I'd paste the error into Claude Code and it would fix it remotely. The whole thing was a back-and-forth between me clicking through the wizard and Claude Code handling the sysadmin work.

I'd recommend the same approach. Do the interactive steps yourself, let Claude Code handle the debugging.

The Setup (10 Steps)

This is the full checklist. Total time is about 30 to 45 minutes, most of which is waiting for things to install.

1. Create a dedicated user on your server

Don't run OpenClaw as root. Don't mix it with your other projects. Give it its own user.

sudo adduser --disabled-password --gecos "OpenClaw AI" openclaw
sudo usermod -aG docker openclaw
sudo loginctl enable-linger openclaw

The enable-linger part keeps the user's services running even when nobody is logged in. Without it, OpenClaw stops when you disconnect.

2. Install OpenClaw

Switch to the new user and set up a local npm prefix (so you don't need root for installs):

sudo -u openclaw -i
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
npm install -g openclaw@latest

Verify: openclaw --version

Your server needs Node.js 22 or later. Check with node --version.

OpenClaw install docs

3. Run the onboarding wizard

openclaw onboard --install-daemon

This is interactive. It will:

  • Ask you to accept the security warning (read it, it's honest about the risks)
  • Let you pick QuickStart mode (do that)
  • Ask for your Claude authentication (paste your setup-token from claude setup-token)
  • Offer to link a messaging channel (pick WhatsApp)
  • Install the gateway as a systemd service

When it asks about gateway binding, pick loopback. When it asks about the port, keep the default 18789.

Onboarding docs

The wizard handles this if you chose WhatsApp during onboarding. It shows a QR code in the terminal. Open WhatsApp on your phone, go to Settings, then Linked Devices, and scan it.

If you're using your personal number and want to message yourself to talk to the bot, the wizard sets up selfChatMode automatically when you tell it this is your personal phone.

By default, only your number can message OpenClaw. If you want other people to be able to message it too, change the DM policy to pairing in the config:

{
  "channels": {
    "whatsapp": {
      "dmPolicy": "pairing"
    }
  }
}

With pairing mode, anyone who messages gets a code. You approve or reject them from the server:

openclaw pairing list
openclaw pairing approve whatsapp <code>

WhatsApp channel docs

5. Verify the gateway is running

openclaw gateway status
openclaw health

You should see it bound to 127.0.0.1:18789 and reporting healthy.

6. Expose the gateway via Tailscale

Your gateway is only listening on localhost. To reach it from other devices, use Tailscale Serve:

sudo tailscale serve --bg 18789

This makes the gateway available at https://your-server-name.tailnet-name.ts.net to any device on your Tailscale network. No public ports, no firewall rules, automatic HTTPS.

Add to ~/.openclaw/openclaw.json:

{
  "gateway": {
    "tailscale": { "mode": "serve" },
    "auth": { "allowTailscale": true }
  }
}

If you don't have Tailscale yet, install it on the server first:

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --ssh

Then install the Tailscale app on your Mac (from tailscale.com) and on your iPhone (from the App Store).

Remote access docs

7. Connect your Mac as a node

On your Mac:

npm install -g openclaw@latest
openclaw node run --host your-server-name --port 18789 --display-name "My Mac"

Back on the server, approve the pairing:

openclaw nodes pending
openclaw nodes approve <requestId>

To keep it running permanently, install it as a service instead:

openclaw node install --host your-server-name --port 18789 --display-name "My Mac"

Your Mac now exposes its canvas, camera, screen capture, and shell to OpenClaw. The gateway runs on the server, but it can execute commands on your Mac through the node connection.

Nodes docs

8. Connect your iPhone

Install Tailscale on your iPhone from the App Store and sign in to join your network.

For now, WhatsApp is your interface. You can text or send voice memos to OpenClaw from your phone, and it works even on terrible connections.

When the OpenClaw iOS companion app becomes publicly available (it's in internal preview as of February 2026), you'll be able to install it and pair your phone as a full node with camera, location, and canvas capabilities.

iOS docs

9. Set your default model

Check ~/.openclaw/openclaw.json and make sure your model is set:

{
  "agent": {
    "model": "anthropic/claude-opus-4-6"
  }
}

Opus 4.6 is the recommended model. The docs specifically mention it for "long-context strength and better prompt-injection resistance," which matters when you're giving an AI access to your command line.

10. Run a security audit

openclaw security audit --deep

This is a real tool that ships with OpenClaw and it surfaces misconfigurations. Run it. Fix what it flags.

The project is honest about the risks: this is beta software that can read files and execute commands. Use pairing and allowlists. Keep secrets out of the agent's reachable filesystem. Sandbox tool execution for non-primary sessions.

Security docs

What This Costs

ItemMonthly Cost
Hetzner VPS (CX22 or similar)~6 euros
Claude Max subscription~200 euros
TailscaleFree (personal)
Total~206 euros

The Claude Max subscription is the big number. If you're already paying for it (like I am), the marginal cost of running OpenClaw is just the 6 euro server.

You can also use API keys instead of a Max subscription if you prefer pay-per-use pricing. Or use OpenAI's models instead of Claude.

What's Next

This gets you a working setup. You have an always-on AI assistant on your server, reachable from WhatsApp on your phone and connected to your Mac.

The next step is connecting your Mac and other servers as nodes, so OpenClaw can reach beyond this one machine. After that, we'll cover adding skills, setting up automation with heartbeats and cron jobs, and building workflows where OpenClaw handles tasks you'd otherwise forget about.

Quick Reference