Firebase Studio offers multiple publishing options, allowing you to choose the method that best suits your project's needs. Here's an overview of the 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 like Firebase Authentication, Cloud Firestore, and Firebase AI Logic.
If you developed a Next.js app with the App Prototyping agent, you can publish directly from Firebase 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.
Cloud Run: Use Cloud 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 with Firebase App Hosting
After you've tested your app and are satisfied with it in your workspace, you can publish it to the web with Firebase App Hosting.
When you set up App Hosting, Firebase Studio creates a Firebase project for you (if one was not already created by auto-generating a Gemini API key or other backend services) and guides you through linking a Cloud Billing account.
To publish your app:
Click Publish to set up your Firebase project and publish your app. The Publish your app pane appears.
In the Firebase project step, the App Prototyping agent displays the Firebase project associated with the workspace. If a Firebase project doesn't already exist, the App Prototyping agent creates a new project for you. Click Next to proceed.
In the Link Cloud Billing account step, choose one of the following:
Select the Cloud Billing account that you want to link to your Firebase project.
If you don't have a Cloud Billing account or want to create a new one, click Create a Cloud Billing account. This opens the Google Cloud console, where you can create a new self-serve Cloud Billing account. After you create the account, return to Firebase Studio and select the account from the Link Cloud Billing list.
Click Next. Firebase Studio links the billing account to the project associated with your workspace, created either when you auto-generated a Gemini API key or when you clicked Publish.
Click Set up services. The App Prototyping agent begins provisioning Firebase services.
Click Publish now. Firebase Studio sets up Firebase services and then launches the App Hosting rollout. This can take up to several minutes to complete. To learn more about what's happening behind the scenes, see The App Hosting build process.
When the publish step completes, the App overview appears with a URL and app insights powered by App Hosting observability. To use a custom domain (like example.com or app.example.com) instead of the Firebase-generated domain, you can add a custom domain in the Firebase console.
For more information about App Hosting, see Understand App Hosting and how it works.
(Cloud Firestore only) Verify security rules in production
When publishing is complete and your app is deployed to Firebase, Cloud Firestore and Firebase Authentication are ready to test in production.
View Cloud Firestore and Firebase Authentication data in the Firebase console
You can view live data from your app in the Firebase console after publishing.
To view your live Cloud Firestore database, open the Firebase console and choose Build > Firestore Database from the navigation menu.
From here, you can inspect stored data, view and test your security rules, and create indexes. Learn more at Cloud Firestore.
To view your live Firebase Authentication data, open the Firebase console and choose Build > Authentication from the navigation menu.
From here, you can inspect your authentication configuration and app users. Learn more at Firebase Authentication.
Test Cloud Firestore rules in production
After publishing your app, you should test your Cloud Firestore security rules again, against your production environment. This helps to ensure that your data is 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-world testing helps confirm that your rules are correctly enforced in practice.
Rules Playground: For targeted checks, use the Rules Playground in the Firebase console. This tool lets you simulate requests (reads, writes, deletes) against your Cloud Firestore database using your production rules. You can specify the user authentication state, the path to the data, and the type of operation to see if your rules permit or deny access as intended.
Unit Testing: For more comprehensive testing, you can write unit tests for your security rules. The Firebase Studio preview backend powered by the Firebase Local Emulator Suite lets you run these tests locally, simulating the behavior of your production rules. This is a robust way to verify complex rule logic and confirm coverage for various scenarios. After deployment, you should double-check that your unit tests using the emulator work as expected and cover all scenarios.
Monitor your app with App Hosting observability
The App overview panel in Firebase Studio provides key metrics and information about your app, letting you monitor your web app's performance using App Hosting's built-in observability tools. After your site rolls out, you can access the overview by clicking Publish. From this panel, you can:
- Click Publish to release a new version of your app.
- Share the link to your app or open your app directly in Visit 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 latest rollout. Click View details to access even more information in the Firebase console.
- View a graph of the number of the number of requests your app has received over the last 24 hours, broken down by HTTP status code.
- View the activation status of Firebase services like Firebase Authentication and Cloud Firestore.
If you close the App overview panel, you can re-open it at any time by clicking Publish.
Learn more about managing and monitoring App Hosting rollouts at Manage rollouts and releases.
Roll back your App Hosting site
If you've deployed successive versions of your app to App Hosting, you can roll it back to one of the earlier versions. You can also remove it.
To roll back a published site:
Locate your app's backend, click View, and then click Rollouts.
Next to the deployment you want to roll back to, click More
, then choose Roll back to this build, and confirm.
Learn more at Manage rollouts and releases.
To remove your App Hosting domain from the web:
From the Firebase console, open App Hosting, and click View in the Firebase Studio app section.
In the Backend information section, click Manage. The Domains page loads.
Next to your domain, click More
, then choose Disable domain, and confirm.
This removes your domain from the web. To fully remove your App Hosting backend, follow the instructions in Delete a backend.
Firebase Hosting
You can publish web apps to Firebase Hosting from your Firebase Studio workspace. Before you publish a web app to Firebase Hosting, create a Firebase project and register your app.
If you don't have the required Firebase project permissions, you can ask a Firebase project Owner to assign you the applicable role in the Firebase console Users and Permissions page. If you have questions about accessing your Firebase project, including finding or assigning an Owner, see Permissions and access to Firebase projects.
To deploy your app on Firebase Hosting from Firebase Studio:
Open your Firebase Studio workspace. If you're using the App Prototyping agent, click
Switch to Code to open Code view.
Click the Firebase Studio icon in the navigation pane to open the Firebase Studio panel and expand the Firebase Hosting section.
Click Authenticate Firebase and follow the prompts in the Terminal window to authenticate your Firebase account.
Click Initialize Firebase Hosting and follow the prompts in the Terminal window to set up your deployment configuration.
To deploy your app, click either Deploy to Production or Deploy to Channel from the Firebase Hosting section of the Firebase Studio panel.
Cloud Run
Before you deploy using Cloud Run, make sure you set up a Google Cloud project and enable Cloud Billing.
Open your Firebase Studio workspace. If you're using the App Prototyping agent, click
Switch to Code to open Code view.
Click the Firebase Studio icon in the navigation pane to open the Firebase Studio panel and click Deploy to Cloud Run.
Select Allow this workspace to access Google Cloud resources using my Google Account and then select a Google Cloud project with billing enabled from the dialog windows.
Click Authenticate from the Cloud Run section of the Firebase Studio panel and follow the prompts to authenticate.
Click Deploy and follow the prompts to set up your deployment configuration and deploy your app.