Sanity Pioneers: Get early access to betas, extra AI credits, and a direct line to the engineering team. Apply now

Deploying Sanity Studio to Google App Engine - app.yaml example

25 repliesLast updated: Nov 29, 2025

Anyone know where I can find a tutorial or even just an example app.yaml for deploying sanity studio to google app engine?
AI Update

While there isn't an official Sanity guide specifically for Google App Engine deployment, I can help you piece together what you need. Sanity Studio is a React Single Page Application (SPA) that builds to static files, so deploying it to App Engine is definitely possible.

First, you'll need to build your Studio. Run sanity build (or npm run build) in your Studio directory, which creates a dist folder containing your static files.

Here's an example app.yaml for deploying Sanity Studio to Google App Engine standard environment:

runtime: nodejs20  # or nodejs22 if supported
service: default

handlers:
  # Serve static files from the dist directory
  - url: /static
    static_dir: dist/static
    secure: always

  # Serve other static assets
  - url: /(.*\.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot))$
    static_files: dist/\1
    upload: dist/.*\.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot)$
    secure: always

  # Catch-all handler for SPA routing - serve index.html
  - url: /.*
    static_files: dist/index.html
    upload: dist/index.html
    secure: always

The key here is the catch-all handler at the end, which ensures that all routes serve index.html - this is essential for SPA routing to work correctly.

Important considerations:

If you're set on App Engine for specific infrastructure reasons, the app.yaml above should work. Just make sure to test the deployment and verify that client-side routing works correctly by navigating to different Studio paths directly.

Show original thread
25 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions