Skip to content
New: Customize your theme with an AI assistant. Read the guide

Deployment Guide

npm run build makes a static site in the dist/ folder, which any static host can serve. Settings are included for Netlify, Vercel, and Cloudflare Pages. To use another host, see Astro’s deployment guides.

Before You Deploy

Set your site’s address in baseUrl under [site] in src/config/config.toml. It ships as https://example.com, and npm run build warns while it is still that. Canonical links, the sitemap, robots.txt, llms.txt, and social previews use it. SITE_URL is an environment variable that overrides baseUrl for a build.

Use the Node.js version listed under engines in your edition’s package.json: 22.12.0 or later for Astro, 22 (22.22.0 or later) or 24 for Tina, and 22.23.4 or later for Sanity.

Then go through this list:

  • Business info: [settings.contactInfo] in config.toml, and your links in src/config/social.json.
  • Forms: contactFormAction and contactFormProvider for the contact form, and formAction in [settings.subscription] for the Mailchimp form. Both ship with placeholders. The contact form shows a warning when submitted with its placeholder, and nothing warns you about the Mailchimp one.
  • Analytics: add your tags to content in [head] in config.toml.
  • Sample content: replace the sample prices, reviews, figures, team members, services, projects, blog posts, and photos, and the figures in the Case Studies menu card.
  • Identity: title in [site]. The default meta description is common.siteDescription and the tagline added to page titles is common.tagline, both in src/i18n/<lang>.json, one per language.
  • Legal pages: replace the placeholder privacy policy and terms in src/content/pages/<language>/. components.mdx in the same folder is a sample of what the components look like, so delete it and its menu items if you don’t want it on your site.
  • Branding: logo, favicons, colors, and fonts. See Site Identity & Logo and Fonts & Colors.

In the Tina edition, most of these are in /admin/, and the legal pages are under Other pages. In the Sanity edition, they are in the Studio, under Site settings, Interface labels, and Other pages, in every language.

Netlify

The included netlify.toml sets the build command (npm run build), the dist folder, Node.js 22, cache headers, and a “page not found” rule for French and Arabic.

  1. Create a new site on Netlify.
  2. Connect your Git repository.
  3. Netlify reads its settings from netlify.toml and deploys your site.

When you add a language with npm run generate-multilingual-content, the script adds that language’s “page not found” rule to netlify.toml, in all three editions. See Internationalization.

Vercel

The included vercel.json sets the trailing slash, the sitemap redirect, the headers for the AI files, and the build command, sh vercel.sh. That script runs npm run build with SITE_URL set to your Vercel project’s address. On production builds, a SITE_URL you set in the project’s settings wins.

  1. Create a new project on Vercel.
  2. Connect your Git repository.
  3. Vercel reads its settings from vercel.json and deploys your site.

Cloudflare Pages

  1. Create a new project on Cloudflare Pages.
  2. Connect your Git repository.
  3. Set the build command to npm run build and the output folder to dist.
  4. Set the Node.js version with a NODE_VERSION environment variable, using your edition’s version from the list above.

The included wrangler.toml names the project techbyte-astro, so change its name to your project if you deploy with Wrangler.

Headers And Missing Pages

The included public/_headers, vercel.json, and public/.htaccess serve the .md and llms files as text, and keep the .md copies out of search results. On any other host, set the same headers yourself. See AI Links & llms.

Only netlify.toml includes a “page not found” rule for each language. On other hosts, a missing /fr/ or /ar/ address may show the default language’s 404 page unless you add a rule.

Tina Edition

The site builds and works with no account and no variables. With none, /admin/ on the live site is a short page saying online editing is off. To edit online, add PUBLIC_TINA_CLIENT_ID and TINA_TOKEN to your host. See Tina.

Sanity Edition

Give your host PUBLIC_SANITY_PROJECT_ID, PUBLIC_SANITY_DATASET, and PUBLIC_SANITY_STUDIO_URL. Without a project ID, the site builds from the bundled demo content. The site must rebuild to show content you publish. In this edition, set your site’s address under Site settings > Site > Base URL. See Sanity.

Type something to search...