Skip to content
NebulaCtrldocs
Guides

Add a custom domain

Route a hostname you own to one HTTP or reverse-proxy process of a service, point its DNS at the cluster and get a certificate, or generate a hostname under your organization's base domain in one click. DNS is either yours (manual) or managed in a connected Cloudflare account.

A custom domain sends traffic for one hostname to one process of one service, over HTTPS. This guide adds a domain, points DNS at it, and fixes it when it stays short of Live. To skip choosing a hostname, see Generate a domain in one click.

Before you begin

  • You have the deployer role or higher. A viewer can see domains but not add, check or remove them. See Members and teams.
  • The service has an HTTP or reverse-proxy process. Worker, cron and job processes are not offered. See Processes.
  • The environment is bound to a cluster that has reported an ingress address.
  • The hostname uses lowercase letters, digits, hyphens and dots, up to 253 characters, and each label starts and ends with a letter or a digit. NebulaCtrl lowercases what you type. A wildcard or an underscore is refused with an error that begins hostname must be an RFC 1123 hostname.
  • No other domain in the installation routes the hostname. If one does, the error begins hostname "app.example.com" is already routed.

Add the domain

Connect Cloudflare (optional)

Skip this step to manage DNS yourself and use HTTP-01 certificates. Connect Cloudflare to have NebulaCtrl create the DNS records and issue certificates over DNS-01. An organization has one connection, and deployers and above can create it.

  1. Select Settings, then Integrations. In the DNS group, select Connect on the Cloudflare row.
  2. Paste an API token with Zone > Zone > Read and Zone > DNS > Edit on the zones you want managed. Fill Account ID only for an account-owned token. Only a zone that shows Active in Cloudflare counts, because its nameservers are delegated to Cloudflare. A zone still Pending is invisible to NebulaCtrl: anyone can add any domain to their own Cloudflare account, so seeing a zone says nothing about who controls the domain.
  3. Select Connect Cloudflare.

A toast reads Cloudflare connected and the row shows Connected. If it reads Saved, but Cloudflare could not be verified, the token cannot edit DNS. Fix the token, select Manage, then Verify again.

Open the dialog

Select the service on the canvas, open its Settings tab, scroll to Networking and select Add domain. Enter the Hostname and choose the Process. A service with one eligible process has it preselected. Leave Exposure on Public.

FieldChoicesNotes
Serve throughThis environment's cluster, or another clusterSee Serve a domain through another cluster.
DNSManual, CloudflareCloudflare is disabled until Cloudflare is connected, and preselected once it is. Proxy through Cloudflare keeps the orange cloud on.
CertificateHTTP-01, DNS-01HTTP-01: Traefik in the cluster answers Let's Encrypt on port 80. DNS-01: NebulaCtrl answers through Cloudflare DNS, which works when port 80 is unreachable.

DNS-01 needs a connected Cloudflare account that can see the hostname's active zone, and an agent that can install certificates. Otherwise the option shows why. With Cloudflare DNS, DNS-01 (default) is preselected, because Cloudflare's proxy can block Let's Encrypt's HTTP check.

Submit

Select Add domain. A toast reads Domain added. A card for the hostname appears with a progress row: DNS, Ownership, Certificate, Live. The current step pulses amber.

To add the domain over the API:

curl -X POST "BASE_URL/api/v1/environments/ENVIRONMENT_ID/domains" \
  -H "Authorization: Bearer NEBULA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"app.example.com","serviceId":"SERVICE_ID","processId":"PROCESS_ID","dnsProvider":"cloudflare"}'

BASE_URL is your control plane address and NEBULA_TOKEN an API token. ENVIRONMENT_ID, SERVICE_ID and PROCESS_ID are the ids of the environment, service and process. Over the API, dnsProvider defaults to manual and certificateMethod to http-01, except that a cloudflare domain with no explicit certificateMethod gets dns-01 when that is usable. The call answers 201.

Point DNS at the cluster

With Manual DNS, the card under Add this A record lists the records to create at your DNS provider, with a TTL of 300 seconds. Create one A or AAAA record per address listed, or select Copy records. The card under Add this TXT record gives the ownership record: the name is _nebula. followed by the hostname, and the value starts with nbl-verify=.

With Cloudflare DNS, there is nothing to create. The card shows Managed in Cloudflare, the zone and Last synced. NebulaCtrl also publishes the ownership record in the zone. It does the same for a DNS-01 domain with Manual DNS, where you keep the A and AAAA records.

Check the domain

Select Check now. NebulaCtrl looks up the hostname and the TXT record, and rechecks every public domain every 15 minutes. A toast reports app.example.com points at the cluster or app.example.com is proxied through Cloudflare when the DNS step is done. Otherwise its body says which record to create. A second toast, app.example.com ownership isn't verified yet, gives the TXT record and, while the hostname is still only reserved, the date the reservation ends.

Verify

