Publish your app with Firebase Studio

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 Vertex AI in Firebase.

    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

If you create an app with the App Prototyping agent, you can publish to Firebase App Hosting directly from Firebase Studio.

Publish your app with App Hosting

When you set up App Hosting, Firebase Studio creates a Firebase project for you and walks you through linking a Cloud Billing account.

To publish your app to Firebase App Hosting:

  1. Click Publish to create a new Firebase project and begin App Hosting setup. The Publish your app pane appears.

  2. In the Firebase project step, note the name of the Firebase project that was created for you, then click Next.

  3. 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.

  4. 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. Then, App Hosting sets up a fully-managed environment for your app in Google Cloud.

  5. Click Create your first rollout. Firebase Studio launches the App Hosting rollout. This can take up to ten minutes to complete. To learn more about what's happening behind the scenes, see The App Hosting build process.

  6. When the rollout 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.

Monitor your app with App Hosting observability

The App Hosting App overview panel 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 Create rollout 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.

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:

    1. Open App Hosting in the Firebase console.

    2. Locate your app's backend, click View, and then click Rollouts.

    3. 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:

    1. From the Firebase console, open App Hosting, and click View in the Firebase Studio app section.

    2. In the Backend information section, click Manage. The Domains page loads.

    3. 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:

  1. Open your Firebase Studio workspace. If you're using the App Prototyping agent, click Code switch icon Switch to Code to open Code view.

  2. Click the Firebase Studio icon in the navigation pane to open the Firebase Studio panel and expand the Firebase Hosting section.

  3. Click Authenticate Firebase and follow the prompts in the Terminal window to authenticate your Firebase account.

  4. Click Initialize Firebase Hosting and follow the prompts in the Terminal window to set up your deployment configuration.

  5. 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.

  1. Open your Firebase Studio workspace. If you're using the App Prototyping agent, click Code switch icon Switch to Code to open Code view.

  2. Click the Firebase Studio icon in the navigation pane to open the Firebase Studio panel and click Deploy to Cloud Run.

  3. 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.

  4. Click Authenticate from the Cloud Run section of the Firebase Studio panel and follow the prompts to authenticate.

  5. Click Deploy and follow the prompts to set up your deployment configuration and deploy your app.

Next steps