How to Install OpenClaw in 2026: Complete Setup Guide for Every Method
Step-by-step OpenClaw installation guide covering the official installer, Railway, DigitalOcean, Docker VPS and local Mac setup. Commands checked against OpenClaw docs in October 2026, security hardening and troubleshooting included.
Explore with AI

Table of Contents
OpenClaw has crossed 391,000 GitHub stars (391,603 on October 10, 2026, per the GitHub API; it was 247,000 when I first wrote this guide in March) and the install question comes up every day. Most guides pick one method and leave you guessing about the others. This guide covers all four: Railway for the fastest possible start, DigitalOcean for a managed VPS, a full Docker plus Nginx plus SSL setup on any Linux server (the approach I use in production deployments), and a free local Mac setup with Ollama for offline use. Every command is explained, and this October 2026 revision is checked against the project's current docs and repository rather than run again on a fresh server.
Updated October 11, 2026. OpenClaw is an open source project by Peter Steinberger (openclaw/openclaw on GitHub). I deploy and configure it for clients; I did not create it. The newest release is v2026.10.1 (GitHub and npm, October 10, 2026; the Docker latest tag points at the same image). I did not install OpenClaw on a clean machine for this update, so anything I could only confirm from the docs, the repository files and the release notes is marked "not run". Four things changed since March: Node 22 is no longer supported (you need Node 24.16 or later, or 26.1 or later), the project now has its own installer script, the Docker setup is built around ./scripts/docker/setup.sh, and the backup commands were renamed.
Security note. Do not copy an old pinned install. The floor I give in my OpenClaw security post is 2026.3.11, and more advisories followed it. OpenClaw's own security page (reviewed September 9, 2026; advisory counts as of September 11, 2026) counts 722 published fixes since January and 14 confirmed critical vulnerabilities, all fixed. A host install binds the gateway to loopback and refuses connections without credentials, but the project's Docker Compose setup defaults to a LAN bind and publishes the port on every host interface, which is why the Docker section below publishes the port on 127.0.0.1 only.
If you are still deciding whether OpenClaw is the right tool for your situation, read What Is OpenClaw first. That post covers what the software actually does and who it is built for. This guide assumes you have already made that decision and just want to get it running.
Pick the section that matches your situation. If you are comparing methods and have not decided yet, start with the table below. It lays out the real tradeoffs so you can choose in 60 seconds.
Comparing the four installation methods
Before touching a terminal or clicking any button, here is an honest side-by-side of what each approach costs, requires, and is best suited for.
| Method | Monthly Cost | Skill Required | Setup Time | Best For |
|---|---|---|---|---|
| Railway (one click) | $5 minimum usage | Beginner | 5 minutes | Fastest start, no server management |
| DigitalOcean 1-Click | $6 to $24 | Beginner | 10 minutes | Managed Ubuntu droplet, simple billing |
| Docker VPS (Nginx + SSL) | $4 to $8 (not rechecked) | Intermediate | 45 minutes | Production, full control, lowest cost |
| Local Mac with Ollama | $0 | Beginner | 20 minutes | Testing, privacy, no API costs |
I rechecked the cost column on October 11, 2026 where a price page allowed it. Railway's Hobby plan is $5 minimum usage with $5 of included credits. DigitalOcean's Basic regular droplets are $6 for 1 GiB, $12 for 2 GiB with 1 vCPU, $18 for 2 GiB with 2 vCPUs and $24 for 4 GiB with 2 vCPUs. I could not read Hetzner's current monthly price from its page, so the VPS range is my earlier estimate and is not rechecked. Setup times are my own estimates.
The Docker VPS path is what I use for client deployments (including enterprise AI agent rollouts you can see on the case studies page). It gives you the most control, the best performance per dollar, and the cleanest security posture once configured properly. Railway wins on speed and simplicity if you just want to get something running today.
What you need before you start
Every installation method requires one thing: an API key from an AI provider. OpenClaw is the agent platform: it needs a language model to actually think and respond. You have several options:
- Anthropic Claude: Get a key at platform.claude.com (the Anthropic Console, formerly console.anthropic.com). Claude is the best choice for production deployments. Use
anthropic/claude-haiku-5-5for cost efficient agents oranthropic/claude-sonnet-5-5for more capable ones (checked October 11, 2026 against Anthropic's model list; the Haiku 4.5 and Sonnet 4.5 IDs this guide used in March are older, and Anthropic's deprecations page says Sonnet 4.5 retires on the Claude API on November 30, 2026). Onboarding can also reuse an existing Claude Code or Codex CLI login instead of a key. - OpenAI: Get a key at platform.openai.com. Pick a current model from OpenAI's lineup if you already have OpenAI credits. OpenClaw can also sign in with a ChatGPT or Codex subscription instead of an API key.
- Ollama (local models): Free, runs entirely on your machine. Required for Method 4. Quality depends on your hardware.
For VPS methods you also need a domain name if you want HTTPS. A $10 to $15 per year domain from Namecheap or Cloudflare Registrar is enough. If you skip this step, the gateway runs over plain HTTP on an IP address, which is fine for testing but not for anything real.
The official installer script and the Node requirement
The project's README and install guide now lead with a one line installer. It detects your operating system, installs Node.js when it is missing (Node 26 through Homebrew on macOS, the Node 24 LTS line on Linux), installs OpenClaw, and starts onboarding. Run OpenClaw itself as a regular user; the project's DigitalOcean guide uses root only to bootstrap a server. I did not run the installer for this update (not run); the commands below are copied from the README and the installer guide.
# macOS, Linux, or WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
# Install without starting onboarding
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
# Install from the GitHub main checkout instead of npm
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git --version main
# Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
If you already manage Node yourself, install the npm package. The package declares Node >=24.16.0 <25 || >=26.1.0, and Node 26 is the recommended runtime. Node 22, 23 and 25 are unsupported. Node 22 was the floor when I wrote this guide in March; v2026.9.3 raised it and listed the change as breaking.
node --version
npm install -g openclaw@latest --allow-scripts=openclaw
openclaw onboard --install-daemon
The --allow-scripts=openclaw flag is for npm 12 or npm 11.16 and later. On npm 11.15 and earlier, leave it off. Both are in the project's install guide.
| Platform | How to install | Runtime | Notes |
|---|---|---|---|
| macOS | Installer script, npm, or the menu bar app | Node 24.16+ or 26.1+ | Official Node 24 builds need macOS 13.5 or later. The OpenClaw.app companion needs macOS 26.2. |
| Linux | Installer script or npm | Node 24.16+ or 26.1+ | The installer provisions Node 24 LTS when Node is missing. Linux ARMv7 is no longer provisioned. |
| Windows | PowerShell installer, the Windows Hub app, or a WSL2 gateway | Node 24.16+ or 26.1+ | Native Windows is supported now, which my March FAQ answer said it was not. |
| Docker | Prebuilt image from GHCR or Docker Hub | Bundled in the image | Method 3 below. The image runs as the node user, uid 1000. |
On a fresh install, onboarding offers Quick start, which reuses a detected Claude Code or Codex login or an API key and opens the dashboard, or Custom setup for every option. openclaw onboard --classic opens the older step by step wizard. Quick start leaves the gateway running in your terminal, so stop it with Ctrl+C and install the background service:
openclaw gateway install
openclaw gateway status
openclaw dashboard
openclaw --version
openclaw doctor
openclaw gateway install creates a LaunchAgent on macOS, a systemd user unit on Linux and WSL2, or a Scheduled Task on native Windows. openclaw gateway status should show the gateway listening on port 18789. If you already have OpenClaw, openclaw update upgrades it; an install older than July 2026 should go to 2026.9.5 first, run openclaw doctor --fix, then move to the latest release (the updating guide's bridge release). If setup fails, openclaw triage runs read only checks and writes a diagnosis. The installer variant that keeps Node and OpenClaw under a local prefix, ~/.openclaw by default, is install-cli.sh, and it needs no root.
Method 1: Railway one-click deploy
Railway is a platform-as-a-service that handles the server, networking, and TLS for you. OpenClaw's own docs link a one click Railway template that gets you a running instance in about five minutes with no command line required. Railway's pricing page (checked October 11, 2026) lists the Hobby plan at $5 minimum usage and a Free plan capped at 0.5 GB RAM per service, which is below the 1 GB droplet OpenClaw's own DigitalOcean guide starts from, so I would not run it on the Free plan.
Step 1: Deploy the template
Go to Railway and search for the OpenClaw template, or click the deploy button in the official OpenClaw Railway guide. Railway will prompt you to log in or create a free account first.
Once logged in, Railway shows you the template configuration screen. Do not click deploy yet.
Step 2: Add persistent storage
Before deploying, add a volume. Without this your agent configuration and conversation history disappear every time the container restarts. In the Railway template editor, click "Add Volume" and mount it at /data. This is the most commonly skipped step and the most common cause of lost configuration.
Step 3: Set the required environment variables
Railway needs four variables set before it will work correctly. Set these in the Variables tab before first deploy (they match the project's Railway guide as of October 11, 2026):
OPENCLAW_GATEWAY_PORT=8080
OPENCLAW_GATEWAY_TOKEN=your-long-random-secret-here
OPENCLAW_STATE_DIR=/data/.openclaw
OPENCLAW_WORKSPACE_DIR=/data/workspace
Generate the gateway token with a password manager or run openssl rand -hex 32 locally. This token is the only thing protecting your OpenClaw dashboard from the public internet: treat it as an admin password.
Step 4: Enable public networking
In Railway's Networking section, enable HTTP Proxy on port 8080. This exposes your deployment at an auto-generated Railway domain like https://something.up.railway.app. You can also attach a custom domain here if you have one.
Step 5: Deploy and access the dashboard
Click Deploy. Railway builds and launches the container, usually in about 90 seconds. Once it shows "Active", navigate to https://your-railway-domain.up.railway.app/openclaw and paste your gateway token into the Settings screen.
Add your AI provider key in the Control UI, or run openclaw onboard in Railway's shell, which the Railway guide describes for channel setup. openclaw doctor --json in the same shell is the project's read only preflight check. Then you are ready to add channels.
Method 2: DigitalOcean 1-Click Marketplace
DigitalOcean offers a preconfigured OpenClaw Droplet in their Marketplace. DigitalOcean's catalog page (checked October 11, 2026) says it runs on Ubuntu 24.04 with Node.js 24 and Docker, and lists gateway tokens, firewall rate limiting, a non root service user, container sandboxing and private DM pairing. Good option if you prefer a traditional VPS with a simple monthly bill rather than Railway's usage based pricing.
Two cautions. That catalog page lists OpenClaw 2026.9.3 as the bundled version, which is behind the current release, so run openclaw --version after first login. And OpenClaw's own DigitalOcean guide says to use a clean Ubuntu 24.04 base image and to avoid Marketplace one click images unless you have reviewed their startup scripts and firewall defaults. I did not deploy the Marketplace image for this update (not run). The alternative that follows the project's guide is at the end of this section.
Step 1: Create the Droplet
In the DigitalOcean control panel, go to Marketplace and search for OpenClaw. Choose the Droplet size: DigitalOcean's catalog page recommends 4GB RAM and 2 CPUs for personal use, which is the $24 per month Basic regular size. OpenClaw's own guide runs the $6 per month option (1 vCPU, 1GB RAM) with a 2GB swap file and hosted models, which is enough to start. The $12 per month size is 1 vCPU with 2GB RAM, and 2 vCPUs with 2GB RAM is $18 per month, so my March note that $12 buys 2 vCPUs was wrong. Pick one if you are running multiple channels or expect steady message volume. Choose the datacenter region closest to your users and add your SSH key before creating.
Step 2: SSH in and complete the setup wizard
Once the Droplet is provisioned (usually takes 90 seconds), SSH in as root using the IP shown in your DigitalOcean dashboard:
ssh root@your-droplet-ip
DigitalOcean's catalog page describes an automated setup flow on first login: choose an LLM provider (DigitalOcean Serverless Inference, OpenRouter, OpenAI or Anthropic), paste the API key, and the service restarts. The same page says to edit /opt/openclaw.env and run systemctl restart openclaw to change settings later, and to run /opt/openclaw-tui.sh to confirm the service and model respond. My March version of this step named a config file at /root/.openclaw/openclaw.json; I could not confirm that path on the current image, so use the paths above.
Step 3: Access the dashboard
Copy the dashboard URL from the welcome message at login, open it in a browser, and complete the dashboard pairing it describes until the dashboard shows "connected". Then confirm you can chat with the agent. I no longer give a fixed http://your-droplet-ip:18789 address here because I could not confirm that the current image exposes it.
For anything beyond testing, do not leave a login page on the open internet. OpenClaw's DigitalOcean guide offers two access routes: an SSH tunnel (ssh -L 18789:localhost:18789 root@YOUR_DROPLET_IP, then open http://localhost:18789) or Tailscale Serve. If you still want Nginx and SSL in front, the steps and the caveats in Method 3 apply here too.
Alternative: a clean Ubuntu droplet, the way OpenClaw's guide does it.
These are the project's DigitalOcean guide steps for a plain Ubuntu 24.04 Droplet (not run on my side). The guide installs as root only to bootstrap, then runs OpenClaw as a regular user so state lives under that user's home and the gateway runs as that user's systemd service:
ssh root@YOUR_DROPLET_IP
apt update && apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
apt install -y nodejs
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
adduser openclaw
usermod -aG sudo openclaw
loginctl enable-linger openclaw
su - openclaw
openclaw onboard --install-daemon
On a 1GB Droplet, add the 2GB swap file from the guide (fallocate, mkswap, swapon and an /etc/fstab line) before you rely on it, and check the service with systemctl --user status openclaw-gateway.service.
Method 3: Full VPS with Docker, Nginx, and SSL
This is the approach I use for anyone running OpenClaw beyond personal testing. You get full control over the server, the cheapest possible hosting cost (this guide named the Hetzner CX22 at around €4.35 per month in March; Hetzner's cost optimized page now lists the CX23, 2 vCPUs, 4 GB RAM and 40 GB NVMe, and I could not read its current monthly price), and a setup that follows proper security practices from the start.
Four things in the October 2026 docs changed this section. First, the project's own Docker route is git clone https://github.com/openclaw/openclaw.git, then export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest" and ./scripts/docker/setup.sh from the repository root, which runs onboarding, writes the gateway token to .env and starts Docker Compose; it needs at least 6 GB RAM only if you build the image from source. Second, that route publishes the gateway port on every host interface by default and sets the bind to lan, so a public server needs the firewall and port handling below. Third, the hand written Compose file below skips the setup script, so the one time onboarding step in Step 6 is mandatory. Fourth, OpenClaw's exposure runbook lists a loopback gateway reached over an SSH tunnel or Tailscale Serve as the recommended pattern for personal use, and calls a direct public internet setup rare and high risk. The Nginx path below is for when you accept that and put the controls in place. I did not run this stack for this update (not run).
The whole process takes about 45 minutes the first time. I will explain what each command does, not just paste blocks and hope for the best.
What you need
- A fresh Ubuntu 24.04 VPS with at least 2GB RAM (4GB recommended)
- Root SSH access to that server
- A domain name with its DNS pointed at the server's IP address
- An AI provider API key
Step 1: Initial server setup
Log into your fresh server as root. The first thing to do is create a non-root user: running OpenClaw as root is a security risk because any compromise of the agent gives an attacker root access to your entire server.
adduser openclaw
usermod -aG sudo openclaw
su - openclaw
Now configure the firewall. UFW (Uncomplicated Firewall) is available by default on Ubuntu. These rules allow only SSH, HTTP, and HTTPS traffic: everything else is blocked.
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw limit 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
The ufw limit 22/tcp rule enables rate limiting on SSH, which blocks basic brute-force attempts automatically.
One catch: ports that Docker publishes go through Docker's own forwarding chains, so UFW's deny incoming default does not block them. OpenClaw's network exposure guide and Docker's firewall notes both say to enforce rules in the DOCKER-USER chain. That is why the Compose file below publishes the port as 127.0.0.1:18789:18789 and not as a bare 18789:18789.
Next, install fail2ban. This watches your SSH logs and bans IPs that fail authentication too many times:
sudo apt update && sudo apt install -y fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
Step 2: Install Docker Engine
Do not use the Docker version from Ubuntu's default package repository: it is often outdated. Install from Docker's official repository instead.
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
This is the repository setup on Docker's current Ubuntu install page (checked October 11, 2026), which also lists Ubuntu 26.04 and 24.04 LTS as supported. The older docker.list and docker.gpg form this guide used in March still works, but follow Docker's page if the two ever differ.
Add your non-root user to the docker group so you can run Docker commands without sudo:
sudo usermod -aG docker openclaw
newgrp docker
Step 3: Create the docker-compose.yml
Create a project directory and the Compose file. Notice the ports section: this is critical. The host side is published on 127.0.0.1:18789, not 0.0.0.0:18789, so the gateway is only reachable from the server itself and Nginx proxies public traffic to it. The command line matters too. The image's default command starts the gateway on loopback inside the container, and the Dockerfile notes that with Docker bridge networking a loopback bind makes the gateway unreachable from the host, so the file below starts it with --bind lan (the same flag the project's own Compose file uses). Gateway authentication is required in that mode, which the token in .env provides. My March version of this file left out the command line, so it would not have worked as written.
mkdir -p ~/openclaw-docker/config ~/openclaw-docker/workspace && cd ~/openclaw-docker
sudo chown -R 1000:1000 config workspace
The image runs as the node user, uid 1000, so the two mounted folders must be owned by uid 1000 or you will see permission errors on /home/node/.openclaw (OpenClaw's Compose guide gives the same chown fix).
Create the docker-compose.yml file with the following content:
services:
openclaw-gateway:
image: ghcr.io/openclaw/openclaw:latest
restart: unless-stopped
init: true
env_file:
- .env
environment:
HOME: /home/node
OPENCLAW_HOME: /home/node
OPENCLAW_STATE_DIR: /home/node/.openclaw
OPENCLAW_CONFIG_PATH: /home/node/.openclaw/openclaw.json
OPENCLAW_WORKSPACE_DIR: /home/node/.openclaw/workspace
OPENCLAW_GATEWAY_PORT: "18789"
command: ["node", "dist/index.js", "gateway", "--bind", "lan", "--port", "18789"]
ports:
- "127.0.0.1:18789:18789"
volumes:
- ./config:/home/node/.openclaw
- ./workspace:/home/node/.openclaw/workspace
cap_drop:
- NET_RAW
- NET_ADMIN
security_opt:
- no-new-privileges:true
openclaw-cli:
image: ghcr.io/openclaw/openclaw:latest
network_mode: "service:openclaw-gateway"
init: true
stdin_open: true
tty: true
env_file:
- .env
environment:
HOME: /home/node
OPENCLAW_HOME: /home/node
OPENCLAW_STATE_DIR: /home/node/.openclaw
OPENCLAW_CONFIG_PATH: /home/node/.openclaw/openclaw.json
OPENCLAW_WORKSPACE_DIR: /home/node/.openclaw/workspace
OPENCLAW_GATEWAY_PORT: "18789"
entrypoint: ["node", "dist/index.js"]
volumes:
- ./config:/home/node/.openclaw
- ./workspace:/home/node/.openclaw/workspace
cap_drop:
- NET_RAW
- NET_ADMIN
security_opt:
- no-new-privileges:true
depends_on:
- openclaw-gateway
This is a trimmed copy of the service definitions in OpenClaw's own docker-compose.yml, with the host port pinned to loopback. The official file also mounts a small auth profile secret directory and passes more environment variables; use the official file if you are migrating old OAuth credentials. The second service, openclaw-cli, is what the docker compose run --rm openclaw-cli ... commands later in this guide use. For a pinned deployment, replace latest with a release tag such as 2026.10.1 (both tags exist on GHCR as of October 11, 2026).
If the ports section shows 0.0.0.0:18789, or a bare 18789:18789, which Docker also binds on every interface, your dashboard login page is reachable from the internet. The gateway still demands the token, but you do not want it exposed. Fix it before proceeding.
Now create the .env file with your credentials:
OPENCLAW_GATEWAY_TOKEN=$(openssl rand -hex 32)
echo "OPENCLAW_GATEWAY_TOKEN=$OPENCLAW_GATEWAY_TOKEN" >> .env
echo "ANTHROPIC_API_KEY=your-anthropic-api-key-here" >> .env
Set strict permissions on the env file so other users on the server cannot read your API keys:
chmod 600 .env
chmod 700 ~/openclaw-docker
Step 4: Configure Nginx as a reverse proxy
Install Nginx and Certbot first:
sudo apt install -y nginx certbot
The site file below points at certificate files that do not exist yet, and nginx -t rejects a config that references missing certificates. So get the certificate first, using the default Nginx site on port 80 to answer the Let's Encrypt challenge. Your domain's DNS A record must already point at this server's IP, or the request fails (not run):
sudo certbot certonly --webroot -w /var/www/html -d openclaw.yourdomain.com --deploy-hook "systemctl reload nginx"
Certbot asks for your email address and asks you to agree to its terms. The --deploy-hook makes renewals reload Nginx so it picks up the new certificate.
Create the site configuration file. Replace openclaw.yourdomain.com with your actual domain:
upstream openclaw_backend {
server 127.0.0.1:18789;
}
server {
listen 80;
server_name openclaw.yourdomain.com;
location /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl http2;
server_name openclaw.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/openclaw.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/openclaw.yourdomain.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
location / {
proxy_pass http://openclaw_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
}
}
The Upgrade and Connection: upgrade headers are not optional. OpenClaw uses WebSockets for real-time communication: without these headers the dashboard will load but messages will not stream properly.
Two lines differ from my March config. I replaced http2 on; with listen 443 ssl http2; because the http2 directive only exists from nginx 1.25.1 (nginx.org), and Ubuntu 24.04 packages nginx 1.24.0, where nginx -t would reject it. And X-Forwarded-For is now set to $remote_addr: OpenClaw's network exposure guide marks $proxy_add_x_forwarded_for as bad because it keeps client supplied values, and says the proxy should overwrite the header.
There is one more gateway side step I have not run. With token authentication on, OpenClaw's guide says an unconfigured reverse proxy on the same host is rejected (HTTP 403 with proxy_attribution_required), and the fix is to set gateway.trustedProxies narrowly to the proxy's address. For a container behind a published port, the address the gateway sees for Nginx depends on Docker's network, so check the gateway logs for the rejected address before you set it.
The /.well-known/acme-challenge/ block in the port 80 server keeps certificate renewals working once the redirect is in place. Save this file to /etc/nginx/sites-available/openclaw, then enable it (not run):
sudo ln -s /etc/nginx/sites-available/openclaw /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 5: Get SSL with Let's Encrypt
The certificate was requested in Step 4, before the Nginx site file, because Nginx will not load a config whose certificate files are missing. With the site enabled and reloaded, Nginx now serves them. The Ubuntu Certbot package also installs a systemd timer that renews the certificate automatically before it expires, and the --deploy-hook from Step 4 reloads Nginx afterwards.
Test that automatic renewal works:
sudo certbot renew --dry-run
Step 6: Start OpenClaw
Go back to your project directory. The gateway refuses to start until onboarding has written gateway.mode=local into openclaw.json, and a gateway bound beyond loopback needs its Control UI origins configured. Because this hand written Compose file skips the setup script, run the project's one time bootstrap first. These are the commands from the manual flow in OpenClaw's Docker guide, with the allowed origin changed to your own domain (not run on my side). The first command is interactive and asks for your AI provider key:
cd ~/openclaw-docker
docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
dist/index.js onboard --mode local --no-install-daemon
docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
dist/index.js config set --batch-json '[{"path":"gateway.mode","value":"local"},{"path":"gateway.bind","value":"lan"},{"path":"gateway.controlUi.allowedOrigins","value":["https://openclaw.yourdomain.com"]}]'
docker compose up -d openclaw-gateway
In OpenClaw's guide the allowed origins are http://localhost:18789 and http://127.0.0.1:18789; I swapped in the https address Nginx serves. Add those two local origins as well if you also open the dashboard over an SSH tunnel.
Check that it started correctly and is listening on the right address:
docker compose ps
docker compose logs -f --tail 50
Check from the server that the port is published on loopback only, and that the gateway answers its health endpoint (which needs no authentication):
sudo ss -tlnp | grep 18789
curl -fsS http://127.0.0.1:18789/healthz
The ss output should show 127.0.0.1:18789. Visit https://openclaw.yourdomain.com in a browser and paste your gateway token from the .env file into Settings; onboarding already asked for your AI provider key. The project's Docker guide also lists /startupz and /readyz probes. If the browser asks to pair a new device, docker compose run --rm openclaw-cli devices list and devices approve <requestId> are the commands OpenClaw's Hetzner guide uses.
Step 7: Set up automated backups
Your OpenClaw configuration, channel credentials, and conversation history all live in the ~/openclaw-docker/config directory. Back this up daily. Here is a simple cron-based backup that keeps the last 7 days:
sudo crontab -e
The folders are owned by uid 1000 and OpenClaw creates its state with strict permissions, so use root's crontab (sudo crontab -e) for this job. Add this line to it (adjust the backup destination path as needed). OpenClaw also ships its own archive command, openclaw backup create with an --output option; if you run it inside the container, write the archive to a mounted folder or it disappears with the container:
0 3 * * * tar -czf /home/openclaw/backups/openclaw-$(date +\%Y\%m\%d).tar.gz /home/openclaw/openclaw-docker/config && find /home/openclaw/backups -name 'openclaw-*.tar.gz' -mtime +7 -delete
Create the backups directory first with mkdir -p ~/backups (cron needs the percent signs escaped, which is why they carry backslashes above). For production setups, push these backups to an S3 bucket or similar object storage instead of keeping them on the same server.
Method 4: Local Mac with Ollama (free, no API costs)
Running OpenClaw locally on your Mac with Ollama lets you test the platform with zero ongoing cost and complete privacy: no data leaves your machine. The tradeoff is that local models are less capable than cloud APIs, and your agent is only available when your Mac is on and not sleeping.
Requirements
- macOS 13.5 or later for the CLI and gateway (the floor of the official Node 24 builds; OpenClaw does not test macOS 11 to 13.4). The OpenClaw.app menu bar companion needs macOS 26.2.
- At least 8GB RAM (16GB recommended for comfortable performance)
- Apple Silicon (M1 or later) gives significantly faster inference than Intel
Step 1: Install Ollama
Download Ollama from ollama.com or install via Homebrew:
brew install ollama
Pull a model that supports tool calling. OpenClaw's onboarding only auto picks Ollama models that have tool support and at least 16K of context, and its own Ollama guide uses gemma4 in its examples (the default download is 6.6 GB on Ollama's library page). llama3.2, a 2.0 GB download with the tools tag, is the smaller choice this guide recommended in March:
ollama pull gemma4
ollama serve
Leave ollama serve running in a separate terminal tab, or run it as a background service with brew services start ollama (the Homebrew formula defines a service). Step 3 below covers OpenClaw's own autostart, not Ollama's.
Step 2: Install OpenClaw
OpenClaw requires Node 24.16 or later, or Node 26.1 or later, with Node 26 recommended. Node 22 was the requirement in March and is unsupported now. Check your version first:
node --version
If you need to install or upgrade Node, use nvm or Homebrew. Homebrew's node formula is on Node 26 (26.11.1 on October 11, 2026), which meets the requirement:
brew install node
Install OpenClaw globally and run the onboarding wizard (or use the installer script from the section above, which does both). The --allow-scripts flag is for npm 12 or npm 11.16 and later:
npm install -g openclaw@latest --allow-scripts=openclaw
openclaw onboard --install-daemon
When the wizard asks for an AI provider, choose Ollama (Local only) and enter http://localhost:11434 as the base URL, with no /v1 on the end: OpenClaw talks to Ollama's native API, and its Ollama guide warns that the OpenAI compatible /v1 URL breaks tool calling. Select gemma4 (or whichever tool capable model you pulled) as the model.
Step 3: Set up launchd for autostart
To have OpenClaw start automatically when your Mac boots or you log in, let OpenClaw install its own LaunchAgent. In March this step was a hand written launchd plist pointing at /usr/local/bin/openclaw, which is the wrong path on an Apple Silicon Homebrew setup and would collide with the managed service, so I replaced it.
openclaw gateway install
openclaw gateway status
openclaw gateway install installs and starts the service as a LaunchAgent on macOS (the project's install guide). Its default label is ai.openclaw.gateway. If you created the plist from my earlier version of this guide, remove it first with the commands from OpenClaw's uninstall guide:
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
The dashboard is available at http://127.0.0.1:18789 after the service starts. You can open it with openclaw dashboard.
openclaw.json configuration reference
After any installation method, the main configuration file lives at ~/.openclaw/openclaw.json (or the path you set in OPENCLAW_CONFIG_PATH or OPENCLAW_STATE_DIR). It is JSON5, so comments and trailing commas are allowed, and the gateway watches the file and applies most changes without a restart. Here are the most important settings you will want to configure once you are running.
{
"gateway": {
"bind": "loopback",
"auth": {
"mode": "token",
"token": "your-gateway-token-here"
},
"controlUi": {
"allowedOrigins": ["https://openclaw.yourdomain.com"]
}
},
"agents": {
"defaults": {
"sandbox": { "mode": "all" }
}
},
"tools": {
"exec": {
"security": "deny"
}
},
"channels": {
"whatsapp": {
"dmPolicy": "allowlist",
"allowFrom": ["+15555550123"],
"groups": {
"*": { "requireMention": true }
}
}
},
"messages": {
"groupChat": {
"mentionPatterns": ["@openclaw"]
}
}
}
Key settings explained:
- gateway.bind: "loopback": Restricts the gateway to listen on
127.0.0.1only, and it is the default for a host install. The valid values areloopback,lan,custom,tailnetandauto, not raw addresses like0.0.0.0. Only uselanwith gateway authentication and a real firewall. In the Docker file above the Compose command passes--bind laninside the container while the host port stays on127.0.0.1. - gateway.auth.token: The bearer token required to access the dashboard and API. Generate a strong one with
openssl rand -hex 32(oropenclaw doctor --generate-gateway-token). Authentication is required by default, and onboarding generates a token even for loopback. - gateway.controlUi.allowedOrigins: Allowlist of domains that can load the control UI. Set this to your domain, not a wildcard.
- agents.defaults.sandbox.mode: "all": Runs agent tool execution in sandboxes (Docker by default), limiting what agent code can reach on the host. Sandboxing is off by default; the modes are
off,non-mainandall, and OpenClaw describes it as reducing blast radius, not as a perfect boundary. When OpenClaw itself runs in a container, sandboxing also needs the Docker CLI in the image and the host Docker socket mounted, which the official Compose file leaves commented out; the setup script handles it withOPENCLAW_SANDBOX=1. Mountingdocker.sockgives the container control of the Docker daemon, which is root equivalent control of the host, so only do it knowing that trade. - tools.exec.security: "deny": Prevents agents from running arbitrary shell commands. The current docs name
tools.exec.mode(deny,allowlist,ask,auto,full) as the canonical setting, and say the default for gateway host exec isfull, which means no approval prompts. Thesecurity: "deny"form shown above is the one in OpenClaw's hardened baseline page. You can whitelist specific commands as needed. - channels.whatsapp.dmPolicy: "allowlist": Only phone numbers in
allowFromcan message the bot directly. Options areallowlist,pairing(new users get a code), oropen(anyone can message). - channels.whatsapp.groups.*.requireMention: In group chats, the bot only responds when explicitly mentioned (e.g. @openclaw). Prevents the agent from processing every message in a busy group.
Channel setup quick start
WhatsApp uses the WhatsApp Web protocol (via Baileys). You link your phone number or a dedicated WhatsApp number: the gateway maintains the session. Run the login command to get a QR code:
openclaw channels login --channel whatsapp
Or in Docker:
docker compose run --rm openclaw-cli channels login --channel whatsapp
Login is QR only. On a remote or headless server, have a reliable way to get the live QR code to your phone before you start, because a terminal rendered QR or a screenshot can expire in transit (OpenClaw's WhatsApp guide says the same).
Scan the QR code with your WhatsApp mobile app under Settings → Linked Devices. Once paired, the gateway maintains the session automatically. Add your phone number to channels.whatsapp.allowFrom in the config so you can actually message it.
For a dedicated number (recommended for business use), get a separate SIM or use a virtual number service and create a fresh WhatsApp account on that number. This keeps your personal WhatsApp completely separate.
Telegram
Telegram requires creating a bot through @BotFather. Open Telegram, start a conversation with @BotFather, and send /newbot. Follow the prompts to name your bot and get the bot token (format: 123456789:ABCdef...).
Add the token to your config:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456789:ABCdef...",
"dmPolicy": "pairing",
"groups": {
"*": { "requireMention": true }
}
}
}
}
Start the gateway and approve the first message pairing request:
openclaw gateway
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
Pairing codes expire after one hour. If you miss the window, the next message from that Telegram account generates a new code.
Slack
Slack integration uses Socket Mode, which means OpenClaw connects outbound to Slack rather than requiring a public webhook URL. This works even without a domain name and is easier to set up behind a firewall.
Create a Slack app at api.slack.com/apps and enable Socket Mode. OpenClaw's Slack setup guide now ships a ready made app manifest (Create New App, From a manifest) with the scopes and events below already set, which is the quicker route. You need two tokens:
- App Token (format:
xapp-...): requiresconnections:writepermission - Bot Token (format:
xoxb-...): obtained after installing the app to your workspace
Enable these event subscriptions in your app settings: app_mention, message.channels, message.groups, message.im, and message.mpim. Also enable the App Home Messages Tab so users can DM the bot directly.
Add to your config:
{
"channels": {
"slack": {
"enabled": true,
"mode": "socket",
"appToken": "xapp-...",
"botToken": "xoxb-..."
}
}
}
Security essentials
OpenClaw can send emails, run shell commands, access files, make API calls, and control a browser. A misconfigured instance is not just annoying: it can be actively dangerous. These are the non-negotiable security basics.
Bind to loopback, always
The gateway should never listen on 0.0.0.0 on a public server. Set gateway.bind: "loopback" in your config and verify with:
sudo ss -tlnp | grep 18789
The output should show 127.0.0.1:18789. If it shows 0.0.0.0:18789, your gateway is reachable from the internet. It still requires its token, but a login page on the open internet is exactly what the exposure advisories targeted, so fix the bind or the Docker port mapping.
Set a strong gateway token
The gateway token is the only authentication layer protecting your dashboard. Use at least 32 random bytes:
openssl rand -hex 32
Store it only in your .env file (permissions: 600) or a proper secrets manager. Do not commit it to version control.
Restrict exec mode
Shell command execution is the highest-risk capability. Start with it disabled and only enable it for specific, allowlisted commands. Do not rely on the default: the exec docs say host exec runs without approval prompts unless you tighten the mode.
{
"tools": {
"exec": {
"security": "deny"
}
}
}
To enable specific commands later, use "security": "allowlist" and list exactly which commands are permitted.
Lock down message channels
Never set dmPolicy: "open" unless you specifically want any random person who discovers your bot to be able to talk to it and trigger agent actions. Use allowlist for known users or pairing for controlled access to new users.
Run the security audit
OpenClaw has a built-in security audit command that checks for common misconfigurations:
openclaw security audit --deep
Run this after initial setup and after any major configuration change. The --fix flag can auto-correct some issues, but review each fix before applying it. Plain openclaw security audit reads config and files only; --deep adds live gateway checks.
File permissions for the config directory
Your ~/.openclaw directory contains API keys, channel credentials, and session transcripts. Lock it down:
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
Troubleshooting
Gateway not starting
First check the logs:
# Native install
openclaw logs --follow
# Docker install
docker compose logs -f --tail 100
Common causes: missing or invalid API key in the environment, port 18789 already in use by another process, or a Node.js version below the minimum (24.16, or 26.1 on the Node 26 line; Node 22 is unsupported since v2026.9.3). Run openclaw doctor for a diagnosis, or openclaw triage for a read only report you can hand to a coding agent.
Nginx 502 Bad Gateway
This means Nginx is running but cannot reach the OpenClaw gateway. Check that the container is actually up and listening on the right port:
docker compose ps
curl -I http://127.0.0.1:18789
If the container is running but the curl fails, check two things. First, that the ports section in docker-compose.yml maps 127.0.0.1:18789:18789; a mapping of 18789:18789 without the IP prefix publishes on every interface, it does not bind to loopback. Second, that the gateway inside the container was started with --bind lan: the image's default command binds loopback inside the container, and then the published port cannot reach it. A 403 with proxy_attribution_required in the logs means the same host proxy is not in gateway.trustedProxies.
WhatsApp keeps disconnecting
WhatsApp Web sessions expire if the gateway goes offline for more than a few days, or if you open WhatsApp Web on another browser while the gateway is running. The session is stored in ~/.openclaw/credentials/whatsapp/: if this directory is missing or corrupt, you need to re-pair by running the login command again. On VPS setups, make sure this directory is in your Docker volume mount so it persists across container restarts.
Telegram bot not responding
The most common issue is the bot being added to a group with privacy mode enabled. By default, Telegram bots in groups only see messages that start with / or mention the bot directly. Either disable privacy mode in BotFather with /setprivacy, make the bot a group admin, or set requireMention: true in your config so the bot only fires when explicitly mentioned. After you toggle privacy mode, remove the bot from each group and add it again so Telegram applies the change.
Dashboard loads but messages do not appear
This is almost always a WebSocket issue. Check that your Nginx config includes the Upgrade and Connection: upgrade proxy headers. Without them, the long-lived WebSocket connection that streams messages to the dashboard cannot establish.
Container runs out of memory during build
If you are building the Docker image locally (rather than using the prebuilt image from ghcr.io), OpenClaw's Docker guide asks for at least 6 GB of RAM for a source build, and a build that ends with Killed or exit code 137 means the server ran out of memory. In March I wrote that 2GB was the minimum; that figure was too low for a source build. Either upgrade to a larger server or use the prebuilt image:
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
Let's Encrypt certificate renewal fails
The most common cause is Nginx not running when the renewal tries to complete. Certbot uses a standalone challenge that needs port 80 free, or it uses the Nginx plugin which requires Nginx to be running. Check with:
sudo certbot renew --dry-run
sudo systemctl status nginx
Pairing code expired
Pairing codes expire after one hour and pending DM pairing requests are capped at three per channel account; extra requests are ignored until one expires or is approved. List what is pending, which also prunes expired requests, and approve the one you want:
openclaw pairing list whatsapp
openclaw pairing approve whatsapp <CODE>
My March version of this step used openclaw pairing reject. The current CLI reference lists only list and approve for channel pairing (openclaw devices reject exists, but it is for browser and node devices), so I removed it.
Cannot connect to dashboard after closing SSH tunnel
If you access your VPS dashboard through an SSH tunnel (the most secure approach for local-only setups), you need the tunnel active to reach the dashboard. Re-establish it with:
ssh -L 18789:localhost:18789 user@your-vps.com -N
Then visit http://localhost:18789 in your browser. If the tunnel fails with "administratively prohibited", the SSH daemon is blocking port forwarding; OpenClaw's Hetzner guide sets AllowTcpForwarding local in /etc/ssh/sshd_config, validates with sshd -t and restarts SSH.
Frequently asked questions
What is the minimum server size I need to run OpenClaw?
For a single user setup with one or two channels, 1GB RAM and 1 vCPU is enough for daily use, but only with a swap file and a hosted model: OpenClaw's DigitalOcean guide runs the $6 per month 1GB droplet that way and says local models do not fit in 1GB. Once you add multiple channels, enable sandboxing, or use browser automation tools, 2GB RAM becomes the practical minimum. DigitalOcean's catalog page recommends 4GB and 2 CPUs for personal use and 8GB and 4 CPUs for a small team of 5 to 20. A source build of the Docker image needs 6GB.
Can I run OpenClaw on a shared hosting plan?
No. OpenClaw requires a persistent process and optionally Docker: neither is available on typical shared hosting. You need a VPS with KVM virtualization or a platform like Railway that handles containers for you. Shared hosting plans running on cPanel or Plesk will not work.
Is the Railway method secure for production use?
Railway handles TLS, DDoS protection, and infrastructure security for you. The main risk is the gateway token: if someone gets that, they have full control of your agent. Use a strong token (32+ random hex characters), enable the allowlist on your channels so only your number can message the bot, and restrict exec mode in your config. Railway is fine for production personal and small-team use. For enterprise deployments with strict compliance requirements, the self-hosted Docker VPS path gives you more control over the network boundary.
How much does running OpenClaw cost per month including AI API costs?
The server is $4 to $24 per month depending on provider and size (DigitalOcean's list prices were checked October 11, 2026; the lower end is my earlier estimate). AI costs depend entirely on usage. Anthropic's pricing page (checked October 11, 2026) lists Claude Haiku 5.5 at $0.10 per million input tokens and $0.50 per million output tokens for prompts up to 100,000 tokens, and Claude Sonnet 5.5 at $2 and $10. In March, with Claude Haiku 4.5 ($1 and $5 per million tokens), this guide estimated that a moderately active personal agent handling 50 to 100 messages per day cost $1 to $3 per month in API fees, and heavier use with longer context windows or more capable models $10 to $30 per month. I have not measured those monthly figures again; the per token price is one tenth of Haiku 4.5's, but Haiku 5.5 uses a new tokenizer, so token counts differ. The local Ollama method eliminates API costs entirely at the price of slower, less capable responses.
Can I use OpenClaw with multiple WhatsApp numbers?
Yes. OpenClaw supports multi-account configuration for WhatsApp. Each account gets its own credentials stored under ~/.openclaw/credentials/whatsapp/<accountId>/. Run the login command with an account flag to pair additional numbers: openclaw channels login --channel whatsapp --account work. Each account can have its own allowlist and policy settings in the config.
Does OpenClaw work on Windows?
Yes, and this answer changed. In March, native Windows installation was not officially supported. The project's install guide now lists three Windows routes: the native Windows Hub companion app (a signed installer with setup, tray status and chat), the PowerShell installer (iwr -useb https://openclaw.ai/install.ps1 | iex), and a WSL2 gateway. On native Windows the gateway service is a Scheduled Task. The Docker method works on Windows with Docker Desktop installed, but all the shell commands in this guide assume a Linux environment: run them inside WSL2 for best results. For production use, a Linux VPS is strongly recommended over Windows.
How do I update OpenClaw to the latest version?
For the Docker method: docker compose pull && docker compose up -d && docker image prune -f; the image entrypoint runs openclaw doctor --fix --non-interactive against your mounted state before the gateway starts. For an npm, pnpm or Bun install, the project recommends openclaw update, which stages the new version and checks configuration, database schema and Node requirements before activating it; an install older than July 2026 should step through 2026.9.5 first. I could not confirm from OpenClaw's docs whether the Railway template follows new releases on its own, so check openclaw --version in the Railway shell. I have not run an update on the DigitalOcean Marketplace image; it bundled 2026.9.3 per DigitalOcean's catalog page, so check the version after deploy. Always check the GitHub release notes before updating in production: v2026.9.3, for example, raised the Node requirement and listed it as a breaking change.
What happens to my data if I switch from Railway to a self-hosted VPS?
OpenClaw has a built-in backup and restore command. On Railway, open the shell and run openclaw backup create to create an archive of your state, config, auth profiles and workspace. Then copy that archive to your new server, check it with openclaw backup verify <archive.tar.gz>, and restore it with openclaw backup restore <archive.tar.gz> --target <fresh-directory>. Restore extracts into a fresh staging directory and activation is a separate offline step, so follow OpenClaw's restore guide for the activation sequence. My March answer used backup export and backup import, which are not in the current CLI reference. Channel credentials like WhatsApp sessions do not always transfer cleanly: you may need to re-pair your messaging apps after migration.
How do I stop OpenClaw from responding to everyone on WhatsApp?
Set dmPolicy: "allowlist" and add only your phone number to allowFrom in your WhatsApp channel config. For groups, set requireMention: true so the agent only fires when someone uses the mention pattern (like @openclaw). These two settings together mean the agent only responds to you in DMs and only when explicitly mentioned in groups.
Can OpenClaw run multiple AI models at once?
Yes. You can configure different agents with different model providers and route tasks accordingly. For example, use a fast, cheap model like Claude Haiku for quick replies and a more capable model for complex research tasks. This is configured at the agent level in openclaw.json under agents. Multi-agent routing with isolated sessions is one of OpenClaw's core features: agents can hand off tasks to each other based on capability or workload.
Ready to deploy?
You now have everything you need to get OpenClaw running, secured, and connected to your channels. The Railway method gets you live in five minutes. The Docker VPS path gives you a production-grade setup you can trust with real workloads.
Where most teams get stuck is not installation: it is knowing what to do with OpenClaw once it is running. What automations to build first. How to design multi-agent workflows that actually save time instead of creating new maintenance headaches. How to connect it to the internal tools and data sources that make it genuinely useful.
That is where I work with clients. If you are building AI agent infrastructure for a business and want someone who has done this across ecommerce, logistics, legal tech, and B2B SaaS, take a look at the AI agent services page, the AI agent development service or browse the case studies to see what these deployments look like in practice.
Last updated
October 11, 2026
Category
OpenClaw
Jahanzaib Ahmed
AI Systems Engineer & Founder
AI Systems Engineer with 126 production systems shipped. I run AgenticMode AI (AI agents, RAG systems, voice AI) and ECOM PANDA (ecommerce agency). I build AI that works in the real world for businesses across home services, healthcare, ecommerce, SaaS, and real estate.
Want this built for your business? See AI Agent Development, or browse the free tools and guides.
Related articles

How to Set Up Hermes Agent and Lock Down the Defaults First
What Hermes Agent from Nous Research is, how to install it, which models it works with, how to lock it down, what it costs to run, and when to pick it over OpenClaw.
How toOpen Source & WeightsHermes Agent
What Is OpenClaw? Everything You Need to Know About the World's Most Starred AI Agent
OpenClaw is the open source AI agent with 391,000+ GitHub stars and an independent foundation behind it. What it is, how it works, what it costs, and the security record, checked October 11, 2026.
GuideOpenClawOpenClaw
How to Evaluate the Manus AI Agent in October 2026: Owner, Cost and Risks
Who owns the Manus AI agent after the Meta deal was unwound, what its credits cost in October 2026, how its sandbox and security record look, and when to pick OpenClaw, Hermes Agent, Claude, OpenAI or n8n.
How toAI AgentsManus