Skip to content

How to self-host OpenClaw

Two ways to run OpenClaw on your own hardware: npm install and harden it yourself, or flash an appliance image with it baked in. What each actually costs you.

~15 minutes

OpenClaw is the most popular self-hosted AI agent — it runs on your machine, connects to WhatsApp, Telegram, Discord and others, and can act on its own. There are two ways to run it, and most guides only cover the first.

Option 1: install it directly

The standard path:

npm install -g openclaw@latest
openclaw gateway status

You need Node.js and an LLM provider key — Anthropic’s Claude is the usual choice. For a laptop you are experimenting on, this is the right answer and you can stop here.

What the direct install leaves to you

The moment it becomes something you rely on, the list grows:

  • Keeping it running. A process that dies when you close the terminal is not an assistant. That means a systemd unit, restart policy and log rotation.
  • Reaching it remotely. Port forwarding, a VPN, or a tunnel.
  • Securing it. OpenClaw can run shell commands and touch files — that is the point of it. Confining it needs AppArmor or SELinux, a firewall policy, and ideally a dedicated user with a restricted home.
  • Backups. Conversation history and memory live on disk. Encrypted, off-device, with a restore you have actually tested.
  • Updates. npm update -g with no rollback if the new version misbehaves.
  • Secrets. Your provider key sits in a file. Mode, ownership and exposure are yours to get right.

None is hard alone. Together they are a standing commitment, and this is where most self-hosted agents quietly rot.

Option 2: run it as an appliance

deputyOS ships OpenClaw as a baked profile. The runtime, native modules and dependencies are in the image before first boot — nothing runs npm install on your device.

  1. Pick your hardware in the picker and select the openclaw profile.
  2. Flash the image and boot.
  3. Complete the wizard at http://deputyos.local — provider key, channels, done.

What comes with it: AppArmor enforcing, ufw default-deny, fail2ban, hardened sysctls, A/B slot updates with automatic rollback, client-side age-encrypted backup, and a reverse tunnel so you can reach it without touching your router.

The honest trade

The appliance gives you our decisions rather than yours. You cannot apt install a missing tool into the running system — the root filesystem is read-only and changes go through a rebuild. If you want to modify OpenClaw itself or run it alongside other things on the same box, the direct install is more flexible.

Which to choose

Direct install if: you are evaluating, you already run infrastructure you are happy with, or you want to modify OpenClaw.

Appliance if: you want it always-on and reachable, you would rather not hand-roll the security baseline, or you are running it on more than one machine.

See also deputyOS vs Open WebUI, which covers the same layering question from the interface side.

openclawself-hostedguide

← All guides

Search

Search index isn't built yet. Run npm run build to generate it (Pagefind writes to dist/pagefind/).