Deploy a static site
pages hosts static sites: anything that builds to a folder of HTML, CSS and JavaScript (Vite, Astro,
Next.js export, Hugo, plain files). Every upload is a deploy with its own address; aliases give
stable names.
Deploy a folder
Build your site, then from its directory:
xvii pages deploy
Without an argument the CLI looks for dist, build, out or public. It packs the folder, uploads it
and prints the deploy's address, https://<id>.pages.xvii.network, where <id> is eight hex characters
such as 3f9a2b1c.
Deploys are immutable. Each one lives for the server's default lifetime (two weeks unless the admin
changed it) and then cleans itself up.
Give it a name
xvii pages deploy dist --name my-site
prints a second address, https://my-site.pages.xvii.network. An alias always points at one deploy;
deploying again with the same name moves it and keeps the old deploy in its history. Deploys an alias
points at are never cleaned up.
Roll back
xvii pages rollback my-site
moves the alias back to its previous deploy. Nothing is rebuilt: rolling back is moving a pointer.
Useful flags
| Flag |
Does |
--ttl 3d |
lifetime: 12h, 3d, 2w or never |
--keep |
never clean this deploy up |
--spa |
serve index.html for unknown paths (client-side routers) |
--password PASS |
ask visitors for a password |
--qr |
print a QR code, to open it on a phone |
--watch |
deploy again on every change, until Ctrl-C |
--team SLUG, --project ID |
where the deploy belongs |
Redirects, headers and 404
pages reads _redirects and _headers in the Netlify / Cloudflare Pages format from the root of the
folder, and serves 404.html for missing paths:
/blog/* /posts/:splat 301
/api/* https://api.example.com/:splat 200
/assets/*
Cache-Control: public, max-age=31536000, immutable
A custom domain
xvii pages domains my-site add www.example.com
prints the DNS records to create (a TXT record proving ownership and a CNAME). Once they exist:
xvii pages domains my-site check www.example.com
The certificate is issued on the first visit. If the domain's DNS is in the domains service, attaching
it there does all of this in one step: see Custom domains.
Next