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

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Publish dashboards

> Build the dashboards into static pages, publish them behind your own access control, and rebuild when the data changes.

You will end with your dashboards on a web server your team can open, rebuilt when the data
changes. The steps use the sample project from the [quickstart](/docs/get-started/quickstart.md).

## 1. Build the pages

```sh theme={null}
hatchmark build
```

Build checks the project, runs every query and writes static HTML to `outDir` (`dist/` by default):
one folder per dashboard and per report, and an `index.html` that opens the first page. Every URL is
relative, so the folder works under any path and straight from disk.

```sh theme={null}
open dist/index.html
```

## 2. Choose who can see them

A page holds the data it shows, including what its filters and table downloads need, and asks
nobody who they are. So publish `dist/` behind access control you already trust: an intranet
behind your company's sign-in, a private bucket with authenticated access, or a static host with its
own access policy. Use a public host only for data you would publish anyway.

## 3. Copy the folder

Any static host serves `dist/` as it is. For example:

```sh theme={null}
rsync -a --delete dist/ intranet:/var/www/dashboards/
aws s3 sync dist/ s3://acme-dashboards/ --delete
```

Build replaces only the files it wrote, and asset names carry a content hash, so a host can cache
them forever.

## 4. Check every change

```sh theme={null}
hatchmark check
hatchmark test
```

Run both on every pull request. Neither changes your specs or the published pages. `check` runs
without database access and only warns that it couldn't read a database source's columns. `test`
reads the data, so a test on a database source needs the connection variable or a
[fixture file](/docs/reference/metrics.md#tests), and it may keep a local copy of the rows in
`.hatchmark/cache/`.

## 5. Rebuild when the data changes

Run `hatchmark build` again and copy the folder. It reuses cached results for queries whose data
didn't change, so a rebuild is quick. To rebuild on a schedule and serve the pages from inside your
network, run [`hatchmark serve` in Docker](production.md) instead.

## Next

* [`hatchmark build`](../reference/build.md): the output, the build cache and exit codes.
* [Share a chart or a PDF](/docs/guides/export.md) for readers who don't open the pages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.