The status beside the hostname reads Live and all four steps are green. A line under it shows when the certificate renews, for example renews in 62d. Open https://app.example.com in a browser.

Prove you own the hostname

A new domain reserves its hostname for seven days. The reservation becomes permanent when the Ownership step is done: NebulaCtrl found the domain's _nebula TXT record in public DNS. A Cloudflare token that lists the zone does not complete it, whichever DNS and Certificate you chose. With Manual DNS and HTTP-01 you create the record. With Cloudflare DNS, or DNS-01, NebulaCtrl writes it through your token, and the next check finds it once the zone's nameservers point at Cloudflare. If a zone shows Pending in Cloudflare, the record is written but public DNS never serves it, and the step stays open.

When the seven days end without the record, another organization can claim the hostname if it resolves nowhere, or if it publishes the TXT record that the conflict message names for its own environment. A hostname that still resolves to your cluster is never taken from you. The proof, once found, stays even if the record is later removed.

Since 0.42.0, a domain that was exclusive only because its organization's token listed the zone gets 30 days to show the record, counted from the upgrade. It keeps serving throughout. NebulaCtrl publishes and checks the record itself every 15 minutes, so a domain that really sits in your Cloudflare zone proves itself without you doing anything. If the step is still open, the domain's claimExpiresAt over the API gives the date, and the toast under Check now repeats it.

Serve a domain through another cluster

Use this when the environment's cluster is not reachable from the internet. An edge cluster is a connected cluster of your organization with a public address. It forwards the domain's TLS untouched, and the certificate stays on the service's own cluster. See Edge clusters.

  1. In the dialog, open Serve through. If the environment's cluster has no public address, the first usable edge cluster is preselected.
  2. Choose a cluster. A disabled cluster shows why: not connected, no public address, agent too old or needs Cloudflare DNS-01.
  3. Point the hostname at the edge cluster's public address. The card's records list it. The card reads Served through and the cluster name.

A domain served this way always uses DNS-01, so Cloudflare must be connected.

Generate a domain in one click

Use this when you want a working URL without choosing a hostname. An owner or admin sets a base domain once. After that, Generate domain gives any service a URL with no form.

Set the base domain

  1. Select Settings > General. In Generated domains, enter a domain you control in Generated domain base, for example apps.example.com, and select Save base. The field accepts *.apps.example.com too. A base needs at least two labels, at most 189 characters, and cannot be an IP address. A name that cannot work is refused before you save, with what to type instead. Clear the field and select Remove base to turn the feature off.
  2. Create the wildcard record. DNS record lists one A or AAAA record per public address of the cluster, named *.apps.example.com. Select Copy records and create them at your DNS provider, or select Create in Cloudflare when Cloudflare is connected and its token can see the zone. When the record NebulaCtrl created points at an old address, the button reads Update in Cloudflare. NebulaCtrl keeps a record it created pointing at the cluster's current address, and never replaces a wildcard record it did not create.
  3. Prove you own the base. With Cloudflare connected and a token that covers an active zone for the base, NebulaCtrl publishes the TXT record in the zone, and Status > Ownership reads Proved once a check finds it in public DNS, which can take a few minutes. Seeing the zone is not enough. Otherwise it reads Not proved yet: create the TXT record shown there and select Check now. The proof stays once recorded. Status also shows DNS, which tells whether the wildcard resolves to the cluster, and Certificates.

The wildcard points at one cluster: the Default cluster, when it reports a public address, or else the only cluster that does. With several public clusters and no default, DNS record says so. Set Default cluster in the same page.

Two organizations cannot both prove the same base. Changing the base starts a new proof. Domains already generated keep their names and keep working. A base proved before 0.42.0 because the token could see the zone stays proved for 30 days after the upgrade, and NebulaCtrl confirms it with the TXT record on its own. The API reports the date as ownership.confirmBy. If the record is not found by then, the base reads Not proved yet and no new name is generated until you prove it again. An organization that shows the TXT record for the same base takes it over from a proof that was never confirmed.

Generate the domain

Select the service, open its Settings tab, scroll to Networking and select Generate domain. Add domain > Generate does the same from the dialog, once you have picked a service. A toast reads Domain generated and a card with a Generated badge appears with the usual progress row. Under a proved base, Ownership is already done. If DNS is not, the card asks for the wildcard record, not a record for this hostname. The Generate domain button appears only when the organization has a base and the service has no generated domain in the environment. Without a base, the Networking section says "Want a URL in one click?" and links to Set a generated domain base.

The name is SERVICE-ENVIRONMENT.BASE, from the service's and the environment's slugs, for example api-development.apps.example.com. A production environment drops its own name and gets SERVICE.BASE, because production is the address you share. Every other environment keeps its name, so development and staging never take the production hostname. A label longer than 63 characters is cut and given an eight-character hash. If another service already holds the name, a stable six-character suffix is added, and NebulaCtrl tries up to five names. A service has one generated domain per environment. Over the API, a second call returns the existing one with created set to false, and the toast reads "This service already has a generated domain".

