> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xano.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Static Hosting

> Deploy and manage static frontend builds from the CLI

export const BrowserFrame = props => {
  const {url = "xano.run", maxWidth = 820, className = "", lightSrc, darkSrc, alt = "", children} = props || ({});
  const style = typeof maxWidth === "number" ? {
    maxWidth: `${maxWidth}px`,
    margin: "16px 0"
  } : {
    maxWidth,
    margin: "16px 0"
  };
  const hasSwapImages = Boolean(lightSrc && darkSrc);
  return <div className={`browser-frame ${className}`.trim()} style={style}>
      <div className="browser-frame__top">
        <div className="browser-frame__controls" aria-hidden="true">
          <span className="browser-frame__dot browser-frame__dot--red" />
          <span className="browser-frame__dot browser-frame__dot--yellow" />
          <span className="browser-frame__dot browser-frame__dot--green" />
        </div>
        <div className="browser-frame__address">{url}</div>
      </div>

      <div className="browser-frame__body">
        {hasSwapImages ? <>
            <img className="browser-frame__img--light" src={lightSrc} alt={alt} />
            <img className="browser-frame__img--dark" src={darkSrc} alt={alt} />
          </> : children}
      </div>
    </div>;
};

Static hosting lets you serve frontend assets (HTML, CSS, JavaScript, images) directly from Xano alongside your backend APIs. This is useful for single-page applications, marketing sites, documentation, or any static content that pairs with your Xano backend.

The CLI manages static hosting through a **build-based workflow**: you create a static host, then upload versioned builds as zip files.

<Note>
  Static host commands require a workspace ID, either from your profile or via the `-w` flag. Static hosts are referenced by **name**, and builds are referenced by **ID**.
</Note>

## List Static Hosts

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host list
  ```
</BrowserFrame>

Each static host shows its name, ID, and domain (if configured). Use `-o json` for the full JSON response.

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host list -o json
  ```
</BrowserFrame>

| Flag         | Description                                  |
| ------------ | -------------------------------------------- |
| `-w`         | Workspace ID                                 |
| `-o`         | Output format: `summary` (default) or `json` |
| `--page`     | Page number for pagination (default: `1`)    |
| `--per_page` | Results per page (default: `50`)             |

***

## Builds

Builds are versioned snapshots of your static assets, uploaded as zip files. Each static host can have multiple builds, letting you track deployment history and manage versions.

### List Builds

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host build list my-site
  ```
</BrowserFrame>

Each build shows its name, ID, and status. Use `-o json` for full details.

| Flag         | Description                                  |
| ------------ | -------------------------------------------- |
| `-w`         | Workspace ID                                 |
| `-o`         | Output format: `summary` (default) or `json` |
| `--page`     | Page number for pagination (default: `1`)    |
| `--per_page` | Results per page (default: `50`)             |

### Get Build Details

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host build get my-site 52
  ```
</BrowserFrame>

| Flag | Description                                  |
| ---- | -------------------------------------------- |
| `-w` | Workspace ID                                 |
| `-o` | Output format: `summary` (default) or `json` |

### Create a Build

Upload a zip file containing your static assets as a new build:

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host build create my-site -f ./build.zip -n "v1.0.0"
  ```
</BrowserFrame>

Add a description to keep track of what changed:

<BrowserFrame url="Terminal">
  ```bash theme={null}
  xano static_host build create my-site -f ./dist.zip -n "v2.0.0" -d "Redesigned landing page"
  ```
</BrowserFrame>

| Flag                | Description                                  |
| ------------------- | -------------------------------------------- |
| `-f, --file`        | Path to zip file to upload (required)        |
| `-n, --name`        | Build name (required)                        |
| `-d, --description` | Build description                            |
| `-w`                | Workspace ID                                 |
| `-o`                | Output format: `summary` (default) or `json` |

***

## Typical Workflow

A common pattern for deploying a frontend alongside your Xano backend:

<BrowserFrame url="Terminal">
  ```bash theme={null}
  # Build your frontend (React, Vue, Svelte, etc.)
  npm run build

  # Zip the output directory
  zip -r build.zip ./dist

  # Upload to Xano
  xano static_host build create my-site -f ./build.zip -n "v1.2.0"
  ```
</BrowserFrame>

<Tip>
  Name your builds with version numbers or timestamps so you can easily identify them later when listing builds.
</Tip>
