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.
By Simon Vasconcelos Lee
Published on 27 November 202614 minute read
openclaw/openclaw, a Gateway service and a CLI service, with the Gateway port published on 127.0.0.1 behind an HTTPS reverse proxy..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.devices approve.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.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.
USER.md, SOUL.md and AGENTS.md that describe you, the assistant and its rules.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.
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.
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 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.
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:
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:
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
openclaw-gateway runs the Gateway, and openclaw-cli runs the openclaw command on demand, inside the Gateway’s network. The anchors &openclaw-env and &openclaw-volumes keep their settings identical.2026.11.10, avoids the build and lets you choose when each update happens.127.0.0.1: the repository file publishes the Gateway, its bridge port 18790 and the Microsoft Teams port 3978 on every address of the server. Here, only the Gateway is published, locally, on port 8119; Caddy reaches it from the server itself.--bind lan is the normal setting in a container, as the documentation explains: loopback would leave the Gateway reachable from inside its container only.pid: "service:openclaw-gateway", from the Compose operations page: the CLI then sees the Gateway’s processes. Without it, reading the configuration while the Gateway ran failed on our test VPS with “cannot verify Gateway ownership from this process”.172.30.119.1, which you declare as a trusted proxy below. Pick another private range if this one is taken on your server.config holds openclaw.json, the SQLite databases, credentials and logs; workspace the agent’s files; auth-secrets a key kept for older encrypted credentials; backups your archives.The Gateway token goes in a .env file next to it, readable by root only:
umask 077
printf "OPENCLAW_GATEWAY_TOKEN=%s\n" "$(openssl rand -hex 32)" > .env
umask 022
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:
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:
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
gateway.publicOrigin is your address with https://: the Control UI accepts browsers from this origin.gateway.trustedProxies lets the Gateway read the client address that Caddy forwards. We removed it on our test VPS: every request through the proxy, with the right token or not, received a 403 with the error proxy_attribution_required. Put it back, and the right token gets a 200.On our test VPS, the Gateway answered within a minute of its first start. To check it:
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.
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:
openclaw.example.com {
reverse_proxy 127.0.0.1:8119
}
systemctl reload caddy
/control-ui-config.json, the Control UI settings, answered 401 without the token or with a wrong one, and 200 with the right one; ports 8119 and 18789 were unreachable from the internet.Open your address: the Control UI asks for the Gateway secret. Paste the token generated in .env, which this command displays:
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:
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.
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:
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.
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:
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
backup create; replace it with yours.node user and with the same mounts, so the workspace files return to the workspace folder. The second chmod closes the config folder again, since the copy brings back the permissions recorded in the archive.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.
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:
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
OpenClaw 2026.11.10. The time zone, the workspace note written on 2026.11.6 and the paired browser were still there; the browser reconnected without asking for the token again.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.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your agents, channels and conversations in OpenClaw |
| OpenClaw | Proactive monitoring: errors, slowdowns, memory and disk space spotted, fix recommended | Its installation, updates, skills and settings, which you apply, yourself or through your AI assistant |
| Models | The server that holds your configuration, monitored and backed up | Your API key, your provider account and its spending limits |
| Backups | Every night, encrypted and kept off the machine; restores included | OpenClaw’s own archives, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.