Self-hosting
Agents' computers
Every agent works on a computer of its own: a sandbox container that OpenClaw makes on the Gateway's machine, one per agent per space. Agents use it to run code and make things: decks, documents, spreadsheets, charts, and tabs for a space. This page is for workspace owners and the people who run deployments. It covers what the computer is, what owners can change in Settings → Gateway → Computers, and what differs between kinds of Gateway.
What a computer is
| Part | What it is |
|---|---|
| Its folder | /workspace: the agent's own folder for that space. It's kept when the sandbox is made again; everything else isn't. |
| Its user | An ordinary user (sandbox, uid 1000). The system disk is read-only and every Linux capability is dropped, unless an owner turns on system installs. |
| Its tools | Python, Node.js, Claude Code, office libraries and the kit for building tabs, in our sandbox image: see What comes with it. |
| Its network | The internet, unless the deployment (AGENT_SANDBOX_INTERNET=false) or an owner turns it off. Agents need it to save files to Files, send tabs and use Claude Code. |
| Its life | OpenClaw makes it when the agent first works in a space, makes it again when its settings change (once it's idle), and removes it after a day without use. |
Installs that should last go in the agent's folder: in our image, pip install, npm install -g and downloaded programs land in /workspace/.local, which is on the PATH.
What comes with it
Our sandbox image (deploy/openclaw/Dockerfile.sandbox, and the same inside the machine image) comes with what agents need to make real things, pinned so every computer is the same:
| What | Version | For |
|---|---|---|
| Python | 3.11 (Debian 12's) | Scripts, data, documents |
| Office and charts | python-pptx 1.0.2, python-docx 1.1.2, openpyxl 3.1.5, reportlab 4.2.5, matplotlib 3.9.2, pandas 2.2.3 | Decks, Word documents, spreadsheets, PDFs, charts and tables |
| Node.js | 24.22.0, with npm | JavaScript, and building tabs |
| Claude Code | 2.1.319 | Bigger coding work, by agents or by you in a terminal: see Claude Code |
| The kit for tabs | /opt/tands/apps: a guide and a React 19 and Vite starter, its packages installed | Building tabs and Home pages that work offline: see Building tabs |
| Everyday tools | bash, git, curl, jq, ripgrep, xz | Fetching, searching and versioning |
| Fonts | DejaVu and Liberation | Documents and charts that look right |
Anything else can be added: by the agent in its folder, by your setup script on every computer, or with system installs.

Which Gateway, what's offered
A workspace's agents run on one of these:
- The deployment's shared Gateway, which the deployment offers to one workspace at a time.
- "Managed for you": a Gateway the deployment runs for the workspace alone, through the Gateway Manager (on Fly.io, a machine of its own).
- Its own Gateway: one the workspace brings, connected with its address and token. It may run our Gateway image (
deploy/openclaw) or OpenClaw's own.
| Shared | Managed for you | Own, our images | Own, OpenClaw's images | |
|---|---|---|---|---|
| Setup script | Yes | Yes | Yes | Yes |
| System installs | No* | Yes | Yes | Yes |
| Claude Code | Yes | Yes | Yes | With the kit |
| Terminals | No* | Yes | Once an owner sets its terminal address | No |
| Building tabs | Yes | Yes | Yes | With the kit |
| Browsers | Yes† | Yes | Where OpenClaw and Docker share a machine | No: our plugin is in our images |
Why the shared Gateway has neither system installs nor terminals by default: its agents' sandboxes may run on a Docker the deployment uses for other things (with Docker Compose, the server's own). A person with a shell, or an agent running as root, is then a risk beyond that workspace. On a Gateway of the workspace's own, any damage stays inside that workspace.
* Unless the deployment allows it. Only one workspace uses the shared Gateway at a time. Where it runs on a machine of its own (as on Fly.io), a deployment admin can give that workspace what a Gateway of its own has, in Deployment settings → Allow terminals, system installs, Ollama and own model keys on the shared Gateway: system installs, terminals, a computer's Ollama and its own model keys (see Running → Models). Terminals also need the API to know where the shared Gateway's terminal server is: OPENCLAW_GATEWAY_TERMINAL_URL, for example http://gateway:18788 with Docker Compose or http://<its Fly app>.internal:18788 on Fly.io. Commands on the shared Gateway's server itself are a separate setting, Let agents on the shared Gateway run commands on its server, as that server is the deployment's. When the workspace leaves the shared Gateway, or the setting is turned off, its keys, Ollama and host allowlists are taken off it.
† Where it's a machine of its own (its own features or not). OpenClaw reaches an agent's browser at 127.0.0.1 on the port Docker publishes for it, so OpenClaw and the Docker that runs the browser must be on the same machine. That's true of Gateway machines (the Gateway Manager's, and the shared Gateway on Fly.io), but not of a Gateway container using the server's Docker, as the shared one is with Docker Compose, unless it runs from our machine image, which runs its own Docker (--privileged under Compose; deploy/docker-compose.dev-machine.yml does this for development): set OPENCLAW_GATEWAY_OWN_DOCKER=true and browsers are offered there too. Watching agents' browsers on the shared Gateway needs only its terminal server's address (OPENCLAW_GATEWAY_TERMINAL_URL), not its terminals turned on.
Why OpenClaw's own images lack some of this: these features rely on files in our images. Terminals rely on our terminal server in the Gateway image; Claude Code and the tab-building kit rely on our sandbox image. OpenClaw offers no way to open a shell in a sandbox through its API, so nothing we can send through the Gateway fills that gap.
Setup scripts
An owner writes one shell script for the whole workspace (Settings → Gateway → Computers). Each agent's computer runs it once, when the computer is made: put there what should always be installed.
- It runs as the computer's user, or as root with system installs, under
bashwhere there is one. - It runs for at most 3 minutes and can be up to 20,000 characters long.
- Its output goes to
/workspace/.tabs-and-spaces/setup.logon each computer, and an agent can read it for you. - A script that fails is logged and never stops an agent from working: the setup always ends successfully.
- A changed script reaches a computer the next time it's made, after a few idle minutes. There's no "apply now".
- Anything it downloads needs the computer's internet access.
The script is kept when the workspace moves to another Gateway.
System installs
On a Gateway of the workspace's own, an owner can let agents' computers run as root with a writable system disk, so apt-get install works. Their computers keep only the Linux capabilities apt and dpkg need: CHOWN, DAC_OVERRIDE, FOWNER, SETUID and SETGID. A safety check on the Gateway page fails if any agent runs privileged without this setting. Programs installed this way last until the computer is made again, so put them in the setup script.
Browsers
An owner can give each agent a browser of its own (Settings → Gateway → Computers → Browsers), for pages that need clicking, typing or forms. Agents still read ordinary pages with their web tools, which are quicker; the browser is for the rest.
- Its own container. Each agent's browser is Chromium in a container beside its computer (OpenClaw's sandbox browser, from
deploy/openclaw/browser), on OpenClaw's own Docker network for browsers. Agents' computers keep their image: the browser's image (about 1 GB) is fetched by the Gateway the first time one of its agents has a browser, which takes about a minute. An agent that tries to browse before then is told to try again shortly. - Kept to the public web. It never opens private addresses (OpenClaw resolves every name and refuses private ones, on every redirect), never the host's browser or network, and agents can't run scripts of their own in pages. A safety check on the Gateway page fails if any of that is changed by hand. Agents are told never to type passwords or card details, and to ask before buying, signing up, posting or submitting anything that matters.
- Stopped when idle. A browser stops once its agent hasn't worked for 10 minutes (
TAS_BROWSER_IDLE_MINUTESon the Gateway), as each holds a Chromium's memory (a few hundred MB); it starts again the next time the agent browses. - It needs the internet: offline computers have no browser.
- Without code mode. An agent with a browser calls OpenClaw's tools directly rather than from code, since browser pages returned to code are withheld from the model.
Clicking and typing: a go-ahead first
Our plugin in the Gateway (tas-browser, in our images) asks the workspace before every one of an agent's browser calls, signed with the workspace's key. Opening and reading pages always goes ahead. Clicking, typing, filling in, selecting, uploading and answering dialogs need a go-ahead where the workspace asks first, which is the default (Settings → Gateway → Computers → Clicking and typing):
- The agent says which site and exactly what it'll do; that's a card under its answer, for the person who asked.
- Once they approve it, the agent may act in its browser in that space for 20 minutes. On a task, the task carries on; in a conversation, tell it to.
- Freely lets agents act without asking (they're still told to ask before buying, signing up or posting).
- If the workspace can't be reached, nothing but reading happens. Without our plugin on the Gateway (OpenClaw's own images), the safety check fails and agents stop, as they do for any other check.
What each agent opens and does in its browser shows as steps on its answer ("Opened example.com/book", "Clicked and typed on example.com/book").
Sign-ins
An agent's browser stays signed in where someone signed it in (by taking it over), between runs, until its browser is made again: when OpenClaw changes its settings, or after 24 hours unused (sandbox.prune). Sign out of everything, at the foot of its browser panel for those who may take it over, removes it at once: its next browser starts with nothing. Signing out is on the audit trail.
Watching and taking over
Anyone in a space can watch an agent's browser there: on the agent's card (click its name or a mention of it), Browser opens it beside the conversation, live, while you keep talking. Watching never touches the page: the API drops whatever your keyboard and mouse would send before it reaches the browser, and ends the view if it sees anything it can't read for sure.
Owners, and the people they chose for terminals, can Take over: then the keyboard and mouse are theirs, to sign in, answer a CAPTCHA or confirm something only a person should. Give back when you're done. Taking over, and giving back, are on the audit trail; watching isn't. Agents know they can ask: when a page needs a person, they leave it open and ask you to take over.
When the agent isn't browsing, the panel says so and shows its browser as soon as it is. The view travels through the Gateway's terminal server (port 18788, as terminals do), so it's offered where terminals are: on Gateways the deployment runs for the workspace, the shared one where it's a Fly.io machine, and a brought one once its terminal address is set.
Claude Code
Every computer made from our sandbox image comes with Claude Code 2.1.319, Anthropic's coding agent, installed. With Claude Code on (Settings → Gateway → Computers), agents use it for bigger coding work: claude -p "…" in their folder. You can use it too: open a terminal on the agent's computer and run claude.

