Skip to content

OpenCode

OpenCode is an open source AI coding agent. This service runs the OpenCode web server so you can use it from your browser without a local terminal install.

The Docker image comes from ghcr.io/anomalyco/opencode.

Setup

After enabling and deploying OpenCode, sign in with HTTP basic auth using the HomelabOS credentials:

  • Username: opencode (override with opencode.server_username)
  • Password: your HomelabOS default password (override with opencode.server_password)

Authentication

The server is protected with HTTP basic auth. The password is set via the OPENCODE_SERVER_PASSWORD environment variable. In HomelabOS, this defaults to your instance's default password.

Persistent Sessions

OpenCode sessions persist across container restarts. Session data and state are stored in persistent Docker volumes:

  • /root/.config/opencode - Configuration (including generated opencode.json)
  • /root/.local/share/opencode - Session data and provider auth
  • /root/.local/state/opencode - Runtime state and snapshots

Configuring Providers

Configure LLM providers by placing an opencode.json file in {{ volumes_root }}/opencode/config/. See the OpenCode docs for provider setup. An initial server config is automatically generated during deployment.

Project files are available at {{ volumes_root }}/ (mounted as /workspace in the container).

Access

It is available at https://{% if opencode.domain %}{{ opencode.domain }}{% else %}{{ opencode.subdomain + "." + domain }}{% endif %}/ or http://{% if opencode.domain %}{{ opencode.domain }}{% else %}{{ opencode.subdomain + "." + domain }}{% endif %}/

{% if enable_tor %} It is also available via Tor at http://{{ opencode.subdomain + "." + tor_domain }}/ {% endif %}