Deploy, Convert & Scale
Deploy a Google AI Studio App to Production (Cloud Run, Domain)
Google AI Studio's Build mode generates web apps powered by the Gemini API and can deploy them to Google Cloud Run. For production you need to keep the Gemini API key server-side, set quotas and budgets, attach a custom domain, add a real backend such as Firebase where needed, solve SEO for a client-rendered React app and wire up Cloud Logging and Monitoring.
How AI Studio apps are built and deployed
AI Studio's Build mode creates a React and TypeScript web app that calls Gemini, and you can deploy it to Cloud Run in a Google Cloud project, download the code or push it to GitHub.
The one-click Cloud Run deploy is the fastest way to a public URL. For a long-lived product, export the code to a repository and set up your own build (Cloud Build or GitHub Actions) so changes are versioned, reviewed and reproducible. Check AI Studio's current documentation, as deployment options are evolving quickly.
Protect the Gemini API key
Never ship your Gemini API key to the browser: all Gemini calls in production must go through a server or proxy you control.
AI Studio's Cloud Run deployment is designed to keep the key on the server side instead of exposing it in the frontend bundle, but verify this in the deployed code and network traffic. If you self-host the exported code, add a small backend endpoint (Cloud Run, Cloud Functions or Firebase) that holds the key in Secret Manager, authenticates the user and forwards only allowed requests. Restrict the key in the Google Cloud console and rotate it if it was ever exposed.
- Key stored in Secret Manager, not in code.
- Server-side proxy with user authentication.
- Per-user rate limits and request size limits.
- API key restrictions and quota caps in Google Cloud.
Custom domain
You can map a custom domain to a Cloud Run service, or put Firebase Hosting or a load balancer in front of it.
Cloud Run domain mapping is the simplest option in supported regions; for more control (CDN, Cloud Armor, multiple services under one domain), use a global external Application Load Balancer, or Firebase Hosting with rewrites to Cloud Run. Whichever you choose, verify domain ownership, create the DNS records Google provides and wait for the managed certificate.
With a custom domain and a stable Cloud Run service in place, a mobile app is a realistic next step. WebViewGold converts the deployed web app into native iOS and Android apps without code, including configurable push notifications and deep links. Add native value that justifies an app, because Apple rejects pure website wrappers under guideline 4.2, and make sure your Gemini quotas can handle the extra traffic.
- Deploy the app to Cloud Run in your production project and region.
- Choose domain mapping, Firebase Hosting rewrites or a load balancer.
- Verify the domain and create the DNS records.
- Wait for the managed TLS certificate.
- Update allowed origins and auth redirect URLs.
Adding a real backend: Firebase or Cloud SQL
Most AI Studio apps start without persistent data, so production usually means adding authentication and a database.
Firebase Authentication and Firestore integrate naturally with a Google Cloud project and a React frontend; protect data with Firestore Security Rules and test them with the emulator. For relational data, Cloud SQL for PostgreSQL with a backend service is the alternative. Store user content and uploads in Cloud Storage with private access by default.
Keep staging and production in separate Google Cloud projects with separate API keys and budgets. That way an experiment in staging can never exhaust the production Gemini quota or touch real user data, and IAM permissions stay simple.
SEO and performance
A Build-mode app renders in the browser, so public landing pages need prerendering or a separate static site to rank reliably.
Keep the interactive AI tool on its own route or subdomain, and build marketing pages that serve full HTML with titles, descriptions, Open Graph tags, a sitemap and structured data. Stream Gemini responses so users see output quickly, and set Cloud Run minimum instances above zero if cold starts hurt the experience.
Monitoring, quotas and budgets
Use Cloud Logging, Cloud Monitoring and Error Reporting for the app, and budgets plus quota alerts for Gemini usage.
Create uptime checks and alerting policies for error rates and latency, log every Gemini request with user ID, model and token counts (without logging sensitive content) and set budget alerts in Cloud Billing. Gemini API rate limits depend on your usage tier, so plan for 429 responses with retries and graceful messages. Consider Vertex AI if you need enterprise controls such as regional processing and IAM-based access.
Frequently asked questions
Can I deploy a Google AI Studio app with one click?
Yes, AI Studio can deploy Build-mode apps to Google Cloud Run in your project. For production, also export the code to a repository so you can review and reproduce builds.
Is my Gemini API key safe in an AI Studio app?
Only if Gemini is called from the server side. Verify that the deployed frontend never contains the key, store it in Secret Manager and add authentication and rate limits to the proxy.
How do I put an AI Studio app on my own domain?
Map the domain to the Cloud Run service, or route it through Firebase Hosting or a load balancer, then configure DNS and wait for the managed certificate.
