Skip to content
Select theme

Deploy

Deploy to Vercel unless you’re already committed to self-hosting. It’s what the live preview uses, needs no adapter configuration, and supports everything the template ships.

Whichever target you use, set DOCS_SITE_URL to your real domain — or edit site in astro.config.mjs — or the sitemap and llms.txt ship with placeholder https://example.com URLs.

TargetLogged-in tierThe one setting that matters
VercelWorks. Adapter picked automatically.Nothing target-specific — see below.
Node (self-hosted, Docker)Works.security.allowedDomains, if sign-in is on — see below.
Netlify, Cloudflare PagesWorks, with their own adapter.Swap the adapter: line in astro.config.mjs — one line, nothing else changes.
Static-only (GitHub Pages, S3, anywhere with no adapter)Cannot run.Remove the logged-in tier first — see below.

Nothing to configure. Vercel’s build sets VERCEL=1, which the template reads to select @astrojs/vercel — the same setup the live preview uses. Import the repository and deploy.

This is the default whenever VERCEL isn’t set — self-hosting, Docker, any other host. After npm run build, run the server yourself:

Terminal window
node ./dist/server/entry.mjs

It listens on port 4321 and binds to localhost. Set PORT to move the port; in a container, also set HOST=0.0.0.0, or nothing outside the container reaches it.

If sign-in is on, also set security.allowedDomains in astro.config.mjs to your domain:

security: {
allowedDomains: [{ hostname: 'docs.example.com', protocol: 'https' }],
},

Leave it unset and Astro treats every request as localhost — direct traffic included, not just requests through a proxy — so your SSO endpoint gets handed a callback URL on the server’s own loopback and sign-in never returns. astro dev uses the real host, which is why this only shows up once you deploy.

Swap the adapter import and the adapter: line in astro.config.mjs for @astrojs/netlify or @astrojs/cloudflare. The auth code is adapter-agnostic, so nothing else changes and the logged-in tier keeps working.

GitHub Pages, S3, or anywhere that just serves files can’t run a server, so the logged-in tier has to go first — see Don’t need private docs? in the template’s README. Skip that and astro.config.mjs still picks an adapter the same way it always does: dist/ exists, but as the parent of dist/client/ and dist/server/, with no dist/index.html at the root for a static host to serve. Once the feature is removed, the adapter goes with it and the flat dist/ with a root dist/index.html returns.

The sitemap can date every page from your git history, which needs the build to see that history. Vercel’s own Git builds can’t, so they leave the dates out. If you turn dates on, see Give your build your git history for each target.