How it works

What happens when you publish.

One command, six things. This is the whole platform—there's no hidden second half that needs a dashboard.

01

Upload

The CLI packs the directory you name, or a single HTML file, which it publishes as index.html. Dotfiles and node_modules stay behind, plus anything in a .surgeignore.

Files the domain already has are carried over instead of sent again, so republishing a large project after a small change uploads only what changed.

$ surge ./dist my-app.surge.sh

A project can be up to 450 MB and 10,100 files. The CLI checks before uploading, so an oversized project fails in a second, not after the upload.

02

Revision

Every publish becomes a revision with its own id, a millisecond timestamp. A revision is complete and immutable: the files, the config files (200.html, 404.html, CNAME, AUTH, ROUTER, CORS) and a message if you passed one.

A preview stops here. It gets its own address and production doesn't move.

$ surge ./dist my-app.surge.sh --preview

Preview hosts look like 1785787164375--my-app.surge.sh, or 1785787164375--example--com.surge.sh for a custom domain, and latest--my-app.surge.sh always shows the newest. The domain keeps its last 100 revisions.

03

Cutover

Production is a pointer to one revision. A normal publish moves it to the new revision in one step, so visitors see either the old project or the new one, never a mix.

Moving the pointer doesn't upload anything, which is why rollback is instant.

$ surge my-app.surge.sh revs
$ surge my-app.surge.sh cutover 1785787164375
$ surge my-app.surge.sh rollback

See Revisions for rollfore and discard.

04

The network

Ten regions serve every project: San Francisco, New York, Toronto, London, Amsterdam, Frankfurt, Bangalore, Singapore, Tokyo and Sydney. For surge.sh names, CNAMEs and delegated domains, DNS answers with the region nearest the visitor.

A publish tells every region to drop its cached copy of the domain, so the next request anywhere serves the new revision. The CLI prints each region's status as part of the publish.

sfo.surge.shUS, San Francisco
jfk.surge.shUS, New York
yyz.surge.shCA, Toronto
lhr.surge.shGB, London
ams.surge.shNL, Amsterdam
fra.surge.shDE, Frankfurt
blr.surge.shIN, Bangalore
sgp.surge.shSG, Singapore
nrt.surge.shJP, Tokyo
syd.surge.shAU, Sydney

Live status and uptime for each region: the network page.

05

Domains and certificates

Every project can use a *.surge.sh name, which already has a certificate. For your own domain, point a CNAME at geo.surge.world, add an A record, or delegate the domain to Surge's name servers.

Once the domain points at Surge, a certificate is issued and from then on renewed automatically. Free on every plan.

StatusMeans
waiting on dnsThe domain doesn't point at Surge yet. The CLI shows the records to add.
securingIt points at Surge; the certificate is being issued.
liveServing over HTTPS, checked from the edge.
readyA new account's publish, paused after its first 90 minutes until the email is verified.

Check any domain with surge my-app.surge.sh status. Custom domains has the records.

06

Limits, stated up front

Publishing is rate limited per domain, per account and per address, and the limits are published. A limited publish answers with how long to wait.

Limits apply to publishing only. A project that's live keeps serving; nothing is metered and there are no overage charges.

Per15 minutesDay
Domain30200
Account60500

New accounts publish at half these limits until the email is verified. Need more? Email us.

What Surge doesn't do

Static, on purpose.

Surge serves files. It doesn't run server code, functions, databases or builds, and it won't grow them. If your project needs a backend, host the API elsewhere and publish the front end here.

  • HTML, CSS, JavaScript, images, fonts, video, WebAssembly, JSON
  • Single-page apps, with 200.html for client-side routes
  • Generators: Astro, Eleventy, Hugo, Jekyll, VitePress, Docusaurus
  • CORS headers from a plain file in the project; password protection and redirects on Pro

Try it on something real.

$ npx surge