Self-host OpenClaw on a managed VPS: your AI assistant, always on

To self-host OpenClaw on a managed VPS is to give your AI assistant a server that never sleeps, with its memory, settings and credentials on a machine of your own, which our teams keep up to date and monitor day and night. OpenClaw is a free, open source assistant under the MIT license that answers you in the chat apps you already use. This guide follows its official Docker image at version 2026.11.10, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose, HTTPS, browser pairing, backups, a restore and an update.

Simon Vasconcelos Lee By Published on 27 November 202614 minute read

All guides

In short

  1. The MIT license lets you run OpenClaw for yourself, your team or your clients with nothing to buy. Your model provider bills its own usage, with your own API key.
  2. Install it with Docker Compose: the official image openclaw/openclaw, a Gateway service and a CLI service, with the Gateway port published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Generate the Gateway token in a .env file, run the onboarding without a model, then set gateway.publicOrigin and gateway.trustedProxies: without the latter, every request through the proxy gets a 403.
  4. Open your address, paste the token, then approve the browser once from the server with devices approve.
  5. Back up with openclaw backup create --verify, which captures the SQLite databases safely. To update, change the image tag, pull, stop and start: the image repairs and migrates its state on its own.

What OpenClaw does

OpenClaw is an AI assistant that runs on your own machine and meets you in the channels you already use: WhatsApp, Telegram, Slack, Discord, Microsoft Teams, iMessage and more than twenty others, plus apps for desktop and mobile. Its heart is the Gateway, a Node.js service that holds your agents, their memory, your channels and your settings, and serves a web console, the Control UI.

The project is stewarded by the OpenClaw Foundation, an independent non-profit, and its README states that it has no paid tier, hosted service or token. A server suits it well: the assistant stays reachable day and night, and its state stays in one place you control.

What needs your model API key

OpenClaw installs and runs without any model key, and this guide does not use one: the key belongs to you and to your account at the model provider, which bills its usage. Here is what we saw on our test VPS before connecting a model.

Once you are connected, the Control UI opens Settings on “Connect a verified AI model”: its Connect provider button lists Anthropic, OpenAI, Google AI Studio, OpenRouter, Ollama Cloud, LM Studio and many more. OpenClaw runs a real test request before it saves a model and its credential. Set a spending limit in your provider’s console as well: an assistant that runs around the clock can use a lot of tokens.

What the MIT license allows

OpenClaw is published under the MIT license, copyright the OpenClaw Foundation. You can use it free of charge, for yourself, your company or your clients, copy it, modify it and redistribute it, as long as you keep the copyright notice and the license text. The software is provided without warranty.

Skills and plugins from other authors keep their own licenses, and the model you connect follows the terms of its provider.

The resources to plan for

The documentation asks for at least 6 GB of memory to build the image from source, and notes that the pre-built images avoid this requirement: this guide uses them. Here is what we measured on our test VPS, with 2 vCPU and 4 GB of memory, after the installation:

Server size therefore depends on your agents, their tools and the other applications on the server. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

Each OpenClaw release publishes its image to the GitHub Container Registry, ghcr.io/openclaw/openclaw, and to an official Docker Hub mirror, openclaw/openclaw, with the same tags: we used the latter. The image runs as the node user, uid 1000. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create the folders of the installation and give them to that user:

Terminal
mkdir -p /opt/openclaw/config /opt/openclaw/workspace /opt/openclaw/auth-secrets /opt/openclaw/backups
chown 1000:1000 /opt/openclaw/config /opt/openclaw/workspace /opt/openclaw/auth-secrets /opt/openclaw/backups
chmod 700 /opt/openclaw/config /opt/openclaw/auth-secrets /opt/openclaw/backups

Then put this compose.yaml in /opt/openclaw. It follows the docker-compose.yml of the OpenClaw repository, with its two services and its hardening, and changes what a server behind a reverse proxy needs:

