Founders, operators, and new developers who have an AI-built web app running on their computer and want to share it with other people.
Guides Google Antigravity
How to Deploy a Google Antigravity App With Firebase Hosting
Deploy a Google Antigravity app with Firebase Hosting, secure CRM data, and test the live site.
Introduction
Updated September 25, 2026
To deploy a Google Antigravity app, check how it runs, prepare its build and Firebase settings, then publish it to a hosted URL. For a React and Vite app, Firebase Hosting serves the built files. Firebase Authentication handles sign-in, and Cloud Firestore stores the records. Firebase explains this deployment route in its Hosting guide.
This walkthrough uses Northstar CRM, a small sales app with contacts, companies, deals, notes, search, and dashboard cards. You will take it from a local project to a live site, test who can access its data, and connect a custom domain.
Already have an app? Start with Step 1. If you need one to practice on, use the Northstar build prompt near the end of this guide, then return here.
Download the launch kit for sample configuration files, fictional CRM records, agent prompts, and the launch checklist.
The accompanying recording shows the original June 17, 2026 CRM build. Its demo permissions and interface may differ from this updated deployment guide; use the access checks and current steps below for a new launch.
Step-by-step 7 steps
Instructions
-
Step 1 of 7 Ask Antigravity to inspect the app
Open your app's folder in Antigravity. Save a copy or commit your current work before making changes.
In Settings → Customizations → Build with Google Plugins, enable the Firebase bundle when available. Google's bundle supplies guidance for services including Authentication, Firestore, and hosting. See Google's setup instructions.
Paste this prompt:
Inspect this app and prepare a deployment plan. Make no changes yet. Identify the framework, package manager, build command, output folder, Firebase services, and any code that needs a server. List the required settings by name, without printing secret values. Tell me whether Firebase Hosting fits this app. If it needs App Hosting or another server, explain the reason and propose that route. Check sign-in, database permissions, client-side secrets, and what could break after deployment. Preserve existing records. Flag any migration separately. Show the files and commands you propose changing. Wait for approval before creating resources, changing billing, changing live security rules, or deploying.For the CRM example, expect React, Vite, TypeScript, Firebase Authentication, and Cloud Firestore. Vite normally builds into
dist; confirm the folder in your project. Vite's deployment guide covers its build output. -
Step 2 of 7 Connect Firebase and separate test settings
Use a staging project for testing and a separate production project for the app people will use. Firebase recommends separate projects to protect live data during development. Read its testing guidance.
In the Firebase console, create or select the staging project, register a web app, and copy that app's Firebase configuration. Create a Firestore database with access denied by default. Then enable Email/Password under Authentication → Sign-in method for this example. Firebase documents web app registration, password sign-in, and locked-down starting rules.
Install the Firebase command-line tool, sign in, and list the projects you can access:
npm install -g firebase-tools firebase login firebase projects:listUse a Node.js version supported by your app and the current Firebase CLI. Run these commands in the project's terminal. Firebase's CLI reference covers installation and project selection.
In later commands, replace
STAGING_PROJECT_IDandPRODUCTION_PROJECT_IDwith the exact IDs you intend to use. The--projectflag selects the destination explicitly.Keep the browser settings and deploy target aligned.
The kit includes
.env.staging.exampleand.env.production.example. Fill them with the matching Firebase web configuration and save local copies as.env.staging.localand.env.production.local. Check that Git ignores the local files. Match the variable names to the ones your app reads.Vite includes
VITE_values in the browser build. Use them only for public client settings. Keep service-account keys, payment secrets, and private AI API keys on a server. Vite explains environment variables and build modes.Firebase's web configuration includes an API key designed for client use. Restrict it to the required Firebase APIs and enforce data access with Security Rules. Keep a separate secret key for a service such as the Gemini Developer API. Read Firebase's API-key guidance.
-
Step 3 of 7 Check sign-in and data access
For this small internal CRM, use approved accounts with private records. Each approved account can manage its own companies, contacts, deals, and notes. A trusted administrator controls the list of approved accounts. Have the agent show you where that approval lives, then approve your test accounts through the Firebase console or a trusted admin tool.
Ask Antigravity to implement that policy in both the app's data paths and Firestore Security Rules. Include checks that reject invalid fields and prevent users from changing record ownership or approving themselves.
A rule that grants access to every signed-in user would allow much broader access. Check permissions at the database level. Firebase supports checks based on the signed-in user's ID and document data. See Firestore's access-control examples.
Use this prompt:
Test the CRM's access rules with the Firebase Local Emulator Suite. An approved user must be able to manage their own CRM records. A signed-out visitor, an unapproved account, and another approved user must fail when reading or changing those records. Also test attempts to change ownership, grant account approval, or save invalid fields. Use client requests for these tests. Report each test and its actual result. Keep existing data intact and show proposed rule changes for review. Do not deploy them yet.Firebase provides a rules-testing library and emulator workflow. Use client requests to test restrictions; server libraries using admin credentials bypass Firestore Security Rules and need their own access checks.
For a shared team CRM, define team membership and roles before allowing shared access. Have someone qualified review the rules before you add real customer data.
-
Step 4 of 7 Build the app and configure Firebase Hosting
For a Vite-based
buildscript, create the staging build:npm run build -- --mode stagingThis uses the staging mode's settings. Check that the build finishes and produces
dist/index.html. Run the project's tests and type checks as well. Vite documents staging modes.Initialize Hosting when the project does not already have a Hosting configuration:
firebase init hosting --project STAGING_PROJECT_IDChoose the existing staging project, set the public directory to
dist, and select the single-page app option for this React app. Keep the app's generatedindex.htmlif the CLI asks to overwrite it. Review existing configuration before rerunning setup. See Firebase's initialization steps.For this one-site example, the Hosting section of
firebase.jsonshould look like this:{ "hosting": { "public": "dist", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } }Merge this section with your current file. Preserve any Firestore, emulator, function, or other settings. The rewrite sends routes such as
/contactsto the React app when someone opens them directly. Apps with API rewrites need to preserve their routing order. Firebase documents Hosting configuration.Firestore needs its own configuration and rules. If those files are missing, ask the agent to help run
firebase init firestore --project STAGING_PROJECT_ID, then review the generated files. After the rules tests pass and you approve the changes, deploy them:firebase deploy --only firestore:rules --project STAGING_PROJECT_IDReview and deploy any required Firestore indexes separately. A Hosting deployment alone leaves your database rules unchanged in this static-app setup. Firebase documents rules deployments.
-
Step 5 of 7 Deploy a preview and test the CRM
Publish the staging build to a temporary preview URL:
firebase hosting:channel:deploy crm-check --project STAGING_PROJECT_IDOpen the URL the command returns.
Preview URLs are public. They also use the backend configured in the app. Keep the staging build connected to your staging Firebase project and use fictional records. Firebase explains preview-channel behavior.
If sign-in fails on the preview, check the hostname and redirect settings required by your Auth provider.
Run this smoke test, a short check of the app's main functions:
Check Expected result Sign in with an approved test account. The dashboard opens. Create Cedar Works, then add Priya Shah as a contact. Both records save, with the contact linked to the company. Create a Website refresh deal worth $2,400 and add a note. The deal and note save; relevant dashboard totals update. Change the deal value to $2,600. The saved value and relevant dashboard total increase by $200. Refresh the page, then sign out and back in. The saved records remain available to their owner. Search for Cedar Works. The app returns the expected company and related records it supports. Open /contactsdirectly and refresh it.The route loads without a hosting 404. Try another account and a signed-out browser. Neither can read or change the first account's records. Delete the fictional test records. They disappear, and totals update. Run the permission tests against the database as well as the interface. Hiding a record on screen alone cannot establish that access is blocked. Firebase's security checklist recommends automated rules tests.
Save the results. Fix any failed checks before sharing the app.
-
Step 6 of 7 Deploy to production
Set up the production project's web app, Authentication, Firestore, approved accounts, and reviewed rules. Use the production values in
.env.production.local.Changing
--projectchanges the upload destination. It does not replace Firebase settings already built into JavaScript. Rebuild with production settings, and check the project ID the app will use. Firebase documents deploy targets, and Vite documents build-time settings.Ask Antigravity for one final review:
Prepare this CRM for production deployment. Show the Firebase destination project ID, the project ID used by the browser build, the Hosting site, and the build output folder. List any failed or unrun tests. Check for private keys, test endpoints, emulator connections, and unrestricted database access. List the exact commands and which services they change. Flag any existing live site or database that those commands could affect. Wait for my approval before deploying.After review, run each command separately and stop if any command fails:
npm run build firebase deploy --only firestore:rules --project PRODUCTION_PROJECT_ID firebase deploy --only hosting --project PRODUCTION_PROJECT_IDThese commands assume you have reviewed the rules and configured this project for the single-site example. Deploy any required indexes before testing queries. Hosting returns your live site URL, usually on
web.app. See the Hosting deployment steps.Run the same smoke test on the live URL with dedicated test accounts and fictional records. Record the deploy time, source commit, and checks that passed. Remove your test records when you finish.
-
Step 7 of 7 Connect your domain and retest sign-in
In the Firebase console, open Hosting, select the site, and choose Add custom domain. A subdomain such as
crm.example.comlets you keep an existing website in place.Follow the wizard's ownership check and add the exact DNS records it supplies at your domain provider. Wait for Firebase to show the domain as connected with an active HTTPS certificate. Preserve unrelated DNS records, including email records. Follow Firebase's custom-domain guide.
Check the new domain in Authentication → Settings → Authorized domains where your sign-in flow requires it. For Google sign-in or email links, verify the required domain and redirect settings. Test sign-in, sign-out, and password reset from the final address. Firebase covers Google sign-in domains and email-link domain requirements.
An authorized domain controls where supported sign-in flows can run. Your app's access rules still decide who can use the CRM.
You're done
That's the whole workflow
Mark it complete to save your progress. Background and answers to common questions follow below.
Keep going
Keep learning with Rundown Pro
A guide shows you one workflow. Pro opens the full course library, so you can learn the whole system behind it.
- Every on-demand course
- Certifications on completion
- Group office hours and member perks
$29/mo, cancel anytime
Overview Back to the steps
Background and context
Who this is useful for
Choose the right hosting route
Check your app's framework before following a deployment command.
| What your app uses | Hosting route to check |
|---|---|
| React and Vite, with browser calls to Firebase Auth and Firestore | Firebase Hosting. Follow the main walkthrough below. |
| Next.js or Angular with server-rendered pages or server code | Firebase App Hosting. Check framework support and configure a backend. |
| A separate API, container, or background service | Give that service its own deployment, such as Cloud Run. Firebase Hosting can serve the browser app alongside it. |
Firebase documents Hosting for static and single-page apps, App Hosting's supported frameworks, and ways to connect Hosting to server code.
The commands below assume React, Vite, npm, and one Firebase Hosting site per project. An app with a server needs the matching server deployment too. Ask the agent to inspect your code before choosing a route.
For an overview of the coding tool, read our Google Antigravity overview.
Google Antigravity production deployment checklist
| Area | Confirm before sharing with users |
|---|---|
| Configuration | Build passes. Browser configuration and CLI target point to the intended project. No private keys or emulator connections ship. |
| Authentication | Approved users can sign in, sign out, and recover access on the final domain. |
| Security rules | Signed-out and unapproved users cannot access records. Approved users cannot access another account's records or grant themselves permissions. |
| Domain | DNS points to the intended site. HTTPS works. Direct links and sign-in redirects pass. |
| Smoke testing | Create, read, edit, delete, search, and dashboard checks pass with saved data on the live URL. |
Keep this checklist with your deployment notes. Also set up usage monitoring, a backup plan for valuable records, and an owner for handling failures. Firebase's launch checklist covers further release checks.
Common deployment problems
| Problem | First thing to check |
|---|---|
| Firebase's welcome page appears. | Confirm hosting.public points to dist, inspect dist/index.html, and rebuild. |
/contacts works through a link but fails on refresh. | Check the single-page app rewrite. |
| Login fails on the custom domain. | Check the enabled provider, authorized domains, and any required redirect settings. |
| The app shows “Missing or insufficient permissions.” | Check the signed-in account, approval, data path, and deployed rules. Keep restrictions in place while fixing the mismatch. |
| Production shows staging data. | Check the Firebase configuration in the browser build, then rebuild for the correct project. |
| The app builds but a server route fails. | Confirm that the server code has a supported deployment. A static upload serves built files. |
Use the relevant Hosting configuration, Auth, and Firestore query-rules docs while tracing the failed request.
Build the Northstar CRM example
Starting with an empty folder? Open it in Antigravity and use this prompt, then follow the deployment steps above:
Plan a small app called Northstar CRM before writing code.
Use React, Vite, TypeScript, Firebase Authentication, Cloud Firestore,
and Firebase Hosting. Include companies, contacts, deals, notes, search,
and dashboard cards. Use fictional sample data.
Use email/password sign-in. For this internal example, a trusted admin
approves accounts, and each approved account manages only its own data.
Enforce this in Firestore rules and test it with the Firebase emulators.
Keep private credentials out of the browser.
Leave out payments, shared teams, CSV imports, email sending, and
background automations. Show the plan and files you intend to create.
Wait for approval before building or changing cloud resources.Review the plan, approve the local build, and test the main screens. Then return to Step 1. Keep real customer records out until the access checks pass.
For another build approach, see how to build web apps with multiple agents in Cursor. That guide uses Next.js, so check the hosting table before choosing a deployment route.
Decide what to build after launch
Once people can try the app, ask them to complete one real task and note where they get stuck.
Marily Nika's No Code Product Building: From Idea to Product-Market Fit with AI covers user research, focused requirements, prototypes, and feedback. Use it to plan the next version around what users need.
View the course curriculum. Included with University Pro at $29 billed monthly. Your hosting services have separate access and billing terms.
FAQ 4 questions
Frequently asked questions
Does Google Antigravity host my app?
Antigravity can help prepare and run deployments through tools such as the Firebase CLI. The hosting service you choose serves the app to users. Google documents Firebase deployment support in Antigravity.
Can I deploy a Next.js app this way?
Check whether it uses server features. For supported full-stack Next.js and Angular apps, follow Firebase App Hosting. It can build and run the server portion. A verified static export can use static hosting; its output folder and limitations differ from this Vite example.
Can I host an Antigravity app for free?
Firebase Hosting offers no-cost allowances on its Spark plan. Usage and the other services you enable affect the total bill. App Hosting requires the pay-as-you-go Blaze plan. Check Hosting quotas and App Hosting costs.
Set up billing alerts when you enable paid services. An alerts-only budget does not stop spending. Review the controls for each service you use. Firebase explains budgets and available spend caps.
How do I undo a bad deployment?
For this static Hosting setup, open the site's Release history, choose a previous working release, and select Roll back. This restores the hosted files and Hosting configuration. Database contents, Authentication settings, and separately deployed Firestore rules need their own recovery steps. Firebase documents Hosting rollbacks.