Custom domains
Serve a Computer's website at your own domain, such as app.example.com. Heaven gets and renews the certificate.
On this page
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. DNS points at your organization's 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.
heaven domain check app.example.com --computer my-siteA subdomain needs one CNAME. The bare domain, example.com, needs the records the check returns, including one that proves you own it.
heaven domain add my-site app.example.com
heaven domain view my-siteIf 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, Add a name to a Computer, List domains and names.
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 domain connect. In Settings → Domains, choose Add domain and select All subdomains.
heaven domain connect example.com --organization acme --who platformAdd 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, Change who adds names.
Routing
#A name serves the Computer's website port unless you give it another port, with --port or Port under Destination.
heaven domain add my-site app.example.com --port 8080A 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.
heaven domain add backend app.example.com --path /api --port 8080 --strip-prefixThis 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.
heaven domain add my-site app.example.com --redirect https://example.comReference: Add a name to a Computer.
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.
heaven domain remove my-site app.example.comReference: Remove a name.
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: 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.
heaven domain address acme --organization acmeReference: Choose the organization's 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.
heaven domain disconnect example.com --organization acme --dry-run
heaven domain disconnect example.com --organization acme --yesReference: Disconnect a domain.