Exposed Services
Your project rarely lives alone. CloudLink can publish a loopback service — a dev server, API, dashboard, or preview build — through the same tunnel as OpenCode, or with OpenCode disabled entirely. Services are disabled and private until you explicitly enable and share them.
Before you expose a service
Section titled “Before you expose a service”- The service must listen on loopback (
127.0.0.1or::1) on an unprivileged port from 1024 to 65535. - The target cannot use port 80 or 443, a CloudLink service port, the connector’s proxy port, or OpenCode’s managed port range.
- Hostnames, RFC1918 addresses, link-local addresses, and cloud metadata addresses are rejected.
- The service should be one you trust. A public service is reachable by anyone with its managed share link.
How addresses work
Section titled “How addresses work”OpenCode stays on the main tunnel URL. Each service is served on one of Cloudflare’s supported HTTPS ports:
8443, 2053, 2083, 2087, 2096
No extra DNS record, certificate, or tunnel ingress is needed. Every port reaches the same tunnel hostname, and the connector routes by port.
Root service
Section titled “Root service”Leave Path empty to let the service own the port root:
https://m-7f3a91c2.opencodecloud.link:8443/Use a root service for applications that emit absolute URLs such as
/assets/app.js. A root service owns its port.
Path service
Section titled “Path service”Set a path prefix to share a port with other path services:
https://m-7f3a91c2.opencodecloud.link:8443/my-app/Path matching uses the raw encoded path. Relative and percent-encoded
separators are rejected before routing. By default the matched prefix is
stripped before forwarding; Keep path prefix forwards the full path instead.
The connector also sets X-Forwarded-Prefix and re-prefixes path-absolute
redirects.
Add a service
Section titled “Add a service”- Open Settings → Services.
- Choose Add service.
- Fill in the fields.
- Save. Changes apply live; you do not need to restart the tunnel.
- Enable the service.
- Use Probe to confirm the local target is reachable.
- Use Copy URL or Open after connecting.
Field reference
Section titled “Field reference”| Field | Meaning |
|---|---|
| Name | Display name in the list and sidebar |
| ID | Identifier used in the service URL |
| Port | Public HTTPS port from the supported list |
| Path | Optional prefix. Empty means the service owns the port root. |
| Target | Loopback address, for example 127.0.0.1:3000 |
| Enabled | Serve the service through the tunnel |
| Access mode | Private, public link, or password protected |
| Password | Visitor password for password-protected mode, 8–128 characters |
| Expiration | 15 minutes, 1 hour, 24 hours, a custom duration up to 366 days, or none |
| Keep path prefix | Forward the matched path unchanged instead of stripping it |
New services start with Enabled off and Access mode set to Private.
Access modes
Section titled “Access modes”| Mode | Who can open it |
|---|---|
| Private | A paired device or the connector’s browser credential |
| Public link | Anyone with the managed share link |
| Password protected | Anyone with the share link plus the visitor password |
A managed share link contains a token. Apply the access settings to create or
replace the link. Password hashes use Argon2id and stay in the protected local
state file; visitor sessions are signed HTTP-only cookies bound to the service and
policy revision. The connector enforces the policy on every request and on
established WebSocket and streaming connections. Every service response is
no-store, so Cloudflare cannot cache past revocation or across service ports.
Revoking sharing, changing the password, disabling the service, or deleting the machine ends access. See Share a local app with clients for the client handoff.
Separate origin from OpenCode
Section titled “Separate origin from OpenCode”Services never share the OpenCode origin. OpenCode’s /, /api, /global,
and /auth paths cannot be shadowed by a service. This keeps OpenCode browser
credentials and storage away from service content.
Manage from the desktop, phone, or CLI
Section titled “Manage from the desktop, phone, or CLI”The tray’s Services tab configures the service, access mode, password, expiry,
share link, and revocation. A paired device can also manage services from
OpenCode Mobile’s Settings → Cloud Link → Exposed services through the
device-authenticated /_cloudlink API. The browser credential cannot use that
API, and it is never served on a service port.
The browser account console manages the account, subscription, machines, and pairing activation; service routes are local connector configuration.
The CLI requires the connector to be stopped because it holds the installation lock:
opencode-cloudlink services list
opencode-cloudlink services add web \ --target 127.0.0.1:3000 \ --port 8443 \ --enable
opencode-cloudlink services add api \ --target 127.0.0.1:8080 \ --path /api \ --enable
opencode-cloudlink services disable webopencode-cloudlink services enable webopencode-cloudlink services remove apiSee CLI reference for all service options.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
| Service will not save | Target must be loopback; ID, port, and path must be valid and unique |
| Service shows unreachable | The local app is stopped, bound elsewhere, or using the wrong port |
| URL returns authentication | The service is private; use CloudLink credentials |
| Public link returns authentication | Confirm the access mode is saved and the link includes its share token |
| Password page rejects the visitor | Confirm the current password was saved; it is never shown after storage |
| Assets or redirects break | Try a root service, or enable Keep path prefix |
| Port is rejected | Choose 8443, 2053, 2083, 2087, or 2096 |
| Path is rejected | Do not use the reserved /_cloudlink prefix |
| Changes do not apply | Recheck the saved service, then probe again |
See Security and privacy for the exposure model.
CloudLink (OpenCode Cloud Link) is an independent product. It is not built by the OpenCode team, is not endorsed by them, and is not affiliated with them in any way. See thePrivacy Policy andTerms & Conditions.