Services inside a Celesto computer are private by default. This isolation is useful for running agents, notebooks, APIs, and preview apps safely, but it also means you cannot open a browser or send a webhook to a service unless you expose it first.
Port publishing creates a public HTTPS URL that forwards traffic to a port inside the computer, so you can preview, test, and share running services without deploying them elsewhere.
A port is the numbered address a service listens on. For example, a local development server might listen on port 8000.
When to publish a port
Publish a port when you need to:
- Preview an app generated by an agent.
- Share a local API running inside a computer.
- Receive webhooks during a test run.
- Inspect a notebook, dashboard, or development server.
Port publishing is currently available in the Python SDK and CLI. TypeScript projects can use the same CLI commands today.
Publish a service
The following example starts a simple HTTP server on port 8000, publishes the port, prints the public URL, lists published ports, and then removes the published port.
Start a service and publish its port
Start a server inside the computer, publish the port, and open the returned HTTPS URL in your browser.from celesto import Celesto
client = Celesto()
computer = client.computers.create(template_id="coding-agent")
computer_id = computer["id"]
client.computers.exec(computer_id, "python3 -m http.server 8000 &")
published_port = client.computers.publish_port(computer_id)
print(published_port["url"])
published_ports = client.computers.list_published_ports(computer_id)
print(published_ports)
client.computers.unpublish_port(computer_id)
client.computers.delete(computer_id)
The publish command returns a public HTTPS URL that forwards traffic to the service running inside the computer.
Inspect published ports
Use the list command when you need to confirm which ports are currently exposed for a computer.
celesto computer port list einstein
Each published port includes the internal port, the public URL, and its current status.
Published port fields
Port inside the computer that receives forwarded traffic.
Public HTTPS URL for the published service.
Current published-port state.
Clean up published ports
Published URLs are intended for short-lived development and testing workflows. Remove a published port when you no longer need external access to the service.
celesto computer port unpublish einstein
For short-lived previews, unpublish the port before deleting the computer.
Troubleshooting
If the published URL does not load, check that the service is still running inside the computer and listening on the expected port.
celesto computer run einstein "curl -I http://localhost:8000"
If the command fails, restart the service and publish the port again.
Treat published URLs as public. If the service exposes sensitive data or actions, add authentication to the service before sharing the URL.