- Shell 75.7%
- Dockerfile 24.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| defaults | ||
| .gitignore | ||
| build-stats.md | ||
| CHANGELOG.md | ||
| CloudronManifest.json | ||
| CloudronVersions.json | ||
| DESCRIPTION.md | ||
| Dockerfile | ||
| LICENSE | ||
| opencode2-web-logo.png | ||
| POSTINSTALL.md | ||
| README.md | ||
| start.sh | ||
| version.md | ||
OpenCode 2 Web for Cloudron
OpenCode 2 is a client/server AI coding agent. This package runs its shared server behind the Cloudron proxy, so the OpenCode web UI is available on your own domain with sessions, configuration and projects persisted on the Cloudron volume.
This package ships the upstream @opencode/cli 2.3.2 (pinned exactly at build time, see Dockerfile).
Access
- Web UI:
https://<your-app-domain> - You pass two gates: Cloudron
proxyAuth(sign in with your Cloudron account), then the OpenCode sign-in screen (see Server password).
Server password
OpenCode 2 cannot run without a password, and the web UI always asks for it.
- The password is generated once on first start and stored at
/app/data/.config/opencode/env.sh(OPENCODE_PASSWORD). - It is stable: it is never regenerated. A new value would sign every paired browser out, so do not delete or edit that file.
- Read it any time with
opencode service get password, or from the file above. - HTTP clients use Basic auth with the username
opencodeand this password.
Configuration
The easiest way to add a model provider is from the web UI's settings screen, or with opencode auth login in the app's web terminal. Providers can also be set directly in the global config, /app/data/.config/opencode/opencode.json (seeded from the package defaults on first run; your edits are preserved):
{
"providers": {
"anthropic": {
"settings": { "apiKey": "sk-ant-..." }
}
}
}
Anthropic, OpenAI, Google and 70+ providers via models.dev are supported.
- The seeded config uses the OpenCode 2 permission model (
permissions, an ordered list of{action, resource, effect}rules). The last matching rule wins. The defaults ask before running shell commands, ask before touching anything outside/app/data, and allow access within/app/data. See Permissions.
Projects
Projects are directories under /app/data/projects/. Create one, then open it from the web UI:
- Cloudron File Manager — create a folder under the app's data directory in
projects/. - Web terminal —
mkdir -p /app/data/projects/my-project.
The file picker starts at the top level; type projects/ to descend into it.
Connecting the OpenCode desktop app or a CLI (pairing)
OpenCode 2 pairs clients with one-time links (valid for 5 minutes, and the browser session they create lasts 30 days). Because this instance is exposed only through the Cloudron proxy, links must be minted against your public domain:
gosu cloudron:cloudron opencode pair --url "$CLOUDRON_APP_ORIGIN"
Run that in the app's web terminal and open the printed link, or paste it into the desktop app. The link passes through Cloudron proxyAuth first, then signs the browser in to OpenCode.
Note that a pairing link grants a browser session that does not re-ask for the OpenCode password for 30 days; treat a link as a credential.
Storage layout
Everything persistent lives in /app/data and is included in Cloudron backups:
/app/data/
├── .config/opencode/
│ ├── opencode.json # global config
│ ├── service.json # shared-service config (address + password)
│ └── env.sh # our secrets (OPENCODE_PASSWORD)
├── .local/share/opencode/ # session database + logs
├── .local/state/opencode/ # service registration
├── .cache/opencode/ # cache
└── projects/ # your workspaces
Deployment model — single tenant
opencode2-web runs OpenCode's shared server: one server per app instance, serving one workspace. Every Cloudron user who has access to the app shares the same sessions, configuration and /app/data/projects directory. There is no per-user isolation within an instance.
Isolation is at the app-instance level. Install a separate opencode2-web app for each tenant or each workspace that must be kept separate — not a single app for many users.
Documentation
Packaged by @timconsidine https://communityapps.appx.uk (full portfolio: https://myca.appx.uk)