Each hostname gets its own certificate. With Cloudflare connected, a token that sees the base's zone and an agent that can install certificates, the certificate is issued over DNS-01. Otherwise Traefik requests an HTTP-01 certificate once DNS points at the cluster. NebulaCtrl does not issue a wildcard certificate.

If the environment runs on a different cluster than the one the wildcard points at, the domain is served through that cluster. That needs DNS-01, so Cloudflare must be connected.

To generate over the API:

curl -X POST "BASE_URL/api/v1/environments/ENVIRONMENT_ID/domains/generate" \
  -H "Authorization: Bearer NEBULA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"serviceId":"SERVICE_ID"}'

processId is optional when the service has one HTTP process, or one named web. The answer holds domain and created, which is false when the service already had one.

When nothing is generated, a toast titled Couldn't generate a domain gives the reason, ending "Nothing was added.":

Message beginsFix
this organization has no generated domain baseSet the base under Settings > General.
apps.example.com is not proved yetCreate the TXT record it names, or connect Cloudflare with a token that covers an active zone for the base, then select Check now.
no domain was generated: No cluster of this organization reports a public ingress address yetAdd a public gateway to a cluster.
this environment has no cluster boundBind a cluster to the environment.
no free generated hostname was foundAdd a domain with a hostname of your own.

Change a domain's settings

Open Actions for HOSTNAME, select Domain settings…, change Exposure, Serve through, DNS, Proxy through Cloudflare or Certificate, and select Save. Save stays disabled until something changes. Switching DNS to Manual removes the records NebulaCtrl created in Cloudflare. Switching Certificate to DNS-01 requests a certificate within a minute.

Fix a domain that is not live

The status beside the hostname names the step that is stuck.

StatusWhat it meansWhat to do
Needs DNSThe hostname does not resolve to the cluster.Create the records under Add this A record and select Check now. With no cluster bound, the card offers a button named Bind plus a cluster name. It needs the admin role.
Publishing DNSCloudflare holds the records and resolvers have not caught up.Wait a few minutes.
DNS sync needs attentionNebulaCtrl could not write the records. The card shows the reason.See the reasons below.
Needs ownership checkPublic DNS does not serve the _nebula TXT record yet.Create it under Add this TXT record and select Check now. With Cloudflare DNS, the card reads Ownership is automatic; if the step stays open, the zone's nameservers are not delegated to Cloudflare, so confirm the zone shows Active there.
Waiting on certificateDNS and ownership are done and no certificate is served yet.See the certificate cases below.

Reasons under DNS sync needs attention:

  • Cloudflare already has 1 record(s) at this hostname that NebulaCtrl doesn't manage (A 203.0.113.7). Delete them in Cloudflare, or adopt them so NebulaCtrl manages them. Delete the records, or select Adopt existing records and confirm.
  • cannot manage DNS: the cluster has reported no ingress addresses yet; DNS will be published once it does, or you can publish it manually. Wait for the cluster to report an address.
  • cannot manage DNS: the cluster reported ADDRESSES, none of which is publicly routable; …. Add a public gateway (Clusters, Add server, Public gateway), serve the domain through a public cluster, or publish DNS manually.

Adopting hands the existing A and AAAA records, and a matching ownership TXT record, to NebulaCtrl. The dialog says it will "keep them pointed at the cluster from now on". The button appears only for the doesn't manage reason.

Certificate cases for an HTTP-01 domain:

  • No certificate issued yet: the cluster serves a placeholder and visitors see an error (Cloudflare shows 526). With Cloudflare DNS, select Issue through Cloudflare DNS instead.
  • No cert resolver on this cluster: the cluster cannot issue HTTP-01 certificates. Switch Certificate to DNS-01 in Domain settings….
  • Waiting for a certificate: select Check now. Issuing can take a minute.

A DNS-01 domain reads Requesting a certificate over DNS-01… while it waits. Certificate request failing shows the error, the attempt count and the next retry. Retries start at 15 minutes, double per attempt and stop doubling at 24 hours. To retry sooner, select Renew now. It is disabled while a request is pending. If the error mentions the token, select Verify again in Settings, Integrations, Manage.

Remove a domain

Removing a domain cannot be undone. Traffic to the hostname stops, and adding it again starts the DNS checks from scratch.

Open Actions for HOSTNAME, select Remove domain, and confirm. A toast reads Domain removed. For a Cloudflare-managed or DNS-01 domain, NebulaCtrl first tries to delete the records it created, including the ownership record. A record Cloudflare refuses to delete stays in the zone until you delete it.

To disconnect Cloudflare, select Manage, then Disconnect. It is refused while a domain uses it: this cloudflare connection is used by 1 domain for managed dns or dns-01 certificates; switch them to manual dns and http-01 first.

Next steps

On this page