Publish your app with Firebase Studio Stay organized with collections Save and categorize content based on your preferences.
Firebase Studio offers multiple publishing options, allowing you tochoose the method that best suits your project's needs. Here's an overview ofthe available options:
Firebase App Hosting: Ideal for publishing dynamic Next.js and Angular applications,App Hosting offers built-in framework support, GitHub integration, and integration with other Firebase products likeFirebase Authentication,Cloud Firestore, andFirebase AI Logic.
If you developed a Next.js app withtheApp Prototyping agent, you can publish directly fromFirebase Studio in just a few clicks.
Firebase Hosting: Well-suited for hosting web apps and static web content (HTML, CSS, JavaScript, images, and other static assets) and single-page apps.Firebase Hosting provides fast content delivery through a global CDN, free SSL certificates, and custom domain support.
If you developed a static or single-page web app inFirebase Studio, you can publish directly fromFirebase Studio by promptingGemini inFirebase to publish your app.
Cloud Run: UseCloud Run to deploy containerized applications. It's a good choice for publishing scalable and portable applications that can run on any platform.
Other deployment options: Deploy to the hosting solution of your choice, including other platforms or your own server.
Publish and monitor your app withFirebase App Hosting
After you've tested your app and are satisfied with it in your workspace,you can publish it to the web withFirebase App Hosting.
Important:Firebase App Hosting requires aCloud Billing account. When you link a billing account to a Firebase project, then your project is automatically upgraded to thepay-as-you-go Blaze pricing plan and yourGemini API and other Firebase and Google Cloud service usage is upgraded to the paid tier. You will be charged for usage of paid services that exceed the no-cost quota. Learn more atUnderstandApp Hosting costs,Firebase pricing, andGemini Developer API pricing.When you set upApp Hosting,Firebase Studio creates aFirebase projectfor you (if one was not already created by auto-generating aGemini API keyor other backend services)and guides you through linking aCloud Billing account.
To publish your app:
ClickPublish to set up yourFirebase project and publish your app.ThePublish your app pane appears.
Important: If you did notauto-generate aGemini APIkey or prompttheApp Prototyping agent to create a Firebase project,Firebase Studio provisions aFirebaseproject on yourbehalf when you clickPublish. You can access the Firebase project byclicking the project name at the top of the page.In theFirebase project step, theApp Prototyping agent displays theFirebase project associated with the workspace. If a Firebase projectdoesn't already exist, theApp Prototyping agent creates a new project foryou. ClickNext to proceed.
In theLinkCloud Billing account step, choose one of the following:
Select theCloud Billing account that you want to link to your Firebaseproject.
If you don't have aCloud Billing account or want to create a new one,clickCreate aCloud Billing account. This opens theGoogle Cloud console, where you cancreate a new self-serveCloud Billingaccount.After you create the account, return toFirebase Studio and selectthe account from theLinkCloud Billing list.
ClickNext.Firebase Studio links the billing account to the projectassociated with your workspace, created either when you auto-generated aGemini API key or when you clickedPublish.
Important:Firebase App Hosting requires aCloud Billing account. When you link a billing account to a Firebase project, then your project is automatically upgraded to thepay-as-you-go Blaze pricing plan and yourGemini API and other Firebase and Google Cloud service usage is upgraded to the paid tier. You will be charged for usage of paid services that exceed the no-cost quota. Learn more atUnderstandApp Hosting costs,Firebase pricing, andGemini Developer API pricing.ClickSet up services. TheApp Prototyping agent beginsprovisioning Firebase services.
ClickPublish now.Firebase Studio sets up Firebase servicesand then launches theApp Hosting rollout. This can take up to severalminutes to complete.To learn more about what's happening behind the scenes, seeTheApp Hosting build process.
Tip: If you don't want to publish now, you can clickPublish later.When the publish step completes, theApp overview appears with aURL and app insights powered byApp Hosting observability. To use acustom domain (like example.com or app.example.com) instead of theFirebase-generated domain, you canadd a customdomain in theFirebase console.
For more information aboutApp Hosting, seeUnderstandApp Hosting and how itworks.
(Cloud Firestore only) Verify security rules in production
When publishing is complete and your app is deployed to Firebase,Cloud Firestore andFirebase Authentication are ready to test in production.
ViewCloud Firestore andFirebase Authentication data in theFirebase console
You can view live data from your app in theFirebase console afterpublishing.
To view your liveCloud Firestore database, open theFirebase consoleand chooseBuild >Firestore Database from the navigation menu.
From here, you can inspect stored data, view and test your securityrules, and create indexes. Learn more atCloud Firestore.
To view your liveFirebase Authentication data, open theFirebase console and chooseBuild >Authentication from the navigation menu.
From here, you can inspect your authentication configuration and app users.Learn more atFirebase Authentication.
Test Cloud Firestore rules in production
After publishing your app, you should test yourCloud Firestore security rulesagain, against your production environment. This helps to ensure that your datais accessible to authorized users and protected from unauthorized access.
You can test your rules using all of the following methods:
Application Testing: Interact with your deployed application,performing operations that trigger various data access patterns (reads,writes, deletes) for different user roles or states. This real-worldtesting helps confirm that your rules are correctly enforced inpractice.
Rules Playground: For targeted checks, use theRulesPlayground in theFirebase console. This toollets you simulate requests (reads, writes, deletes) against yourCloud Firestore database using your production rules. You can specify theuser authentication state, the path to the data, and the type ofoperation to see if your rules permit or deny access as intended.
Note:When you deploy security rules during thepublishingprocess or with theFirebase CLI,the rules defined in your project directory overwrite any existing rulesin theFirebase console. So, if you choose to define or edit yoursecurity rules using theFirebase console, make sure that you alsoupdate the rules defined in your project directory.Unit Testing: For more comprehensive testing, you can writeunit tests for your securityrules.TheFirebase Studio preview backend powered by theFirebase Local Emulator Suite lets you run these tests locally,simulating the behavior of your production rules. This is a robust wayto verify complex rule logic and confirm coverage for variousscenarios. After deployment, you should double-check that your unittests using the emulator work as expected and cover all scenarios.
Monitor your app withApp Hosting observability
TheApp overview panel inFirebase Studio provides keymetrics and information about your app, letting you monitor your web app'sperformance usingApp Hosting's built-in observability tools. After yoursite rolls out, you can access the overview by clickingPublish. From thispanel, you can:
- ClickPublish to release a new version of your app.
- Share the link to your app or open your app directly inVisit your app.
- Review a summary of your app's performance over the last 7 days,including the total number of requests and the status of your latestrollout. ClickView details to access even more information in theFirebase console.
- View a graph of the number of the number of requests your app hasreceived over the last 24 hours, broken down by HTTP status code.
- View the activation status of Firebase services likeFirebase Authentication andCloud Firestore.
If you close the App overview panel, you can re-open it at any time byclickingPublish.
Learn more about managing and monitoringApp Hosting rollouts atManage rollouts and releases.
Roll back yourApp Hosting site
If you've deployed successive versions of your app toApp Hosting, you canroll it back to one of the earlier versions. You can also remove it.
To roll back a published site:
Locate your app's backend, clickView, and then clickRollouts.
Next to the deployment you want to roll back to, clickMore
, then chooseRollback to this build, and confirm.
Learn more atManage rollouts and releases.
To remove yourApp Hosting domain from the web:
From theFirebase console,openApp Hosting, and clickView in theFirebase Studio app section.
In theBackend information section, clickManage. TheDomains page loads.
Next to your domain, clickMore
This removes your domain from the web. To fully remove yourApp Hosting backend, follow the instructions inDelete abackend.
Firebase Hosting
You can publish static and single-page web apps toFirebase Hosting fromyourFirebase Studio workspace.
If you don't have the required Firebase project permissions, ask aFirebase project Owner to assign you the applicable role in theFirebase console Users and Permissionspage.If you have questions about accessing your Firebase project,including finding or assigning an Owner, seePermissions and access toFirebase projects.
Note: UnlikeFirebase App Hosting, a Cloud billing account isn't required toset upFirebase Hosting.Publish with Gemini inFirebase
In the Gemini inFirebase chat, enter a prompt such as "Publish my app."
Gemini inFirebase guides you through the necessary steps. This mayincludecreating a Firebase project and registering yourapp if you haven't done so already.
Publish from theFirebase Studio panel
Firebase Hosting is optimized for static sites and single-page applications.If your project has dynamic content, Gemini inFirebase might not initiatethe publishing flow. If this happens but you still want to useFirebase Hosting, publish your project from theFirebase Studio panel:
If you haven't done so already,create a Firebase project and register your app.
Open yourFirebase Studio workspace.
- If you're using theApp Prototyping agent, click
Switch to Code to openCode view.
- If you're using theApp Prototyping agent, click
In the navigation pane, click theFirebase Studio icon to open thepanel, then expand theFirebase Hosting section.
ClickAuthenticate Firebase and follow the prompts inthe Terminal window to authenticate your Firebase account.
ClickInitializeFirebase Hosting and follow the prompts in theTerminal window to set up your deployment configuration.
To deploy your app, click eitherDeploy to Production orDeploy to Channel from theFirebase Hosting section of theFirebase Studio panel.
Cloud Run
Before you deploy usingCloud Run, make sure youset up aGoogle Cloudproject and enableCloud Billing.
Open yourFirebase Studio workspace. If you're using theApp Prototyping agent, click
Switch to Code to openCode view.
Click theFirebase Studio icon in the navigation pane to open theFirebase Studio panel and clickDeploy toCloud Run.
SelectAllow this workspace to accessGoogle Cloud resources using myGoogle Account and then select aGoogle Cloud project with billingenabled from the dialog windows.
ClickAuthenticate from theCloud Run section of theFirebase Studio panel and follow the prompts to authenticate.
ClickDeploy and follow the prompts to set up your deploymentconfiguration and deploy your app.
Next steps
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-02 UTC.