Preview CLI command reference

Starts a local web server for previewing production build

USAGE
  $ sanity preview [OUTPUTDIR] [--host <value>] [--port <value>]

ARGUMENTS
  [OUTPUTDIR]  Output directory

FLAGS
      --host=<value>  Local network interface to listen on (default: localhost)
      --port=<value>  TCP port to start server on (default: 3333)

DESCRIPTION
  Start a local server to preview a production build

EXAMPLES
    $ sanity preview --host=0.0.0.0

    $ sanity preview --port=1942

    $ sanity preview some/build-output-dir

Was this page helpful?

sanity.ioAll Systems Operational© Sanity 2026
Change site theme