# Deployment

## Deployment & Launch

Consultiz builds a static site into `dist/` in all three editions, so it runs on any static host. It ships settings files for **Netlify** (`netlify.toml`), **Vercel** (`vercel.json`, `vercel.sh`), and **Cloudflare Pages** (`wrangler.toml`), and `public/_headers` and `public/.htaccess`, which serve the AI files correctly.

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

### Host Variables By Edition
The Astro edition needs none. `SITE_URL` is optional in every edition: it is an environment variable that overrides `baseUrl` for a build.

| Edition | Set on your host                                                                                                                 |
| ------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Tina    | Nothing to build the site. Only for online editing: `PUBLIC_TINA_CLIENT_ID` and `TINA_TOKEN`. See [Tina](../features/tina/)      |
| Sanity  | `PUBLIC_SANITY_PROJECT_ID` and `PUBLIC_SANITY_DATASET`. A static host doesn't need `SANITY_API_READ_TOKEN`, so don't set it there. See [Sanity](../features/sanity/) |

In the Sanity edition, your live site changes after its next build. After you publish in the Studio, rebuild the site. Online preview needs a separate Node.js server: see [Sanity](../features/sanity/).

### Before You Launch
`PUBLIC-VALUES-NEEDED.md` in the theme lists the values the demo can't know: your domain, contact details, social and review profiles, and award claims. Go through it, then through this list. Each item links to the page that explains it. In the Tina and Sanity editions, change these values in the editor or the Studio: see the **What Is Editable** pages under [Features](../features/editions/).

- [ ] `[site] baseUrl` is your real address, and `npm run build` shows no `[site]` warning ([SEO & AI Visibility](../customization/seo-ai-visibility/))
- [ ] Site name, logos, favicon, social image, and colors are yours ([Quick Start](../getting-started/quick-start/))
- [ ] Every demo phone number, email, address, opening hours, and the office list are replaced, in every language ([Common Changes](../customization/common-changes/#replace-all-demo-contact-details))
- [ ] The contact forms, the footer newsletter, and the newsletter section post to your own accounts, you have confirmed a test message arrives, and the "not connected yet" notes are updated ([Forms](../customization/forms/))
- [ ] Social links in `src/config/social.json` are yours and enabled; the demo links in `footer-awards.md` are replaced
- [ ] Client logos, ratings, review counts, awards, statistics, and testimonials are real, or removed. Ratings use your real platform's logo and link your profile there ([Sections](../customization/sections/#client-logos-and-rating-badges))
- [ ] The **Home** and **Who we are** demo menus are trimmed to the pages you keep ([Menus](../customization/menus/))
- [ ] Demo pages you don't need are deleted or set to `draft: true`, for example the one-page homepages, unused solution and industry layouts, and `/components/` ([Pages](../customization/pages/))
- [ ] Demo content is replaced: solutions, people, careers, portfolio, case studies, industries, blog posts, and the webinar page. Only real, open positions are listed ([Collections](../customization/collections/))
- [ ] The privacy policy and terms are reviewed for your business
- [ ] A native speaker has reviewed the Arabic, or you have removed it ([Internationalization](../customization/internationalization/#remove-a-language))
- [ ] Analytics scripts are in `[head]`, gated on consent if the cookie banner is on ([Cookies & Analytics](../customization/cookies-analytics/))
- [ ] The copyright line in `src/i18n/<lang>.json` has your firm's name
- [ ] The file behind the **Company Desk** footer link (`/company-desk.pdf`) is yours
- [ ] `npm run astro-check` and `npm run build` finish without errors, and you have looked at every page you changed

### 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. Add a block for each extra language. The language script doesn't add one for you.

    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.example.com`) 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 and redirects `/sitemap.xml` to `/sitemap-index.xml`.

  </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]`. For the Tina edition, raise it to 22.23.4 or later. Cloudflare treats this file as the source of truth for the settings in it, so change them in the file. Set your address with `baseUrl` in `config.toml`, or the `SITE_URL` environment variable.

    **From your computer:** Consultiz 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
    ```

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

    Run `npm run build` and upload the **contents** of `dist/` to your web server or static host.

    For Apache servers, `public/.htaccess` (copied into `dist/`) sets browser caching for CSS, JavaScript, images, and fonts.

    Each language has its own 404 page, such as `/fr/404.html`. Only Netlify's settings file sends missing addresses to it. On other hosts, set up a similar rule, or visitors see the default language's 404 page.

  </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). The theme also includes a GitHub Actions workflow,
  `.github/workflows/verify.yml`, that runs `npm run verify` on every push to
  `main` and on pull requests. Delete it if you don't use GitHub.
</Aside>

### After You Launch
<Steps>

1. Open the live site and click through the main pages, on a phone and a desktop, in every language you keep.
2. Send a test message through each contact form, and sign up for each newsletter once.
3. Open `https://your-domain/sitemap-index.xml` and `https://your-domain/robots.txt` to check that they use your domain.
4. Submit the sitemap in [Google Search Console](https://search.google.com/search-console) and [Bing Webmaster Tools](https://www.bing.com/webmasters).
5. 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. See [Updating The Theme](../beginner/updating-the-theme/) for new Consultiz versions.