Custom domain setup for a DeepSpace app: DNS records, CNAME and the SSL certificate
Put a deployed DeepSpace app on the person's own domain: connect a domain they own with the TXT and CNAME records the CLI returns (DeepSpace creates and renews the SSL certificate), or buy one through DeepSpace with Stripe Checkout, and what needs the person.
On this page
Yes, a deployed DeepSpace app can be served at the person's own web address, and the DeepSpace CLI does the setup. There are two ways:
- A domain they already own: the CLI returns DNS records, the person (or you, with their DNS access) adds them at their DNS provider, and DeepSpace verifies them, creates the SSL certificate and renews it. The records are TXT records for ownership and a CNAME for routing, not an A record.
- A domain bought through DeepSpace:
npx deepspace app domain buyopens a Stripe Checkout page; once the person pays, DeepSpace handles registration, DNS and SSL.
Either way, the person has to do one thing you can't: give access to their DNS settings, or pay for the domain. The app's canonical address stays <app-name>.app.space; DeepSpace commands that take an app URL, such as deepspace agent, accept only that one.
Version: written for deepspace@0.43.0 (changelog). Docs checked: October 29, 2026. The domain commands were not run for this page, because attaching needs a real domain and buying spends money. The steps follow the custom domains guide.
Questions to ask the person#
These need no technical knowledge to answer, and each answer maps to a choice below.
- Do you already own the web address you want? If yes, use the first flow; if not, the second.
- Which exact address:
example.com,www.example.com, or something likeapp.example.com? Each hostname is connected separately. - Where did you buy the domain, and who can sign in there? The DNS records are added in that account.
- If buying: which name, and are you comfortable with the price and with automatic yearly renewal? Renewal is on by default and charges the saved card.
- Which DeepSpace account owns the app? Domain commands act for that account. Confirm with your user before running them.
Connect a domain the person already owns#
Run these from the app's checkout, or pass the app's id (from wrangler.toml) with --app. The id is the stable choice, because a domain binds to the app's id, not its name.
npx deepspace@latest app domain attach example.com --external --app <app-id> --json
The result includes a TXT record tied to the account and this app. Add it at the domain's DNS provider exactly as returned, then verify:
npx deepspace@latest app domain verify example.com --app <app-id> --json
Once ownership is proven, DeepSpace creates the certificate and verify returns the remaining records: a routing CNAME pointing at a DeepSpace target, and sometimes a second ownership TXT record. Add those, then run verify again until the hostname and certificate are active. Finally, open https://example.com and check that it serves the app.
What to know about the records:
| Record | What it does | Keep it? |
|---|---|---|
Ownership TXT (from attach) |
Proves the person controls the domain, for this account and app | Until the domain is verified; the DNS proof is specific to the target app |
Routing CNAME (from verify) |
Sends the hostname's traffic to DeepSpace | Yes, always pointing at the target the command returned |
Second ownership TXT (sometimes, from verify) |
Completes ownership for routing | Yes |
- No A record is involved. Routing uses a CNAME.
- A root domain (
example.com) needs CNAME flattening at the DNS provider; Cloudflare DNS supports it. If the provider can't, connect a subdomain such aswww.example.comorapp.example.cominstead. wwwis a separate hostname. Either attach and verify it too, or set a redirect fromwwwto the root in the DNS provider's settings.- The certificate renews itself. Since SDK v0.33.1, new attachments use automatic HTTP validation, so no
_acme-challengerecord is needed. An older attachment that returned a certificate CNAME needs that record kept as DNS-only for renewal. - The registration stays where it is. Purchase and renewal remain at the person's registrar.
Adding records changes the person's DNS, so confirm with your user before you add them with their access, or send them the exact records to add themselves.
Or buy a new domain through DeepSpace#
npx deepspace app domain search my-startup
npx deepspace app domain buy my-startup.com --app <app-id>
search shows available names and prices. buy opens Stripe Checkout in the browser, and the person pays there; with --app, the domain is attached to the app as part of the purchase. Buying spends real money and turns on auto-renew, so get the person's explicit approval first, and never pass --yes without it. After payment the CLI waits while the domain is set up:
| Domains | Registrar | Typical setup time |
|---|---|---|
.com, .dev, .app and about two dozen others |
Cloudflare Registrar | About 60 to 90 seconds |
.ai, .io, .me, .co and country domains |
Porkbun | 15 to 60 minutes |
Pressing Ctrl-C stops the waiting without losing progress; check later with npx deepspace app domain status my-startup.com. In a script, --no-wait returns right after Checkout is created, and --no-open prints the Checkout link instead of opening it. The price is the registrar's cost × 1.3, plus a $1 fee, and renewals charge the saved card automatically.
Check and manage a domain#
npx deepspace app domain list
npx deepspace app domain status example.com --json
npx deepspace app domain renew my-startup.com --auto off
npx deepspace app domain detach example.com --yes
statusshows the registrar status, hostname status, expiry and any errors.listandstatusinclude verified external domains.renew --auto offlets a domain bought through DeepSpace expire at the end of its term;--auto onturns renewal back on.detachstops routing and removes DeepSpace's certificate, but keeps the registration. For an external domain, remove the DeepSpace DNS records yourself afterwards.- To move a domain to another app, run
attachwith that app's id. For an external domain, detach it first and repeat the flow, because the DNS proof changes with the target app. - Renaming the app doesn't affect the domain; it follows the app's id.
Common failures and how to fix them#
| What you see | Cause | Fix |
|---|---|---|
No app specified. Pass --app <name>, or run from an app directory with a wrangler.toml. |
Run outside the app's checkout without --app |
Pass --app <app-id> |
verify keeps reporting it isn't active |
A record is missing or hasn't reached DNS yet | Compare the records at the DNS provider with the command's output, then run verify again |
| The DNS provider won't accept a CNAME on the root domain | The provider doesn't do CNAME flattening | Connect www or another subdomain, or use a DNS provider that flattens, such as Cloudflare DNS |
example.com works but www.example.com doesn't |
www is a separate hostname |
Attach and verify www too, or redirect it to the root |
| A certificate stops renewing on an older attachment | Its certificate CNAME is proxied | Set that record to DNS-only |
deepspace agent tools https://example.com is refused |
Commands that take an app URL accept only the *.app.space address |
Use the app's name or https://<app-name>.app.space |
buy seems to hang |
It is waiting for payment and setup, up to 5 minutes or 60 minutes depending on the domain | Let it run, Ctrl-C and check status later, or use --no-wait; don't wrap it in timeout |
| A premium domain costs more at renewal | Introductory pricing can reset | Read registrationCost and renewalCost in domain status before buying |
What to tell the person when the domain is live#
- The new address:
https://example.com, with a working certificate. - Records to keep: the routing CNAME and any ownership TXT at their DNS provider. Deleting them takes the address offline.
- Who renews what: a domain they already owned renews at their registrar as before. A domain bought through DeepSpace renews automatically on their saved card, and they can see it at dashboard.deep.space.
- The original address:
<app-name>.app.spacestays the app's canonical address, and developer tools use it. - To stop using it: detach it, then remove the DeepSpace records. Their registration stays theirs.
What is available today, and what is planned#
Available today, in published deepspace@0.43.0:
app domain attach --externalandverifyfor domains bought elsewhere, with certificates created and renewed by DeepSpaceapp domain searchandbuythrough Cloudflare Registrar or Porkbun, paid with Stripe Checkoutlist,status,renew,detach, and re-pointing a domain to another app- HTTPS on every app's
<app-name>.app.spaceaddress
Buying a domain is a payment, so it needs the person.
In testing on staging, not production: agent accounts that register themselves by solving a math challenge. Production signup for agents is not enabled.
Planned: autonomous agent accounts in production. Under that plan, payments and legal actions will still require a human, so the person will still pay for a domain. See DeepSpace for agents.
Setting up domains for a business? See deep.space/enterprise.