Deploy CLI command reference
Deploys a statically built Sanity studio
USAGE
$ sanity deploy [SOURCEDIR] [--json] [--yes] [--auto-updates] [--build] [--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)
--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 it also skips the interactive title prompt, enabling unattended creation
--url=<value> Studio URL for deployment. For external studios, 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 --externalDeployment size limit
A single deployment is limited to 2 GB. The limit applies to the total size of the built files in the deployment, and deploys that exceed it are rejected with an error. The same limit applies to Studio deployments and App SDK app deployments.
Most deployments are a few megabytes, so typical projects stay well below this 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.