# Publish a computer on an HTTPS URL

> Make a program on a computer reachable at an https address, and change its ports later

> Nevia is in beta and open to selected teams. Public launch in Dec 2026. The CLI installs with `curl -fsSL https://get.nevia.cloud | sh`, and the MCP server is at https://api.nevia.cloud/mcp. A person signs in once in the browser.
> Setup, sign-in and requesting access: [SKILL.md](https://nevia.cloud/SKILL.md). When Nevia fits and when it doesn't: [why.md](https://nevia.cloud/why.md).

> For the complete documentation index, see [llms.txt](https://nevia.cloud/llms.txt). This page's HTML version: https://nevia.cloud/docs/computers/publish

Publish a program on a computer at an `https` address, then change its ports when you
need to.

## Before you start

You need:

* A [computer](https://nevia.cloud/docs/computers/create.md) in `ready` state.
* A program inside the computer that listens on the target port, such as `8080`.
* The [CLI installed and signed in](https://nevia.cloud/docs/get-started/quickstart.md), with a
  [selected workspace](https://nevia.cloud/docs/workspaces/select.md) where you have the admin or editor role.

The examples use the computer `demo`.

## Publish at creation

```bash
nevia new demo -p 443:8080
```

`443:8080` publishes port 443, which serves the bare address, and forwards it to port
8080 inside the computer. Start the program before you test the URL. While nothing
listens on the target port, the URL answers `503`.

## Publish or change later

`nevia set` replaces the whole list of ports:

```bash
nevia set demo -p 443:8080
```

Clear all HTTPS ports with `none`:

```bash
nevia set demo -p none
```

A port change briefly interrupts open connections. Programs keep running.

## Use HTTP/2 to the workload

Append `/h2` when the program speaks plaintext HTTP/2 (h2c), such as gRPC:

```bash
nevia set demo -p 443:50051/h2
```

The platform terminates TLS in both cases. Without `/h2`, the workload receives HTTP/1.1.

## Publish several ports

Separate mappings with commas, or repeat `-p`:

```bash
nevia set demo -p 443:8080,8443:9000
```

Each published port must be unique in the list. [Computer ports and URLs](https://nevia.cloud/docs/reference/computer-ports-and-urls.md)
lists the allowed ports and mapping limits.

## Use the CLI, MCP, or console

### CLI

Use the commands above. [`nevia new`](https://nevia.cloud/docs/reference/cli/new.md) and
[`nevia set`](https://nevia.cloud/docs/reference/cli/set.md) document every flag.

### MCP

`create_computer` and `update_computer` take a `ports` list. Each entry has
`published`, `target`, and an optional `protocol` (`http1` by default, or `http2`):

```json
{
  "workspace": "<workspace>",
  "name": "demo",
  "ports": [
    { "published": 443, "target": 8080 },
    { "published": 8443, "target": 50051, "protocol": "http2" }
  ]
}
```

`update_computer` replaces the whole list. Send `"ports": []` to remove HTTPS, or leave
`ports` out to keep the current list.

To change one mapping, read the current list, edit it, and send every mapping you want
to keep. Mappings you leave out are removed.

```json
{
  "computer": "<computer>",
  "ports": [
    { "published": 443, "target": 8081 }
  ]
}
```

### Console

The computer's detail page shows one public endpoint, the 443 mapping. Use the toggle to
turn it on or off, and set its target port and protocol (HTTP/1.1 or h2c).

Mappings on other ports, added with the CLI or MCP, stay in place but the console does
not show them.

## Verify the result

```bash
nevia status demo
```

The output lists the mapping and the computer's `url`. Open the URL in a browser to see
your program's response. A `503` means nothing listens on the target port. Start the
program and reload.

## Constraints

* Ports change only while the computer is `ready`. A sleeping or transitioning computer
  returns `409 invalid_state`. [Wake it first](https://nevia.cloud/docs/computers/lifecycle.md).
* A sleeping computer keeps its URL but does not answer.
* Branching or restoring a checkpoint keeps the port mappings but not the running
  programs. The new computer gets a new URL, and its ports answer `503` until a program
  listens again.
* Anyone with the address can reach the published port. Nevia adds no authentication.
* A port with no listener answers `503`.

[Computer ports and URLs](https://nevia.cloud/docs/reference/computer-ports-and-urls.md) has the allowed ports,
URL rules and mapping limits. [Computer lifecycle states](https://nevia.cloud/docs/reference/computer-lifecycle.md)
shows what survives each transition. [MCP reference](https://nevia.cloud/docs/reference/mcp.md#computers)
covers the tool inputs.
