---
title: Previews and rollbacks
subtitle: Every build is an immutable deployment. Preview deployments get their own URL so you can review before going live; when production breaks, promote any past deployment back to production in one click.
description: The ButterIX deployment model — immutable deployments and the production pointer, deployment statuses, where preview deployments come from and their URLs, noindex and banner on previews, promote to production (rollback), canceling queued deployments, and the deployment retention policy.
---

## Deployment model

```mermaid
flowchart LR
  subgraph history [Deployment history]
    D1[dpl_…a1<br/>ready]
    D2[dpl_…b2<br/>ready]
    D3[dpl_…c3<br/>ready · preview]
    D4[dpl_…d4<br/>failed]
  end
  P((Production pointer)) --> D2
  D2 -. Promote to production .-> D1
```

- Each deployment is a complete directory of static output that is **never modified** after it's built.
- A site's production URL is just a **pointer** to one deployment. Publishing a new version, rolling back, and promoting a preview to production all just move this pointer — **instantly**, with no rebuild.
- A failed build never affects the live site.

### Deployment statuses

```mermaid
stateDiagram-v2
  [*] --> queued
  queued --> building
  queued --> canceled: cancel
  building --> ready
  building --> failed
```

| Status | Description |
|---|---|
| `queued` | Waiting to build; can be canceled |
| `building` | Building; the dashboard shows a live log |
| `ready` | Succeeded; can be visited and promoted to production |
| `failed` | Failed; `error` holds the reason and the log has the full output |
| `canceled` | Canceled (or cleaned up for exceeding the retention limit) |

### Triggered by

The deployments list in the console shows who triggered each deployment. For deployments made with an API key (`biti deploy`, CI), it shows the member who created the key, plus the key's name and its start and end, such as `biti_a1B2c••••Kd82mQx0Zt`, so you can tell which key it was. Deployments triggered by a Git push show their source instead.

## Preview deployments

A preview deployment is identical to a production deployment, except it doesn't move the production pointer and has its own URL:

```text
https://<subdomain>--<last 8 chars of deployment id>-sites.butterix.com
```

Where preview deployments come from:

<CardGroup cols={2}>
  <Card title="Pull requests" icon="lucide:git-pull-request" href="./git.mdx">
    With Git connected, created automatically when a PR is opened or updated.
  </Card>
  <Card title="CLI" icon="lucide:terminal" href="./cli-deploy.mdx">
    `biti deploy --preview`
  </Card>
  <Card title="Visual editor" icon="lucide:pen-line" href="./editor.mdx">
    Create a preview of your draft from the editor.
  </Card>
  <Card title="Dashboard" icon="lucide:mouse-pointer-click">
    "Create preview deployment" on the site overview page.
  </Card>
</CardGroup>

In a preview deployment:

- A "Preview" banner appears at the top of the page;
- Every page has `noindex` and `robots.txt` disallows crawling, so search engines won't index it;
- Canonical URLs, the sitemap, and `llms.txt` use the preview URL as the origin;
- Ask AI, MCP, and the playground proxy work just like on the live site, so you can review everything;
- If the site has password protection, the preview URL requires the password too.

The preview URL of each build is kept for 30 days; after that, opening it shows that the preview has expired. A draft's fixed preview URL follows the draft and isn't affected by this limit.

## Rollback: promote to production

On the dashboard's "Deployments" page, every deployment with status `ready` (including preview deployments and older production deployments) has a "Promote to production" button. Once confirmed, the production URL switches to that deployment immediately, and you can switch back at any time.

Via the API:

<EndpointRequestSnippet endpoint="POST /deployments/{id}/promote" languages={["curl", "javascript"]} />

<Info>
  Promoting a preview deployment to production means "ship exactly what was reviewed" — what goes live is the very output you reviewed, with no rebuild.
</Info>

## Cancel a deployment

Queued (`queued`) deployments can be canceled. A deployment that has started building can't be stopped midway; builds running longer than 10 minutes are marked as failed.

## Retention policy

The platform keeps files for the 20 most recent successful deployments per site (the current production deployment is always kept). Older deployments are cleaned up and marked `canceled`; their records stay in the list but can no longer be promoted to production. When the platform restarts, deployments that were queued or building are marked as failed and need to be redeployed.
