> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# External hosted Studios

Host a studio on your own domain and open it in the Dashboard.

You can host a studio that runs in the Dashboard on your own domain instead of on Sanity hosting. Building and uploading the studio works the same way as for any self-hosted studio. See [Self-host the studio](https://www.sanity.io/docs/studio/deployment). This guide covers what the Dashboard needs on top of that: registering your domain, and the headers your host must send.

Prerequisites:

- A studio set up for the Dashboard. See [Get started](https://www.sanity.io/docs/dashboard-beta/get-started).
- A web host you control, with HTTPS, for example `https://studio.example.com`.
- Sanity CLI vX.Y.Z or later.

## Register your studio

From your studio folder, run:

**npm**

```shell
npx sanity@latest deploy --external --url https://studio.example.com
```

**pnpm**

```shell
pnpm dlx sanity@latest deploy --external --url https://studio.example.com
```

**yarn**

```shell
yarn dlx sanity@latest deploy --external --url https://studio.example.com
```

**bun**

```shell
bunx sanity@latest deploy --external --url https://studio.example.com
```

The command builds your studio and registers it with the Dashboard at that address. It uploads a description of what the studio contains, so the Dashboard can show it, and nothing else. When it finishes, the CLI prints what your host needs to do:

**Output**

```text
The Dashboard loads this studio from your host, which must:
  1. Serve dist/ unchanged at the root of its URL (/mf-manifest.json, /remoteEntry-*.js, /static/*)
  2. Send Access-Control-Allow-Origin for https://YOUR_ORGANIZATION_ID.sanity.run
  3. Respond without cookies or a sign-in

This deploy rebuilt dist/: copy it to your host before opening the studio in the Dashboard.
```

The CLI also prints a `deployment.appId`. Add it to `sanity.cli.ts` so later deploys update this studio.

> [!WARNING]
> The first deploy always builds
> The studio's ID is written into the build, so the first deploy can't use `--no-build`. It works on later deploys.

## Configure your host

Your host must meet three requirements. The CLI output lists them with the values for your organization.

1. Serve the files at the root of the domain, unchanged. The Dashboard loads `/mf-manifest.json`, the `/remoteEntry-*.js` file, and the `/static/` folder from there. Hosting the studio on a path such as `https://example.com/studio` isn't supported.
2. Send the `Access-Control-Allow-Origin` header with the Dashboard's address, `https://YOUR_ORGANIZATION_ID.sanity.run`. This lets the Dashboard load files from your domain. It's separate from the CORS origins in your project settings, which let your studio call the Sanity API.
3. Respond without asking for a login. The Dashboard loads the files from your browser without cookies, so a host behind a VPN, a firewall, or single sign-on doesn't work.

## Deploy a new version

1. Run `npx sanity@latest deploy --external` again. Add `--no-build` if you already ran `sanity build`.
2. Upload the new `dist/` folder to your host.

The Dashboard shows the new version the next time it opens the studio.

## Errors you might see

These are the messages the CLI prints for the most common mistakes, and what to do about each:

- `A first external deploy needs the URL your host serves the build from`: Add `--url` with your studio's address.
- `A first deploy cannot skip the build (--no-build)`: Remove `--no-build` for the first deploy.
- `--url must be an origin with no path, query or hash`: Pass only the domain, for example `https://studio.example.com`.
- `Deploying an app to an external host is not supported.`: Only studios can be hosted on your own domain. SDK apps deploy to Sanity hosting.
- The studio opens in the Dashboard but shows nothing: Check that `https://studio.example.com/mf-manifest.json` loads in a browser, and that the response includes the `Access-Control-Allow-Origin` header.

