---
url: https://kit.kambium.net/docs/dashboard-deployment.md
---
# Deploy the dashboard

Kambium Kit deploys the Vue dashboard and backend together on Fly.io by default.

## Host the dashboard on Fly

Use a generated app with Go ingress and install its npm dependencies.
In **Cloud → Fly**, select the Fly environment. Under **App URL**, select **Save**
to use the suggested address or **Use a custom URL** to enter your own. Desktop
uses the Fly address for the backend if it hasn't been set. You can set a separate
backend origin in **Cloud → Configuration**. Desktop saves these settings to the
selected Fly TOML file.

* `SERVE_BASE_URL` is the dashboard origin used for sign-in and provider OAuth
  redirects.
* `API_BASE_URL` is the backend origin used for public webhooks and backend
  links.

Both can use `https://YOUR_APP.fly.dev`. If you use separate origins, point
the dashboard domain and the backend domain at the same Fly app and configure
TLS for both. The browser calls `/api` on the dashboard's own origin in either
case. Use the same Supabase project for the dashboard and backend.

With `SERVE_BASE_URL` set, Desktop includes the dashboard in the Fly image. The
build uses the Supabase URL and publishable key from the same environment.
Follow the [deployment guide](https://kit.kambium.net/docs/deployment.md#deploy-a-newly-generated-app),
then [configure sign-in and verify](https://kit.kambium.net/docs/verify-deployment.md).

::: details Deploy from a terminal

Sign in to the Fly CLI and to npm with access to the Kit packages. From your
app directory, run:

```sh
npm run fly:deploy
```

For a named target configured through [environment setup](https://kit.kambium.net/docs/setup.md), use its
script, such as `npm run fly:deploy:dev`. The CLI reads the same TOML
settings and checks the same Fly secrets as Desktop. Review the destination
and build before confirming.

:::

### Roll back

Before deploying, record the current image from
`fly releases --app YOUR_APP --image`. To restore a previous image, deploy it
using your environment's configuration:

```sh
fly deploy --app YOUR_APP --config fly.prd.toml --image PREVIOUS_IMAGE --ha=false
```

This creates a new release from the previous image. Restore any changed
runtime settings in the selected environment separately, then recheck sign-in,
the API and provider callbacks.

<span id="deploy-from-desktop"></span>
<span id="supply-public-build-settings"></span>
<span id="configure-the-static-host"></span>
<span id="check-routing"></span>

## Host the dashboard separately

Run `npm run fly:deploy -- --no-dashboard` to deploy the backend by itself.
Set `SERVE_BASE_URL` to your dashboard's HTTPS origin and `API_BASE_URL` to
the Fly backend origin.

Supply the [public dashboard build inputs](https://kit.kambium.net/docs/configuration.md#dashboard-inputs)
for the same Supabase project as the backend. Run `npm run build:dashboard` in
the app directory and publish `dist/dashboard/` on your static host. Set the
host's Content Security Policy and framing headers for the dashboard. Configure
routes in this order.

1. Proxy `/api` and `/api/*` to the backend's `/ui` and `/ui/*`, preserving the remaining path and query.
2. Serve static files and return 404 for missing assets.
3. Serve `index.html` for Vue page routes, including `/auth/callback`.

[Configure sign-in and verify](https://kit.kambium.net/docs/verify-deployment.md). Open a nested dashboard
URL directly and confirm it loads and makes API requests.
