# Custom domains

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

Serve a Computer's website at your own domain, such as `app.example.com`. Heaven gets and renews the certificate.

## How custom domains work

You connect a domain to your organization once, then assign names under it to Computers. Each name serves its Computer's website, to the same [audience](https://heaven.dev/docs/websites#website-access). DNS points at your [organization's address](#organization-address), so a name can move to another Computer without changing DNS, and it stays when the Computer is renamed.

An organization can connect 50 domains and assign 2,000 names. These limits are a judgment call that stops one organization registering names by mistake in bulk.

## Add a name

To serve one name, such as `app.example.com`, add it to the Computer. In its **Networking** tab, choose **Add domain** and enter the name. If your organization hasn't connected `example.com`, this connects it, and lets each Computer owner add names under it.

From the CLI, check what DNS records the name needs, add them at your DNS provider, then add the name.

```sh
heaven domain check app.example.com --computer my-site
```

A subdomain needs one CNAME. The bare domain, `example.com`, needs the records the check returns, including one that proves you own it.

```sh
heaven domain add my-site app.example.com
heaven domain view my-site
```

If DNS isn't ready yet, Heaven keeps the name and checks again. A name that still fails seven days after its first failed check is removed, so a mistyped name doesn't wait forever. `domain view` shows where each name stands.

Reference: [Check a name's DNS](https://heaven.dev/docs/reference/domains/check), [Add a name to a Computer](https://heaven.dev/docs/reference/domains/add), [List domains and names](https://heaven.dev/docs/reference/domains/view).

## Connect a whole domain

Connect a whole domain when you'll put many names under it, or want to control who can. Admins connect domains, and members can be [granted](https://heaven.dev/docs/access#grants-and-withholds) `domain connect`. In **Settings → Domains**, choose **Add domain** and select **All subdomains**.

```sh
heaven domain connect example.com --organization acme --who platform
```

Add the wildcard CNAME it returns for `*.example.com` at your DNS provider. After that, any name under the domain can be added to a Computer without its own DNS record, and `*.example.com` itself can go to one Computer.

`--who` decides who adds names under the domain: `admins` (the default), `owners` for any Computer's owner on their own Computers, or a team's name. Change it later in the domain's menu or with `domain edit --who`.

Reference: [Connect a domain](https://heaven.dev/docs/reference/domains/connect), [Change who adds names](https://heaven.dev/docs/reference/domains/edit).

## Routing

A name serves the Computer's [website port](https://heaven.dev/docs/websites#website-port) unless you give it another port, with `--port` or **Port** under **Destination**.

```sh
heaven domain add my-site app.example.com --port 8080
```

A path route sends part of a name's traffic to another Computer in the same organization and on the same server. In the dashboard, open the name and choose **Add route**.

```sh
heaven domain add backend app.example.com --path /api --port 8080 --strip-prefix
```

This sends `/api` and everything under it to `backend`, with the prefix removed: `/api/users` arrives as `/users`, with `X-Forwarded-Prefix: /api`. The longest matching path wins, and the Computer that holds the name still decides who can visit.

A redirect sends every visitor to another HTTPS address with a 308, keeping the path and query. It replaces the name's path routes. Choose **Redirect domain** in the name's menu.

```sh
heaven domain add my-site app.example.com --redirect https://example.com
```

Reference: [Add a name to a Computer](https://heaven.dev/docs/reference/domains/add).

## Remove a name

Remove a name from the name's menu in the Computer's **Networking** tab. A `www` redirect Heaven made for a bare domain goes with it.

```sh
heaven domain remove my-site app.example.com
```

Reference: [Remove a name](https://heaven.dev/docs/reference/domains/remove).

## Cloudflare

If the name is proxied by Cloudflare, also add the `_acme-challenge` CNAME that `domain check` returns, set to **DNS only**, so Heaven can get a certificate. Remove any other records at `_acme-challenge`, and set Cloudflare's SSL/TLS mode to **Full (strict)**.

## Certificates

Heaven gets and renews a certificate for each name once its DNS checks out. Until then the dashboard shows **Issuing certificate**.

At most 30 new names under one domain get certificates in seven days, which keeps room for renewals within the certificate authority's limit. For more names than that, [connect the whole domain](#connect-a-domain): its names share one wildcard certificate.

## Organization address

Your DNS records point at your organization's address under `domains.heaven.dev`. Admins can choose its name, such as `acme.domains.heaven.dev`, under **DNS target** in **Settings → Domains**. Old addresses keep working.

```sh
heaven domain address acme --organization acme
```

Reference: [Choose the organization's address](https://heaven.dev/docs/reference/domains/address).

## Disconnect a domain

Disconnecting a domain removes every name under it from its Computers. A subdomain connected separately keeps its names. Admins disconnect domains from the domain's menu in **Settings → Domains**, which shows the names that will go first.

```sh
heaven domain disconnect example.com --organization acme --dry-run
heaven domain disconnect example.com --organization acme --yes
```

Reference: [Disconnect a domain](https://heaven.dev/docs/reference/domains/disconnect).
