The first install takes 4 to 5 minutes, most of it the image push.
Before you start
Check Requirements. You need:
- Node 22.18 or later.
- Docker, running.
- A Cloudflare account on Workers Paid.
- A terminal.
Install
Get the CLI
npm install -g oc-workersThis puts
ochoston your PATH. If root owns your global npm folder, it can needsudo. Check withochost --version.Log in to Cloudflare
npx wrangler loginSelect Allow in the browser that opens. On a machine with no browser, wrangler prints a URL: open it on another machine, then select Allow.
Run init
mkdir ~/my-oc && cd ~/my-oc ochost initinitasks for no AI token, because the model runs on your account through the Worker’s Workers AI binding.Once the install is up,
initasks two questions. Press Enter to skip either one:- Telegram: paste the bot token from @BotFather (see Add Telegram).
- Cloudflare Access: a hostname on your zone, such as
oc.example.com.
Alerts to your phone are optional;
ochost alerts setupadds them later.For a script or a rerun, the same answers work as flags:
ochost init --telegram-owner <id> --telegram-token-file <file> --sandbox on --alerts ntfy --access-domain oc.example.com.Open the Control UI
At the end,
initprints a summary:UI https://oc-host.<your-subdomain>.workers.dev Login https://oc-host.<your-subdomain>.workers.dev/_ochost/login/… (single use, 5 min; ochost open makes another) Bot none yet Model @cf/deepseek-ai/deepseek-v4.1-flash-1017 via gateway default Mode sleeps after 5 min idle, wakes on a message Cost about $7-14/month at light use (up to $25 if snapshot storage is priced high); always-on would be $50-69Open the Login link. It sets the owner cookie, which tells the install that this browser is yours, and shows the owner console. Select Open Control UI to reach the OpenClaw Control UI.
The link works once and expires after 5 minutes. If it has expired, run
ochost openfor a new one.
The owner console
The owner console is the page at your install URL. A state card at the top shows the state, the last activity, the next wake, the projected cost for the month and the check count, with one state button: Wake now, Sleep now, Start or Retry now. Below it, three tabs hold Overview (cost, alerts, budgets, checks and backups), Alerts and log, and Setup (things to connect). See How it works.
Prompts from init
Most runs show one prompt or none.
| Prompt | When | Do this |
|---|---|---|
Cloudflare account [1-N] |
Your login has several accounts. | Type a number, or pass --account-id. |
Press Enter when R2 is on |
R2 is off. | Enable R2 at the dashboard link, then press Enter. |
| workers.dev subdomain name | The account has no workers.dev subdomain. | Type a name. |
With --non-interactive, or with no terminal, init asks nothing. When it needs an answer, it stops with a fix line.
The model
The container holds no Cloudflare credential: the Worker calls Workers AI through a binding (see Models), and it sends model calls through the AI Gateway default. Cloudflare makes default on the first request, so init makes no API call for it. After the deploy, init sends one test message to the model.
- To use a gateway you made, run
ochost init --gateway <id>. The gateway must exist. - To use no gateway, run
ochost init --gateway none. Model calls still work, but with no logs and no spend limit.
What init does
init prints one line for each of its 14 steps: preflight, account, subdomain, files, AI model, secrets, R2 bucket, deploy, health, model hop, config, start, self-test and login. The deploy step takes longest.
If init stops
Rerun ochost init in the same directory. A rerun is safe: it skips what is already current.
If a stop leaves the deploy part-way done, you see a Failed: line with a fix and no summary, and a rerun finishes the deploy. If the image push keeps failing, run ochost deploy; the CLI keeps the layers it already pushed. See Troubleshooting.
A rerun can wake a sleeping install, and it redeploys when the deploy hash changed.
Add Telegram
- In Telegram, open a chat with @BotFather, Telegram’s own bot for making bots.
- Send
/newbotand follow the steps. BotFather gives you a bot token. - Run
ochost channels add telegramand paste the token. The input is hidden. (initoffers this step; if you took it, skip to 4.) - In Telegram, open your bot and send it a text message.
- The bot replies with a pairing code. Run
ochost pairing approve telegram <code>.
A webhook channel lets the install sleep. A socket channel keeps it awake and costs about five times more. See Channels.
Next
- Run
ochost statusto see the sleep state, the next wake and the cost. - Run
ochost doctorto run health checks. Each check comes with a fix. - Run
ochost alerts setupto choose where alerts go. Alerts are off by default. - Read Channels next.