Skip to content

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 wantUseDashboardCLI
One project on its own domain, such as shop.example.com, or example.com with wwwA domain for one projectDomains → Add domain → For one projectleaf domains add <domain> --project <name>
Every project under one domain, such as gallery.example.app for a project called galleryProject addressesDomains → Add domain → Give projects their own addressesleaf 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.

  1. Add the domain, in the dashboard or with the CLI. LeafCloud shows the DNS records to create.
  2. 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.
  3. Wait for the domain to show Live. LeafCloud checks the records for you. Status and checks explains each state.
  4. 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.

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:

  1. 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.
  2. 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.
  3. 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 projectProject 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.

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.