How to Install OpenClaw on a VPS (Docker and HTTPS)
Truobox
December 1, 2026
Introduction
This guide shows how to install OpenClaw on a VPS so your assistant stays online without a computer running at home. OpenClaw is a personal AI assistant that runs on your own server and connects to your channels, such as Telegram, Discord or WhatsApp.
There are three ways to get there, from shortest to most manual:
- A one-click image: the VPS boots with OpenClaw already installed.
- A one-command installer: an open recipe that sets up Docker, the OpenClaw gateway and HTTPS on any Ubuntu or Debian VPS.
- The official OpenClaw Docker setup: the script from OpenClaw’s own repository.
Whichever you pick, the last steps are the same: connect an AI provider, open the panel and pair your browser.
The short path. A VPS for OpenClaw from Truobox boots with the app installed, HTTPS and its own access token. See OpenClaw VPS plans ->
What you need
- A VPS with Ubuntu 24.04 (Debian 12 and Ubuntu 22.04 or later also work) and root access.
- At least 2 GB of RAM and 15 GB of free disk.
- Ports 80 and 443 open.
- An API key from an AI provider: Anthropic, OpenAI, OpenRouter or another one supported by OpenClaw.
- Optional: a domain or subdomain with an A record pointing to the IP of the VPS. Without one, the installer uses an address based on your IP (
your-ip.sslip.io) and HTTPS works the same.
If you have never connected to a server before, start with how to log in to a Linux VPS.
Option 1: one-click OpenClaw image
This is the path with the fewest steps.
- Choose a plan on the OpenClaw VPS page.
- In the order, where you choose what to install, open Pre-installed app and select OpenClaw.
- When the server is ready, log in over SSH. The first boot generates the keys of your server and starts the app; SSH opens once that is done.
The welcome message shows two things you will need: the address of your OpenClaw panel and the gateway token. Continue with Connect your AI provider.
Option 2: install OpenClaw with one command
The one-click image is built from a public recipe, and you can run the same recipe on any Ubuntu or Debian VPS. Log in as root (or a user with sudo) and run:
curl -fsSL https://raw.githubusercontent.com/truobox/vps-apps/main/install.sh | sudo bash -s -- openclaw
If your domain already points to the server, pass it up front so there are no questions:
curl -fsSL https://raw.githubusercontent.com/truobox/vps-apps/main/install.sh | sudo DOMAIN=openclaw.yourdomain.com bash -s -- openclaw
Reading a script before running it is good practice:
curl -fsSL https://raw.githubusercontent.com/truobox/vps-apps/main/install.sh -o install.sh
less install.sh
sudo bash install.sh openclaw
What the installer sets up
- Docker and Docker Compose, if they are missing.
- The OpenClaw gateway from the official image, with an access token unique to your server.
- Caddy as a reverse proxy with an automatic HTTPS certificate.
- Three commands:
openclaw(the OpenClaw CLI),openclaw-setup(AI key) andopenclaw-pair(pair your browser).
Everything lives in /opt/openclaw: the docker-compose.yml, the .env file and the Caddyfile. The token is generated on your server and running the installer again does not change it.
Option 3: OpenClaw Docker setup from the official repository
If you prefer to follow OpenClaw’s own documentation, the official Docker install works from a checkout of the OpenClaw repository. You need Docker Engine and Docker Compose v2 on the server.
From the root of the repository, tell the setup script to use the pre-built image and run it:
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
Using the pre-built image matters on a small VPS: according to the OpenClaw docs, building the image from source needs at least 6 GB of RAM, and the pre-built image avoids that build.
The setup generates a gateway token and writes it to .env. The gateway listens on port 18789, and the docs tell you to open http://127.0.0.1:18789/ and paste the token into Settings. On a VPS that address is the server itself, so open an SSH tunnel from your computer first:
ssh -L 18789:127.0.0.1:18789 root@your-server-ip
With the tunnel open, http://127.0.0.1:18789/ in your browser reaches the gateway on the VPS. You can check that it is healthy from the server:
curl -fsS http://127.0.0.1:18789/healthz
This path leaves HTTPS, the domain and the reverse proxy up to you. That is the part the recipe in Option 2 adds on top of the same official image. The full reference is in the OpenClaw Docker documentation.
OpenClaw without Docker
OpenClaw also has its own installer for Linux, which sets it up directly on the system:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon
The steps below assume Option 1 or 2. With the official installs, onboarding asks for the same things (provider and key) in its own wizard.
Connect your AI provider
OpenClaw needs a language model to answer. On the server, run:
openclaw-setup
Choose Anthropic, OpenAI or OpenRouter, paste your key (it is not shown while you type) and the default model of that provider is configured. The fourth option opens OpenClaw’s own wizard for other providers and subscriptions.
The gateway stops for a few seconds while the key is saved and takes about a minute to come back. Running the command again replaces the key; the token and your settings stay.
Open the panel and pair your browser
- Open the address from the welcome message in your browser (
https://your-domain). - Paste the gateway token and click Connect.
- If the panel says “pairing required”, that is normal the first time you use a new browser. Leave the panel open and run this on the server:
openclaw-pair
It lists the pending requests and asks which one to approve. Reload the panel when it finishes.
Lost the token? It is in /opt/openclaw/.env as GATEWAY_TOKEN, and in the message you see every time you log in over SSH.
Connect a channel
Channels are how you talk to the assistant from the apps you already use. On a server installed with Option 1 or 2, the openclaw command runs the OpenClaw CLI inside the container with your token. For Telegram or Discord, with the bot token of that platform:
openclaw channels add --channel telegram --token "<token>"
openclaw channels add --channel discord --token "<token>"
WhatsApp is linked with a QR code:
openclaw channels login
Each channel has its own page in the OpenClaw documentation with how to get the token and what to allow.
Use your own domain
If the server started with the address based on its IP and you now have a domain, create an A record pointing to the IP of the VPS and run:
truobox-domain openclaw.yourdomain.com
The panel moves to the new address and the origin allowed by the gateway is updated with it.
Update OpenClaw and read the logs
To update to the latest image:
cd /opt/openclaw && docker compose pull && docker compose up -d
When the new image starts, OpenClaw checks and migrates its data by itself. Your settings, AI key and token are kept in the Docker volumes.
To follow the gateway logs:
cd /opt/openclaw && docker compose logs -f openclaw-gateway
Other commands worth knowing: openclaw status shows the state of the gateway, openclaw tui opens the terminal interface, and openclaw models set followed by the model name changes the default model.
Frequently asked questions
How much RAM do I need to install OpenClaw?
The recipe asks for at least 2 GB of RAM and 15 GB of free disk. The language model runs at your AI provider, so the VPS only holds the gateway, Docker and your workspace.
Is the OpenClaw Docker install different from the one-command installer?
Both run the same official image. The official setup script leaves the gateway on port 18789 of the server; the one-command installer adds Caddy with HTTPS, a domain and the helper commands around it.
Where are my data and settings?
In Docker volumes on your VPS: one for the OpenClaw configuration and one for the workspace. Updating the image does not touch them.
Can I run the installer again?
Yes. It keeps the gateway token and your OpenClaw settings.
Conclusion
To install OpenClaw on a VPS you need a small server and an AI key. Pick the one-click image if you want it running from the first boot, the one-command installer if you already have a VPS, or the official Docker setup if you want to assemble each piece yourself.
OpenClaw ready from the first boot. Choose a plan, select OpenClaw in the order and log in to add your AI key. See OpenClaw VPS plans ->