Custom domains
A custom domain is a domain you own, such as shop.example.com, that shows one of your sites. Each project also keeps its <project>.leafcloud.app address, and that address keeps working when you add a custom domain.
There are two ways to use a domain. Pick one for each domain:
| You want | Use | Dashboard | CLI |
|---|---|---|---|
One project on its own domain, such as shop.example.com, or example.com with www | A domain for one project | Domains → Add domain → For one project | leaf domains add <domain> --project <name> |
Every project under one domain, such as gallery.example.app for a project called gallery | Project addresses | Domains → Add domain → Give projects their own addresses | leaf domains add <domain> --project-addresses --all-projects |
In the API and in the JSON output of leaf domains, the first kind is single and the second is platform. This guide calls the second one a project-addresses domain.
What you do
Section titled “What you do”- Add the domain, in the dashboard or with the CLI. LeafCloud shows the DNS records to create.
- Create those records at your DNS provider. Records to add lists each one and why it is needed. Provider-specific steps are in DNS providers.
- Wait for the domain to show Live. LeafCloud checks the records for you. Status and checks explains each state.
- Check the limits. If something does not work, see Troubleshooting.
Every address serves HTTPS with a certificate from Let’s Encrypt. LeafCloud issues it and renews it for you. A plain http:// request to one of these addresses is redirected to the same https:// address, with the same path and query; nothing is served over plain HTTP.
Switching a domain between the two kinds
Section titled “Switching a domain between the two kinds”A domain cannot be changed from one kind to the other in place. To switch, remove the domain and add it again as the other kind:
- Remove the domain with
leaf domains remove <domain>, or with the API. Its addresses stop serving at once, so plan the switch for a quiet moment. - Add it again as the other kind, for example
leaf domains add <domain> --project-addresses --all-projects. LeafCloud shows the records for the new kind, and issues a new certificate once they are right. - Update the records at your DNS provider, as described below, then wait for Live with
leaf domains check <domain> --wait.
The records differ by kind:
| A domain for one project | Project addresses | |
|---|---|---|
| Ownership (TXT) | _leafcloud-verify.<domain> | _leafcloud-verify.<domain> |
| Routing (CNAME) | @ and www, each pointing at the target LeafCloud shows for that host | * (wildcard), pointing at the target LeafCloud shows |
| Challenge (CNAME) | one _acme-challenge for each host: _acme-challenge.<domain> and _acme-challenge.www.<domain> | one _acme-challenge.<domain> |
When you switch, the TXT record keeps its name but gets a new value, and the _acme-challenge values are the ones the new domain prints. Use the values from the new domain, not the old ones. Delete the records the new kind does not use, such as www and its _acme-challenge.www record, or an old @ record that points at a project. An explicit record always overrides the * wildcard, so a leftover www or @ record keeps sending those names to the old address.
What custom domains serve
Section titled “What custom domains serve”Custom domains serve static files, which is what leaf deploy produces. Server-side code does not run on a custom domain. See Use with AI agents for the same setup driven by an agent, and Use LeafCloud from AI assistants (MCP) for the MCP tools.
LeafCloud does not publish IP addresses. Point each record at the hostname LeafCloud shows. For a bare domain, use CNAME flattening or ALIAS, so your provider looks up that hostname for you.
Note: Custom domains are available on every account. The number you may add is in Limits.