compose.yaml
services:
  openclaw-gateway:
    image: openclaw/openclaw:2026.11.10
    restart: unless-stopped
    env_file: .env
    environment: &openclaw-env
      HOME: /home/node
      OPENCLAW_HOME: /home/node
      OPENCLAW_STATE_DIR: /home/node/.openclaw
      OPENCLAW_CONFIG_PATH: /home/node/.openclaw/openclaw.json
      OPENCLAW_CONFIG_DIR: /home/node/.openclaw
      OPENCLAW_WORKSPACE_DIR: /home/node/.openclaw/workspace
      OPENCLAW_GATEWAY_PORT: "18789"
      TZ: UTC
    volumes: &openclaw-volumes
      - ./config:/home/node/.openclaw
      - ./workspace:/home/node/.openclaw/workspace
      - ./auth-secrets:/home/node/.config/openclaw
      - ./backups:/backups
    cap_drop: [NET_RAW, NET_ADMIN]
    security_opt: ["no-new-privileges:true"]
    init: true
    ports:
      - "127.0.0.1:8119:18789"
    command: ["node", "dist/index.js", "gateway", "--bind", "lan", "--port", "18789"]
    healthcheck:
      test: ["CMD", "node", "dist/docker-healthcheck.js"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s

  openclaw-cli:
    image: openclaw/openclaw:2026.11.10
    network_mode: "service:openclaw-gateway"
    pid: "service:openclaw-gateway"
    env_file: .env
    environment:
      <<: *openclaw-env
      BROWSER: echo
    volumes: *openclaw-volumes
    cap_drop: [NET_RAW, NET_ADMIN]
    security_opt: ["no-new-privileges:true"]
    init: true
    stdin_open: true
    tty: true
    entrypoint: ["node", "dist/index.js"]
    depends_on:
      - openclaw-gateway

networks:
  default:
    ipam:
      config:
        - subnet: 172.30.119.0/24

The Gateway token goes in a .env file next to it, readable by root only:

Terminal, in /opt/openclaw
umask 077
printf "OPENCLAW_GATEWAY_TOKEN=%s\n" "$(openssl rand -hex 32)" > .env
umask 022

The onboarding, without a model

OpenClaw configures itself through its onboarding. The documentation describes a headless version for servers; here it runs with --auth-choice skip, so that no model is required yet:

Terminal, in /opt/openclaw
docker compose run -T --rm --no-deps --entrypoint node openclaw-gateway dist/index.js onboard --non-interactive --accept-risk --skip-health --mode local --auth-choice skip --gateway-auth token --gateway-token-ref-env OPENCLAW_GATEWAY_TOKEN --secret-input-mode ref --skip-channels --no-install-daemon

It creates openclaw.json, the main agent and its workspace. With --secret-input-mode ref, the configuration stores a reference to OPENCLAW_GATEWAY_TOKEN, never the token itself. Then tell the Gateway about its public address and about the proxy in front of it:

Terminal, in /opt/openclaw
docker compose run -T --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.publicOrigin","value":"https://openclaw.example.com"},{"path":"gateway.trustedProxies","value":["172.30.119.1"]}]'
docker compose up -d openclaw-gateway

On our test VPS, the Gateway answered within a minute of its first start. To check it:

Terminal, in /opt/openclaw
docker compose ps
curl -fsS http://127.0.0.1:8119/healthz

The container turns healthy and the second command returns {"ok":true,"status":"live"}. Its logs then show a Doctor warning that the Gateway is bound to lan: inside the container, that is expected, since the server itself only listens on 127.0.0.1:8119.

HTTPS: the reverse proxy

The container serves the Control UI and its WebSocket over HTTP, on port 8119 of the server. HTTPS is handled by a reverse proxy in front of it. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, passes WebSocket connections through, and replaces the X-Forwarded-For header with the real client address, as the OpenClaw documentation asks. Add this block to the Caddyfile:

/etc/caddy/Caddyfile
openclaw.example.com {
	reverse_proxy 127.0.0.1:8119
}
Terminal
systemctl reload caddy

The first login and browser pairing

Open your address: the Control UI asks for the Gateway secret. Paste the token generated in .env, which this command displays:

Terminal
grep OPENCLAW_GATEWAY_TOKEN /opt/openclaw/.env

Click Connect. The token is accepted, and the page then shows “Approve this browser”: OpenClaw pairs each browser once, with a device key of its own. The page prints the request ID, in an openclaw devices approve command. In Docker, the same commands run through the CLI service:

Terminal, in /opt/openclaw
docker compose run --rm openclaw-cli devices list

The list shows the pending request with the operator role. Approve it with docker compose run --rm openclaw-cli devices approve, followed by its request ID. Keep the browser page open meanwhile: on our test VPS, it connected on its own a few seconds after the approval, and showed the main session with “Connected”. If you closed it before, open it again and paste the token once more: the browser is already approved.

Each browser profile has its own device key, so a new browser, a private window or cleared site data asks for a new approval. The token is the key to your assistant: keep it out of shared documents, and remove the devices you no longer use from Settings, Devices.

Once connected, connect your model from Settings, then your chat apps from Channels. Every channel has its own page in the OpenClaw documentation.

Backups

Everything lives in /opt/openclaw: the config folder with the configuration, the SQLite databases and the credentials, the workspace folder, the auth-secrets folder and the .env file with the token. The documentation warns against copying live .sqlite files, and provides a command that captures the databases safely while the Gateway runs, then verifies the archive:

Terminal, in /opt/openclaw
umask 077
docker compose run -T --rm openclaw-cli backup create --output /backups --verify
cp .env backups/env-$(date +%F).bak
umask 022

The archive lands in /opt/openclaw/backups, readable by its owner only, with a name such as 2026-11-27T06-08-31.535+00-00-openclaw-backup.tar.gz; on our test VPS, the command ended with “Archive verification: passed”. It contains your credentials and conversations: keep it as carefully as the server itself. The auth-secrets folder is not part of it; it was empty on our new installation, and if yours holds files, copy it too. Schedule this backup and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

OpenClaw never restores over live data: backup restore verifies the archive, then extracts it into an empty folder, and you move the state into place. On our test VPS, we stopped the Gateway, deleted the state and the workspace, then restored them with these commands, run one by one and stopping at the first error:

Terminal, in /opt/openclaw
docker compose stop openclaw-gateway
rm -rf config workspace
mkdir config workspace
chown 1000:1000 config workspace
chmod 700 config
docker compose run -T --rm --no-deps --entrypoint node openclaw-gateway dist/index.js backup restore /backups/2026-11-27T06-08-31.535+00-00-openclaw-backup.tar.gz --target /backups/restored
docker compose run -T --rm --no-deps --entrypoint sh openclaw-gateway -c "cp -a /backups/restored/*/payload/posix/home/node/.openclaw/. /home/node/.openclaw/"
chmod 700 config
docker compose run -T --rm --no-deps --entrypoint node openclaw-gateway dist/index.js doctor --non-interactive
docker compose up -d openclaw-gateway
rm -rf backups/restored

Everything came back: the line we had added to USER.md, the time zone set in the configuration, and the paired browser, which reconnected without asking for the token again and opened the Control UI on version 2026.11.10.

Updates

OpenClaw releases often: the five releases from 2026.11.6 to 2026.11.10 came out within six days. Version tags are fixed; latest follows stable releases, and beta tags such as 2026.11.10-beta.1 are for testing. This guide pins 2026.11.10, the latest stable release when we tested it: check the releases page for a newer one before you install. Take a backup first, then change the tag of both services in compose.yaml and replace the container:

Terminal, in /opt/openclaw
docker compose pull openclaw-gateway openclaw-cli
docker compose stop openclaw-gateway
docker compose up -d openclaw-gateway
docker compose run -T --rm openclaw-cli --version

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; OpenClaw remains your software, with your agents, your settings and your model account.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour agents, channels and conversations in OpenClaw
OpenClawProactive monitoring: errors, slowdowns, memory and disk space spotted, fix recommendedIts installation, updates, skills and settings, which you apply, yourself or through your AI assistant
ModelsThe server that holds your configuration, monitored and backed upYour API key, your provider account and its spending limits
BackupsEvery night, encrypted and kept off the machine; restores includedOpenClaw’s own archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

OpenClaw, on a server run for you

With a Simafri Managed VPS, our teams keep your OpenClaw server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is OpenClaw free?

Yes. OpenClaw is under the MIT license, and its README states that it has no paid tier, hosted service or token. What remains is the cost of the server that runs it and of the model you connect, billed by your provider.

Do I need an API key to install OpenClaw?

Not to install it. With the onboarding option --auth-choice skip, the Gateway, the Control UI, pairing, backups and updates all work without a model. The assistant needs your model key to answer, to run scheduled jobs and to reply in your channels.

How do I install OpenClaw with Docker Compose?

Use the openclaw/openclaw image in a compose.yaml with a Gateway service and a CLI service, publish port 18789 of the Gateway on 127.0.0.1 only, and put the Gateway token in a .env file. Run the onboarding, set gateway.publicOrigin and gateway.trustedProxies, start the Gateway, and put an HTTPS reverse proxy in front.

How much memory does OpenClaw need in Docker?

With the pre-built image, about 1.6 GB for the Gateway at rest on our test VPS, without a model connected; plan a server with at least 4 GB. The 6 GB in the documentation apply to building the image from source.

Why does OpenClaw answer 403 behind a reverse proxy?

Because the proxy is not in gateway.trustedProxies. The Gateway then refuses requests whose client address it cannot attribute, with the error proxy_attribution_required, even with the right token. Declare the proxy address as the Gateway sees it: with Docker port publishing, the gateway address of the Compose network.

What does “Approve this browser” mean in the OpenClaw Control UI?

The token was accepted, and OpenClaw now pairs the browser once. Run devices list from the CLI service on the server, then devices approve with the request ID shown. Keep the page open: it connects on its own after the approval.

How do I back up OpenClaw in Docker?

Run openclaw backup create --output /backups --verify from the CLI service: it captures the SQLite databases safely while the Gateway runs and verifies the archive. Keep a copy of .env too. To restore, run backup restore into an empty folder, copy the state into place with the Gateway stopped, run Doctor, then start it.

How do I update OpenClaw in Docker?

Take a backup, change the image tag of both services in compose.yaml, then run docker compose pull, stop the Gateway and start it again. The new image runs Doctor on start and migrates the state; we tested it from 2026.11.6 to 2026.11.10.

Does a managed VPS cover OpenClaw?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us