# Deployment

## Deployment & Launch

Kivo builds a static site into `dist/`, so it runs on any static host, in all three [editions](../features/editions/). It ships ready-made settings for **Netlify** (`netlify.toml`), **Vercel** (`vercel.json`, `vercel.sh`), and **Cloudflare Pages** (`wrangler.toml`).

| Setting           | Value                   |
| ----------------- | ----------------------- |
| Build command     | `npm run build`         |
| Output directory  | `dist`                  |
| Node.js version   | 22.12.0 or later. The Tina edition needs Node 22 or 24 |
| Package manager   | npm (`package-lock.json`) |

### Edition Variables
The Astro edition needs no environment variables. `SITE_URL` is an optional environment variable that overrides `baseUrl` for a build.

- **Tina edition:** the site builds with none. For online editing, set `PUBLIC_TINA_CLIENT_ID` and `TINA_TOKEN` on your host. See [Tina](../features/tina/).
- **Sanity edition:** set `PUBLIC_SANITY_PROJECT_ID`, `PUBLIC_SANITY_DATASET`, and `PUBLIC_SANITY_STUDIO_URL` on your host. Don't set `SANITY_API_READ_TOKEN` or `SANITY_VISUAL_EDITING` there. In this edition, the settings in the list below are under **Site settings** in the Studio. See [Sanity](../features/sanity/).

### Before You Launch
Go through this list once. Each item links to the page that explains it.

- [ ] `[site] baseUrl` is your real address, not the shipped `https://example.com` placeholder, and `npm run build` shows no `[site]` warning ([SEO & AI Visibility](/kivo/customization/seo-ai-visibility/))
- [ ] Site name, logo, favicon, and colors are yours ([Quick Start](/kivo/getting-started/quick-start/))
- [ ] The contact form and the newsletter post to your own accounts ([Forms](/kivo/customization/forms/))
- [ ] The log-in and sign-up screens post to your app (`form.action` in `src/content/auth/`), or are deleted
- [ ] `docsUrl` points to your documentation, and `[settings.contactInfo]` has your phone, email, and address
- [ ] `[settings.layoutSwitcher] enable = false` (the default)
- [ ] In `src/i18n/<language>.json`, `site.tagline` and `site.description` are set for each other language, and `ai.siteSummary` describes your product
- [ ] The **Pages** demo menu is hidden, and no menu link points to `#` ([Menus](/kivo/customization/menus/))
- [ ] Demo pages you don't need are deleted, for example the demo homepages, `/components/`, `/elements/`, and `/status/` if you don't run a status page ([Pages](/kivo/customization/pages/))
- [ ] Demo content is replaced: features, customers, team, careers, blog, changelog, integrations, testimonials. The sample job roles are deleted or replaced with real openings ([Collections](/kivo/customization/collections/))
- [ ] The privacy policy, terms, and cookie policy are reviewed for your business, and their placeholder notices removed
- [ ] Social links in `src/config/social.json` are yours
- [ ] Analytics scripts are in `[head]`, gated on consent if the cookie banner is on ([Cookies & Analytics](/kivo/customization/cookies-analytics/))
- [ ] `npm run astro-check` and `npm run build` finish without errors, and you have looked at the section, contact, FAQ, and pricing pages you changed (`astro-check` doesn't check those files)

### Deploy
<Tabs>
  <TabItem label="Netlify">

    <Steps>

    1. Push your project to GitHub, GitLab, or Bitbucket.
    2. In Netlify, choose **Add new site → Import an existing project** and pick the repository.
    3. Netlify reads `netlify.toml`: build command `npm run build`, publish folder `dist`, Node.js 22. Click **Deploy**.

    </Steps>

    The build uses `baseUrl` from `config.toml` unless you add a `SITE_URL` environment variable in the Netlify site settings.

    `netlify.toml` also sets long-term caching for `/_astro/*` and `/images/*`, and sends missing `/fr/...` and `/ar/...` URLs to that language's 404 page. The language script doesn't change this file, so add a block by hand for each language you add.

    Using Netlify Forms? Set `contactFormProvider = "netlify"` and `contactFormAction = "/"`, enable form detection under **Forms**, and redeploy.

  </TabItem>
  <TabItem label="Vercel">

    <Steps>

    1. Push your project to GitHub, GitLab, or Bitbucket.
    2. In Vercel, choose **Add New → Project** and import the repository. Framework preset: **Astro**.
    3. Vercel reads `vercel.json`, which builds with `sh vercel.sh`. Click **Deploy**.

    </Steps>

    `vercel.sh` sets the site address (`SITE_URL`) for each build, and on Vercel it replaces `baseUrl`:

    - Production builds use the `SITE_URL` environment variable if you set one in the Vercel project settings. Otherwise they use your Vercel production domain. Set `SITE_URL` (for example `https://www.acme.dev`) when you want one exact address, such as the `www` or the bare domain.
    - Preview builds use `https://staging.<your production domain>`.

    Edit `vercel.sh` if you want something else.

    `vercel.json` also enables trailing slashes, redirects `/sitemap.xml` to `/sitemap-index.xml`, and serves the `.md` and `llms` files as text.

  </TabItem>
  <TabItem label="Cloudflare Pages">

    **From git:** in the Cloudflare dashboard, open **Workers & Pages → Create → Pages → Connect to Git**, pick the repository, and set the build command to `npm run build` and the output directory to `dist` (the same folder as `pages_build_output_dir` in `wrangler.toml`).

    The included `wrangler.toml` already sets `NODE_VERSION = "22.13.1"` under `[vars]`. Cloudflare treats this file as the source of truth for the settings in it and shows them read-only in the dashboard, so change them in the file. Set your address with `baseUrl` in `config.toml`.

    **From your computer:** Kivo doesn't install Wrangler (Cloudflare's command-line tool) for you. Add it once, change `name` in `wrangler.toml` to your project name, then log in, build, and deploy:

    ```bash
    npm install -D wrangler
    npx wrangler login
    npm run build
    npm run deploy:cf
    ```

    `public/_headers` serves the `.md` and `llms` files as text on Cloudflare Pages and Netlify.

  </TabItem>
  <TabItem label="Other hosts">

    Run `npm run build` and upload the **contents** of `dist/` to your web server or static host (GitHub Pages, S3, a shared host, and so on).

    For Apache servers, `public/.htaccess` (copied into `dist/`) sets browser caching for CSS, JavaScript, images, and fonts, and serves the `.md` copies as Markdown with `X-Robots-Tag: noindex`.

  </TabItem>
</Tabs>

<Aside type="note">
  When a host builds from your repository, commit `package-lock.json` and keep
  `dist/`, `.astro/`, and `node_modules/` out of git (the included `.gitignore`
  already does).
</Aside>

### After You Launch
<Steps>

1. Open the live site and click through the main pages, in light and dark mode, on a phone.
2. Send a test message through the contact form, and sign up for the newsletter once.
3. Test search (⌘K or Ctrl+K).
4. Submit `https://your-domain/sitemap-index.xml` in [Google Search Console](https://search.google.com/search-console) and [Bing Webmaster Tools](https://www.bing.com/webmasters).
5. Optional: set `[seo.ai] indexNowKey`, deploy, and run `npm run indexnow -- --all`. After later deploys, run `npm run indexnow`.
6. Share a link in a chat app to check the preview image.

</Steps>

### Updating The Live Site
With a git-connected host, every push to your main branch deploys automatically. Build locally first (`npm run build`) to catch errors before they reach your visitors.