# Websites

URL: https://heaven.dev/docs/websites
Updated: 2026-11-22

Every Computer serves a website at its own HTTPS address, such as `https://my-site.heaven.dev`. It's private until you share it: only people with access to the Computer can open it.

## Website access

A website starts **Private**. Its owner can open it to the organization or to everyone, if the organization's [external sharing](https://heaven.dev/docs/access#external-sharing) setting allows **Public**.

| Setting | Audience |
| --- | --- |
| **Private** | People with [access](https://heaven.dev/docs/access#access-levels) to the Computer, and visitors with a [share link](#share-links). |
| **Everyone in acme** (`organization`) | Also every signed-in member of the organization. |
| **Public** | Anyone on the internet. |

Change it in the Computer's **Sharing** tab.

```sh
heaven website my-site --access organization
heaven access my-site
```

Reference: [Set who reaches the website](https://heaven.dev/docs/reference/computers/website), [Read who has access](https://heaven.dev/docs/reference/computers/access).

## Share links

A share link opens a private website for anyone who has it, without a Heaven account. Its owner can create one if the organization's [external sharing](https://heaven.dev/docs/access#external-sharing) setting allows it. In the **Sharing** tab, choose **New link**, and set how long it lasts and how many browsers can use it.

```sh
heaven share link add my-site --expires 1d --max-uses 5
```

Heaven shows the link once. It lasts 30 days unless you set otherwise.

Reference: [Create a share link](https://heaven.dev/docs/reference/computers/share-link-add).

## Revoke a share link

Revoking a link also signs out everyone who opened the website with it. Choose **Revoke** in the link's menu in **Sharing**, or pass its ID, from `heaven access`, to the CLI.

```sh
heaven access my-site
heaven share link remove my-site LINK_ID
```

Reference: [Read who has access](https://heaven.dev/docs/reference/computers/access), [Remove a share link](https://heaven.dev/docs/reference/computers/share-link-remove).

## HTTP and TLS

Heaven handles HTTPS and forwards each request to the app over plain HTTP/1.1, WebSockets included. The app must listen on `0.0.0.0`, not only on `127.0.0.1`. Requests carry `X-Forwarded-Proto: https` and the original host in `X-Forwarded-Host`, for building URLs and redirects.

## Website port

The website serves the port the [image](https://heaven.dev/docs/images) sets, 8000 on the default image. The owner can point it at another port, even while the Computer is stopped: in the **Networking** tab, open the **Website** row's menu and choose **Change port**.

```sh
heaven website my-site --port 8080
```

Use `--port 0` to restore the image's default.

Reference: [Set who reaches the website](https://heaven.dev/docs/reference/computers/website).

## Development ports

Every port from 3000 to 9999 is also served over HTTPS at the Computer's address. A dev server on port 5173 is at `https://my-site.heaven.dev:5173`. Only people with [Site and SSH access](https://heaven.dev/docs/access#access-levels) can open these ports, whatever the website's audience. Port 6080 is the [browser desktop](https://heaven.dev/docs/connecting#desktop). For other protocols, use [SSH port forwarding](https://heaven.dev/docs/connecting#port-forwarding).

## Signed-in visitors

Your app can tell who is visiting from the headers Heaven adds. A visitor who came through a share link without signing in is anonymous.

| Header | When Heaven sends it |
| --- | --- |
| `X-Heaven-User-Id` | The visitor has a Heaven browser session for the site or sends a valid site token. |
| `X-Heaven-Email` | The visitor has a Heaven browser session for the site and a verified primary email address. |

Heaven removes any `X-Heaven-` headers a visitor sends, so the app can trust them on requests that come through Heaven. If the app also takes connections from elsewhere, trust them only on Heaven's.

## Site tokens

A site token lets a program, such as a test runner or a webhook, open one Computer's private website with your access. Create one from the CLI. Heaven shows it once.

```sh
heaven ssh-key add --computer my-site --label preview
```

Send it in the `X-Heaven-Authorization` header, or as the password with any username in a client that only does basic authentication.

```sh
curl https://my-site.heaven.dev/ -H "X-Heaven-Authorization: Bearer $SITE_TOKEN"
```

To revoke it, remove its key in **Settings → SSH & API keys** or with `heaven ssh-key remove KEY_ID`.

Reference: [Add an SSH key](https://heaven.dev/docs/reference/ssh-keys/add), [Remove an SSH key](https://heaven.dev/docs/reference/ssh-keys/remove).
