OpenCode on a cloud server: install, serve, connect
As of 2026-10-20, you can install OpenCode on a QCode cloud server, keep it running with opencode serve, and call models with your QCode key. Cloud servers and AI services are sold separately; they share only the account and the balance.
Updated 2026-10-20
Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.
- Billed per token — live rates on /models
- Pay by card (Visa / Mastercard / AMEX), Apple Pay, Google Pay or crypto
- Self-service: top up and activate instantly
Four deployment points
Headless HTTP server
The official server docs: opencode serve runs a headless HTTP server that exposes an OpenAPI endpoint; the default port is 4096 and the default hostname is 127.0.0.1.
Full root access
A QCode cloud server is a KVM host with a dedicated public IPv4 and full root access; you administer the system and the data.
Trial length
A trial lasts 1 day (24 hours) and is charged for the size you pick; during the trial you can keep it for 1, 3, 6, or 12 months from the panel, otherwise the server is deleted at the end and the data is not kept.
Optional at order time
When ordering you can add an SSH public key and tick "Key login only (turn off root password login)". There is no web console yet: if you lose the private key, the only way back in is reinstalling the system, which erases its data.
What you can run on the server
To run OpenCode on a QCode cloud server, order a KVM host with root access, install OpenCode with the official script, put the QCode endpoints in opencode.json, and run opencode serve inside tmux. A QCode cloud server is an overseas machine sold on its own, with a dedicated public IPv4; it is a separate product from the AI service, and the two share only the account and the balance. The QCode docs list Hong Kong, Japan, Korea, the United States, and Germany, with one or more lines per region.
What the official pages say
The official OpenCode server docs (opencode.ai/docs/server, part of the OpenCode 1 documentation) say opencode serve is a headless HTTP server; the default port is 4096 and the default hostname is 127.0.0.1, and you can change them with --hostname and --port. Setting OPENCODE_SERVER_PASSWORD enables HTTP basic auth; the username defaults to opencode. The QCode docs OpenCode page shows the QCode endpoints in ~/.config/opencode/opencode.json.
Timeline
The QCode OpenCode docs page was verified on 2026-10-20 and now has an OpenCode 2 section.
The npm package @opencode/cli for OpenCode 2 published version 2.1.0. opencode.ai/docs remains the OpenCode 1 documentation; the OpenCode 2 documentation is at opencode.ai/v2/docs.
The QCode cloud server docs and the Cloud page were checked on 2026-10-20: you can upgrade the size online, each server has up to 3 snapshots, and the order page accepts optional SSH public keys.
Confirmed vs not verified
Confirmed (verbatim in the official pages)
QCode cloud servers: an overseas machine sold on its own, KVM, full root, 1 dedicated public IPv4 per server (assigned when ready, not changeable), Hong Kong, Japan, Korea, the United States, and Germany, a 1-day (24-hour) paid trial, conversion to 1, 3, 6, or 12 months during the trial, online size upgrades, and up to 3 snapshots per server. OpenCode: opencode serve is a headless HTTP server, default 127.0.0.1:4096, and OPENCODE_SERVER_PASSWORD enables basic auth; the official OpenCode 1 install script is curl -fsSL https://opencode.ai/install.
Unverified and not published by the vendor
A GitHub user reports (#56668, opened 2026-10-18 against Desktop 2.0.32, still open on 2026-10-20) that on desktop the first SSH connection to a new remote server can spend several minutes downloading or uploading the remote OpenCode server while the dialog only shows Connecting over SSH…, so it looks frozen. This is a user report, not an official conclusion.
Two ways to run it
opencode serve
A headless HTTP service for other clients or scripts. It listens only on 127.0.0.1 by default; for remote access, change the address with --hostname and protect it with OPENCODE_SERVER_PASSWORD.
Local TUI
The official server docs say running opencode starts both a TUI and a server, with the TUI as the client that talks to the server; opencode serve starts a standalone server.
Deployment steps
① Order a QCode cloud server: pick the region, line, size, system, and term; for a trial, pick 1 day. The network step always includes 1 dedicated public IPv4; the root password step has an optional field for an SSH public key. ② After delivery, log in with ssh root@SERVER_IP; the root password is the one you set at order time. ③ Install OpenCode with the official install page: curl -fsSL https://opencode.ai/install | bash. The official page presents this script as the way to install OpenCode 1; the QCode docs say the provider / options.baseURL configuration on its OpenCode page works in both OpenCode 1 and OpenCode 2. OpenCode 2 has a different install command, and the two cannot be installed side by side under the default command (see the last FAQ). ④ Write the QCode endpoints in ~/.config/opencode/opencode.json and save the key with opencode auth login. ⑤ Keep it running in tmux: tmux new -s opencode, run OPENCODE_SERVER_PASSWORD=your-password opencode serve (it listens only on 127.0.0.1:4096 by default), press Ctrl+B then D to detach, and use tmux attach -t opencode to return.
Connecting OpenCode to QCode
QCode's documented OpenCode setup: the config file is ~/.config/opencode/opencode.json; set the Anthropic provider baseURL to https://api.qcode.cc/claude/v1 and the OpenAI provider to https://api.qcode.cc/openai/v1. Write the key with opencode auth login or /connect; OpenCode 1 saves it in ~/.local/share/opencode/auth.json, and OpenCode 2 uses SQLite and imports the old auth.json. Enable API direct access first: it is disabled by default, and you contact online support or email hi@qcode.cc to have it activated for your purchased API key. Billing is per token, with per-model rates on /models. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 to 90 days. If you already have a Personal Plan, add a booster pack when you need more quota.
Frequently asked questions
How do I install OpenCode on the cloud server?
Use the script on the official OpenCode install page: curl -fsSL https://opencode.ai/install | bash. The official page presents it as the way to install OpenCode 1. OpenCode 2 uses a different install command; see the last question below.
Does opencode serve stop when SSH disconnects?
If you run it in the foreground, it ends with the connection. The QCode docs describe keeping tasks in tmux (their example session is named agent; any name works, and opencode is used here): tmux new -s opencode creates a session, run opencode serve, press Ctrl+B then D to detach, and use tmux attach -t opencode to return. tmux sessions survive an accidental disconnect or detaching.
How do I make OpenCode call models with a QCode key?
Follow the QCode docs: write ~/.config/opencode/opencode.json with https://api.qcode.cc/claude/v1 as the Anthropic provider baseURL and https://api.qcode.cc/openai/v1 as the OpenAI provider baseURL. Write the key with opencode auth login or /connect; OpenCode 1 saves it in ~/.local/share/opencode/auth.json, and OpenCode 2 uses SQLite and imports the old auth.json. Enable API direct access first.
Do I have to buy an AI plan together with the cloud server?
No. The QCode docs say cloud servers and AI services are sold separately and share only the account and the balance, and running Claude Code or Codex on the box does not mean you have to buy an AI plan. To have OpenCode call QCode models you use your QCode key; the model side is billed per token, with per-model rates on /models.
Can I upgrade the cloud server or change its line?
You can upgrade the size online: on the server's Actions tab, pick a larger plan and pay the difference up to the expiry date; it takes effect at once, the server restarts once, and the expiry date stays the same. Downgrades and moving to another region or line are not available; order another server for a different line. A trial has to be converted to a monthly plan first.
Should I install OpenCode 1 or OpenCode 2 on the server?
It depends on which documentation you follow. opencode.ai/docs, including its server page, is the OpenCode 1 documentation, and curl -fsSL https://opencode.ai/install installs OpenCode 1. The OpenCode 2 documentation is at opencode.ai/v2/docs and its install script is curl -fsSL https://opencode.ai/v2/install | bash. Both use the opencode command and cannot be installed side by side under the default command; the OpenCode 2 curl installer replaces the V1 binary. The opencode.json example for QCode is on the QCode OpenCode page (verified 2026-10-20); per the QCode docs, its provider / options.baseURL configuration works in both OpenCode 1 and OpenCode 2.
Sources
QCode cloud server docs (captured 2026-10-20; regions, trial, upgrades, snapshots, SSH keys); QCode Cloud page (captured 2026-10-20); QCode cloud billing docs (captured 2026-10-20); QCode cloud server agents docs (captured 2026-10-20; tmux and interface languages); OpenCode official server and install docs (captured 2026-10-20); QCode OpenCode page and Pay-as-you-go page (captured 2026-10-20).
Put OpenCode on an always-on machine
Cloud server starting prices and lines are on qcode.cc/en/cloud; the cloud server interface is currently available in Chinese and English only.
Related reading
Claude Code Pay-as-you-go Packs: No Subscription, 7–90 Days
Buy quota once and use it within 7–90 days, no subscription; extra packs add to the same key.
OpenCode session sharing removed (1.19.1) and the 2 upgrade
What changed with session sharing and the move to OpenCode 2.
OpenCode 2026: 200K+ Stars, Open-Source AI Coding Agent
What OpenCode is, how to install it, multi-agent and BYOK use, and setup on QCode.
Crypto payment guide
Nine coins, 56 networks, zero platform fee for AI coding API credits.
Cloud server details on this page were checked on 2026-10-20 against qcode.cc/cloud and docs.qcode.cc; OpenCode details were checked on 2026-10-20 against the official install page and server docs; model availability and rates follow /models. Official changes are not announced separately.