Custom domains
Every app is served on an AppHaven address like
myapp-p123.apphaven.app. You can serve it on your own hostname instead,
such as app.example.com. HTTPS is set up for you.
It takes two steps: prove you own the domain, once per project, and then attach a hostname to an app.
1. Verify the domain
Open Project settings and find the Domains card.
- Choose Add domain and enter the domain itself, without
https://or a path. Forapp.example.com, addexample.com. - The card shows a TXT record with a Name and a Value. Create it with
your DNS provider. The name is
_apphaven-verification.example.comand the value starts withapphaven-verification=. - Wait for the badge to turn Verified. AppHaven checks on its own; use Check now if you want an immediate answer.
Many DNS providers add the domain to whatever you type in the name field. If
yours does, enter the relative name the card shows underneath the record,
_apphaven-verification, or you will end up with
_apphaven-verification.example.com.example.com.
Leave the TXT record in place. AppHaven re-checks it regularly, and removing it un-verifies the domain.
Once the domain is verified, every hostname at or below it is available to
every app in the project. app.example.com, admin.example.com and
example.com itself all come with the one record.
2. Attach a hostname to your app
Open the app, go to Settings, and find the Custom domain card.
- Enter the hostname you want, for example
app.example.com. - Choose Add hostname. The card now shows the DNS record to create.
- Create that record with your DNS provider. It is a
CNAMEpointing at the app's AppHaven address, which the card gives you in full.
If your provider offers a proxy or CDN in front of the record, such as Cloudflare's orange cloud, turn it off. The record has to resolve to AppHaven for the certificate to be issued and renewed.
Watching it go live
The card shows where the hostname has got to:
| Status | Meaning |
|---|---|
| Pending | Waiting for your DNS record to point at AppHaven. |
| Configured | Traffic is routed. The HTTPS certificate is being issued. |
| Live | The certificate is in place and the hostname is serving. |
| Error | The card explains what went wrong. |
Going from Pending to Live usually takes a few minutes, most of it DNS propagation. Certificates are issued by Let's Encrypt and renewed automatically.
Your app keeps answering on its AppHaven address the whole time. At Live the custom hostname takes over: it becomes the URL shown in the console, in the CLI and on the consumer dashboard, and it is the address your app's login returns to if the app is protected by access control.
Removing a hostname
Use Remove on the Custom domain card. The status goes to Releasing while the change rolls out, and the app returns to its AppHaven address. You can then delete the DNS record with your provider.
Removing the verified domain in Project settings is a separate step, and frees one of the project's domain slots. Remove the hostnames under it from their apps first: a domain that still has one attached cannot be removed.
Limits
| Verified domains per project | 3 |
| Custom hostnames per app | 1 |
| Domain verification attempts | 5 per 24 hours |
| Check now | once every 30 seconds per domain |
Custom hostnames are subdomains, like app.example.com. To serve an app on a
bare domain such as example.com, contact support.
Where to go next
- Access control: who can reach the app on its new hostname.
- Preview deployments: previews keep their own AppHaven address.
- Connecting GitHub: the push that deploys what the hostname serves.