# Quick Start

> **Audience:** the person deploying and initially administering Studio

This quick start begins after the Studio source has been reviewed and its
Cloudflare Worker resources have been provisioned. Resource creation, binding
selection, source updates, backups, and Worker deployment remain operator-owned
tasks. Studio owns only the reviewed database lifecycle operations exposed by
its application.

## 1. Check the deployment prerequisites

- Use Node.js `22.22.0` or newer when building Studio.
- Bind a Studio-owned D1 database as `DB` and configure the other resources
  declared by the deployment. Do not copy another installation's resource IDs.
- Keep `STUDIO_AUTH_SECRET` stable for the lifetime of the installation. It
  protects sealed setup data and encrypted MFA material.
- Create a separate, temporary `STUDIO_INSTALL_TOKEN` for initial installation.
- Set `STUDIO_SITE_MODE` to `initial`.

`STUDIO_AUTH_SECRET` and `STUDIO_INSTALL_TOKEN` use the same strict format:
32–256 printable ASCII characters from `!` through `~`, with no spaces or
control characters. Generate independent values; do not reuse either value as
a password or operations token.

For example, the following command produces a suitably sized random candidate.
Store its output as a secret rather than in source control:

```sh
openssl rand -base64 48
```

The default Studio integration mode is `disabled`. An empty or unavailable
Edge database therefore does not block core Studio installation and content
management.

## 2. Deploy the initial configuration

Deploy the Worker with:

- `STUDIO_SITE_MODE=initial`
- a valid `STUDIO_INSTALL_TOKEN` secret
- a valid `STUDIO_AUTH_SECRET` secret
- an otherwise uninstalled Studio D1 application catalog

Opening Studio now shows the installation flow. A normal sign-in screen is not
available until installation is complete and the operator later changes the
site mode.

## 3. Create the first administrator

The installer asks for the temporary install token and the first
administrator's identity and password. The password is checked locally against
Studio's strong-password policy; installation does not send it to an external
breach-checking service.

MFA is mandatory and cannot be disabled:

1. Register the displayed TOTP secret in an authenticator.
2. Save the ten recovery codes outside the Studio database.
3. Confirm a current TOTP code and one displayed recovery code.
4. Submit the installation.

Studio commits the administrator, password hash, TOTP factor, recovery-code
digests, system roles, and schema lifecycle state in one atomic D1 batch. It
does not create a password-only administrator.

## 4. Activate the installed Studio

Successful installation does **not** change the Worker configuration. Before
normal sign-in:

1. Delete the `STUDIO_INSTALL_TOKEN` binding completely. Leaving it defined,
   even as an empty value, is a fail-closed configuration error after install.
2. Change `STUDIO_SITE_MODE` from `initial` to `operational`.
3. Deploy the changed Worker configuration.
4. Sign in with the administrator password and TOTP or an unused recovery code.

Do not rotate `STUDIO_AUTH_SECRET` as part of activation. Losing or changing it
can make existing TOTP and recovery-code material unusable.

## 5. Configure the first site

A practical first pass is:

1. Set the site title, canonical URL, locale, and timezone in **General**.
2. Review output, URLs, homepage, media delivery, and branding settings.
3. Create or import Authors, Posts, Pages, Media, Menus, and Widgets.
4. Leave **Edge Services** disabled unless comments, Forms, or Newsletter
   runtime features are ready to be operated.
5. Open **Publish**, explicitly generate Preview Data, inspect it, and download
   the JSON for the separate ZeroPress Build workflow.

Studio emits only published Posts and Pages. Draft and Trash content remains in
Studio. ZeroPress intentionally does not implement scheduled publishing.

## Next steps

- Learn when to use each [Site Mode](../operations/site-modes/index.md).
- Configure the protected [Maintenance & Recovery](../operations/maintenance-and-recovery/index.md)
  surface before relying on database backup, restore, upgrade, or recovery
  workflows.