- No key on the computer. Claude Code reaches Anthropic through the deployment's API. Each computer gets only the API's address and a token for that one agent; the API adds the key. Turning Claude Code off ends every token.
- Whose key. The workspace's own Anthropic key if an owner saved one (Settings → Gateway → Models; it's never shown again, and on a Gateway the deployment runs for the workspace alone its agents use it too), otherwise the deployment's: set
ANTHROPIC_API_KEYfor the API. - Budgets. Its tokens count toward each agent's monthly budget, as "Coding" on the agent's Usage page, whether the agent or a person in a terminal ran it. When the deployment's key is used, they also count on the workspace's AI meter.
- It needs the internet, and the
claudeprogram on the computer. Our sandbox image has Claude Code 2.1.319. On another image, install it with the kit (--claude-code).
Terminals
Owners, and the people they choose, open a terminal on an agent's computer from the agent's page (Settings → Agents → the agent → Terminal). They pick one of their spaces where the agent has worked, and get a shell in its folder, as the computer's own user.
- Who. Owners always. Owners also tick which members and admins may (Settings → Gateway → Computers → Terminals). Never guests, and only in spaces the person is in.
- Recorded. The audit log has when each terminal opened and closed, and each line typed. A line recalled or changed with the arrow keys is marked
[from history]or[edited]: the log has what was typed, not what ran, and Tab completions aren't known. The terminal says it's recorded. - Closing. A terminal closes after 30 minutes without typing. Closing it hangs up the shell, and whatever it was running.
- No computer yet. If the agent hasn't worked in that space, or its computer was removed after a day idle, there's nothing to open until it works there again.
- Read-only workspaces can't open terminals.
How it reaches the computer: the browser asks the API for a one-time ticket, valid for a minute, and opens a WebSocket with it. The API checks the person and relays the terminal to the Gateway's terminal server (deploy/openclaw/shell-server.mjs, in both of our Gateway images, on port 18788). The terminal server accepts only the Gateway's own token. It opens a shell (docker exec) only in that Gateway's own agents' sandboxes, which it finds by their folder, so on a shared Docker host other workspaces' sandboxes are out of its reach.
On a Gateway the workspace brings
A Gateway the workspace brings has no Gateway Manager to tell the API where its terminal server is, so an owner says where:
- Run our Gateway image. OpenClaw's own has no terminal server.
- Open port 18788 to the deployment's API, as port 18789 already is. Nothing else needs it.
- In Settings → Gateway → Computers, enter the Terminal address, for example
https://gateway.example.com:18788. The API checks that a terminal server answers there (/healthz) before saving it.
The address can be removed at any time, which turns terminals off. The audit log records that the address changed, without the address itself.
Building tabs
Agents make tabs for a space, and the workspace's Home page: pages with no server that read the workspace through the SDK. Small ones they write directly. Bigger ones (several screens, a framework, pictures or fonts) they build on their computer from a React and Vite starter, check, and send as a .zip. Either way, the person who asked sees a preview and approves it. See Tabs agents build, and the App builder agent in the marketplace, which does this for you.
On our sandbox image, the guide and starter are at /opt/tands/apps, with Node.js 24.
The kit for other images
A Gateway the workspace brings may run another sandbox image, without Claude Code, the guide and starter, or a recent Node.js. Agents there are told to install the kit once:
curl -fsS https://your-deployment.example.com/api/agent-kit/install.sh | shAdd -s -- --claude-code to install Claude Code too. The kit:
- puts everything in
/workspace/.tands, the agent's own folder, so it's kept; - installs Node.js 24.22.0 in
/workspace/.tands/node, checked against its published checksum, only if the computer's own Node.js is older than 20.19; - installs the guide and the starter, with the starter's packages, so later builds work offline;
- puts
node,npm,npxandclaudein/workspace/.tands/bin, which agents put first on theirPATH.
To have it on every computer from the start, put the same line in the workspace's setup script.
The address is the one the computers reach the API at: AGENT_UPLOAD_URL, or PUBLIC_URL. The installer and the kit hold nothing of anyone's, so they're public.
What the image needs: sh, curl, tar and gzip; python3 (or sha256sum) for the checksum; and python3 to send a built tab (its upload command zips with Python's zipfile). The computer needs internet access, as sending a tab does anyway.
Settings for deployments
| Setting | What it does |
|---|---|
AGENT_SANDBOX_INTERNET | false keeps every agent's computer offline. Then nothing can be saved from them or sent from them, and Claude Code is off. |
AGENT_UPLOAD_URL | Where computers reach the API, for uploads, Claude Code and the kit (default PUBLIC_URL). |
ANTHROPIC_API_KEY | The deployment's key for Claude Code, used where a workspace hasn't saved its own. |
AGENT_BROWSER | false: no agent has a browser on this deployment. Otherwise owners choose, where it's offered. |
AGENT_BROWSER_IMAGE | The browser's image (default ours for the Gateways' OpenClaw version, from GitHub's registry). Upgrade it with OpenClaw. |
Upgrading: our sandbox and Gateway images change with these features. Rebuild them (deploy/openclaw/Dockerfile.sandbox, Dockerfile.gateway, Dockerfile.gateway-machine). On Fly.io, deploy the Gateway machine image under the same OpenClaw version tag: the Gateway Manager notices the tag points to a new image and moves each Gateway onto it, one asleep when it next wakes, one kept awake once nobody has used it for its idle time (15 minutes by default), so no agent's work is cut short. Each machine imports its new sandbox when it starts and removes the old sandboxes. The agents' folders are kept. With Docker, the same happens when the image's name points to a newly built image.