Put a Project on Your Own Domain

Custom domains are free on Surge, certificates included and provisioned for you. This is the whole path: from a domain at a registrar to live, with the platform telling you whose move it is at every step.

1. Publish to the domain

Don't wait for DNS—publish first:

surge ./dist example.com

The publish succeeds immediately (your files are on every edge node, ready), and the output reports the domain as waiting on dns along with the exact records to add. That status is the platform's honest answer to "why isn't it up yet?"—and it's the only step that's ever yours.

2. Point the domain at Surge

Two options, compared in depth here:

Delegate to Surge's name servers (recommended)—set these at your registrar:

ns1.surge.world
ns2.surge.world
ns3.surge.world
ns4.surge.world

Delegation turns on geo-aware routing (visitors resolve to the nearest edge node), covers the apex and every subdomain including the wildcard, and lets you manage extra records—mail, verification strings—from the CLI so you never need the registrar's DNS panel again.

Or CNAME at your current provider—point www (and other subdomains) at na-west1.surge.sh, and use your provider's ALIAS/ANAME type for the apex. Right when DNS has to stay where it is; delegation is better when it doesn't.

3. Watch it go live

surge example.com debug status

The domain moves through three states, and only the first is yours: waiting on dns (add the records above) → securing (DNS is right; Surge is provisioning the certificate—no action, no charge) → live (verified by real requests against the actual edge, not a dashboard's optimism). DNS propagation at your registrar is the only wait in the pipeline; Surge is ready the moment the records are.

4. Force HTTPS

Once live, publish with the protocol to redirect all plain-HTTP traffic permanently:

surge ./dist https://example.com

The choice sticks as project configuration. Add --hsts via config if you want browsers to insist.

What you get

www folds into the apex automatically (or vice versa—whichever you publish is canonical). Every subdomain of a delegated domain is publishable as its own independent project—surge ./docs docs.example.com—each with its own revisions and settings. And the certificate renews itself forever; there is no step 5.