zode.run, a domain kept apart from zode.dev, so code in a preview cannot set cookies for the console or the API.
Open a port
--public and --password cannot be combined. The port is 1 to 65535. Flags can go before or after the sandbox and port.
web is stopped: zode start web.
List and close
zode ports works too, and close or delete for rm. zode port help prints the usage.
Access
Private
The default. Opening the URL sends the browser to the console, which signs you in if needed and checks that you are a member of the sandbox’s workspace. It then sends you back with a ticket for that one preview, kept in a cookie on the preview’s own host for 12 hours. API keys cannot open a private preview.Password
The browser asks for a user name and password (HTTP basic auth). Any user name works. Zode makes the password, stores only a hash of it, and shows it once. Lost it? Open the port again with--password for a new URL and password.
Public
Anyone with the URL gets through. The URL is hard to guess, but it is not a secret once you share it.What the app sees
- Requests arrive with
Host: localhost:<port>, so dev servers that refuse unknown hosts (Vite, webpack) answer. The real host, scheme and client address are inX-Forwarded-Host,X-Forwarded-ProtoandX-Forwarded-For. - WebSockets and streamed responses pass through, so hot reload works.
- The visitor’s
Authorizationheader (the password is for the preview, not your app) and Zode’s ownzode_previewcookie are removed before the request reaches the sandbox. - A
Domainattribute on a cookie your app sets is removed, so its cookies stay on that preview’s host. - Zode adds none of its own security headers to your app’s responses.
Limits and states
- At most 10 open ports per sandbox (409
limit_reached). - A stopped sandbox is not woken by a visit. The URL answers with a short page saying the sandbox is stopped and that its owner can wake it with
zode startor from the console. - Deleting a sandbox closes its previews.
https://zode.runitself shows what a preview address is made of.
From an agent or the API
- MCP: the
port_opentool takessandbox,portandaccess(private,publicorpassword) and returns the URL, and the password once. See MCP server. - API:
POST /v1/sandboxes/{id}/portswith{"port": 3000, "access": "private"},GET /v1/sandboxes/{id}/portsandDELETE /v1/sandboxes/{id}/ports/{port}. See the API reference.