Deploy CLI command reference

Deploys a statically built Sanity studio

USAGE
  $ sanity deploy [SOURCEDIR] [--json] [--yes] [--auto-updates] [--build] [--create] [--dry-run] [--external] [--minify] [--schema-required] [--source-maps] [--title <value>] [--url <value>] [--verbose]

ARGUMENTS
  [SOURCEDIR]  Source directory

FLAGS
  -j, --json             Output the result as JSON
  -y, --yes              Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
      --auto-updates     Automatically update the studio to the latest version
      --build            Build the studio before deploying (use --no-build to deploy existing `dist/` output)
      --create           Create a new App SDK app, even if the organization has other apps
      --dry-run          Report what would be deployed without uploading or creating anything
      --external         Register an externally hosted studio
      --minify           Minify built JavaScript (use --no-minify to skip for faster builds)
      --schema-required  Fail if schema deployment fails
      --source-maps      Enable source maps for built bundles (increases size of bundle)
      --title=<value>    Title for a newly created application or studio. For apps, use --create to select creation when the organization already has apps
      --url=<value>      Studio URL for deployment. For external deploys, the full URL. For hosted studios, the hostname (e.g. "my-studio" or "my-studio.sanity.studio")
      --verbose          Enable verbose logging

DESCRIPTION
  Builds and deploys Sanity Studio or application to Sanity hosting

EXAMPLES
  Build and deploy the studio to Sanity hosting

    $ sanity deploy

  Deploys non-minified build with source maps

    $ sanity deploy --no-minify --source-maps

  Fail fast on schema store fails - for when other services rely on the stored schema

    $ sanity deploy --schema-required

  Register an externally hosted studio (studioHost contains full URL)

    $ sanity deploy --external

  Register an externally hosted studio, served from the provided origin

    $ sanity deploy --external --url https://apps.example.com

  Create and deploy an App SDK app without prompts. Save application.id as deployment.appId, then omit --create on later deploys

    $ sanity deploy --create --title "My App" --yes --json

  Preview a new App SDK deployment without creating or uploading anything

    $ sanity deploy --create --title "My App" --dry-run --json

  Deploy a studio without prompts using its hostname

    $ sanity deploy --url my-studio --yes

Deployment size limit

What --no-build skips

By default, sanity deploy builds the Studio through Vite, extracts your schema and manifest, packages everything, and uploads it to Sanity hosting. Passing --no-build skips the build step but still runs schema extraction and upload. The dist/ directory must already exist. To make schema extraction fail instead of warn, pass --schema-required.

Was this page helpful?

sanity.ioAll Systems Operational© Sanity 2026
Change site theme