---
title: "More ways to deploy with Firebase App Hosting"
description: "More ways to deploy with Firebase App Hosting"
published: "2025-05-20"
last_updated: "2025-05-20"
authors:
  - "Julia Reid (Product Manager)"
  - "Eric Gilmore (Technical Writer)"
categories:
  - "Google I/O"
  - "App Hosting"
  - "Terraform"
  - "Web"
  - "Emulator Suite"
  - "Launch"
  - "Firebase CLI"
  - "Firebase Studio"
canonical_url: "https://firebase.blog/posts/2025/05/more-ways-to-deploy-app-hosting"
---

# More ways to deploy with Firebase App Hosting

*Published May 20, 2025 by Julia Reid (Product Manager), Eric Gilmore (Technical Writer)*

---
> **TL;DR:** App Hosting has more ways to deploy to fit your team's development workflow, and supports automatic emulator configuration to make it easier to test your web app locally.

Last month, we launched Firebase App Hosting into General Availability (GA), a
milestone that included [new features](https://firebase.blog/posts/2025/04/apphosting-general-availability)
to help you build faster and scale, and signalled that App Hosting is fully
supported for production use.

We’re constantly improving App Hosting to make it easier for developers to build
and deploy modern web apps. Since launching General Availability last month,
we've added the ability to upload source code and container images directly to
App Hosting (without using GitHub), giving you more flexibility in how you
deploy to production. We also now have automatic configuration for the Firebase
SDK in the emulator, so that when you run your app locally, it automatically
uses emulated Firebase services instead of production.

### More ways to deploy

Previously, the only way to deploy to App Hosting was through GitHub: you
connect App Hosting to your GitHub repo and rollouts happen automatically when
changes are pushed/merged into your live branch (such as main). While CI/CD is
generally considered best practice, there are reasons you may not want to use
App Hosting’s built-in Git integration. For example, you might want to integrate
App Hosting deployments into your own custom CI/CD pipeline. Or maybe you’re
early in your app development and haven't yet set up continuous integration.

> We now have three ways to deploy to App Hosting without using GitHub: Firebase
Studio (launched at Cloud Next), `firebase deploy` with the Firebase CLI, and
Terraform.

#### Deploy with Firebase Studio

If you create an app with Firebase Studio's App Prototyping agent, you can
deploy to Firebase App Hosting from Firebase Studio. This means you can upload
source code directly from your workspace editor. If you have not already set up
App Hosting, Firebase Studio walks you through a workflow to complete all the
essential onboarding steps, from linking a Cloud Billing account to kicking off
the first rollout of the app.

![A screenshot of Firebase studio. There is a "Publish" button highlighted in the top right corner.](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/posts%2Ffah-io25-publish-button_1600x800.webp?alt=media&token=36b5feb9-1e40-48f5-ba33-c24eaee04f13)

After deploying your app, App Hosting provides built-in monitoring within
Firebase Studio, allowing you to easily check your app’s traffic and health
without leaving your workspace.

![A screenshot of Firebase studio with an App Hosting panel on the right side showing request stats for the deployed site](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/posts%2Ffah-io25-monitoring-studio_1600x800.webp?alt=media&token=acfe88d3-92cf-4557-9ebb-88f6b03a3b50)

#### Deploy from source with the Firebase CLI

The CLI command `firebase deploy` lets you push your app’s source code and
configurations directly from your local machine to Firebase. This is especially
convenient if you have other Firebase deployments (such as security rules or
functions) and want to deploy your web app and backend services together with a
single CLI command.

[Video: A developer runs through the 'firebase init' flow in a terminal, and selects App Hosting as the product. Then, they run 'firebase deploy'. The deployment is reflected in the App Hosting page of the Firebase console.](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/video%2Fio25-app-hosting-deploy-source.mp4?alt=media&token=19e37564-f590-48ce-87ad-7aaf46342f20)

How it works:

Your first step is to run `firebase init apphosting` in your local project
directory. This command walks you through setting up local source deployments
for an App Hosting backend—either an existing backend or a new one.

```bash
firebase init apphosting
```

After initializing App Hosting, you’ll notice a new firebase.json file in your
project. This file contains the information App Hosting needs to deploy your app
with `firebase deploy`:

*   `backendId`: the backend to deploy to
*   `rootDir`: the root directory of your app
*   `ignore`:  any files to ignore in the build

Then, run `firebase deploy` to upload your app’s source code and configuration
files to App Hosting.

App Hosting uploads your source code to a Google Cloud Storage bucket, runs your
framework build command in Cloud Build, and deploys the final artifacts to Cloud
Run and Cloud CDN.

![A screenshot of the App Hosting page of the Firebase console with a backend whose latest release status is "Deployed from the Firebase CLI" with a green check mark.](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/posts%2Fio25-app-hosting-cli-deploy_1600x800.webp?alt=media&token=e969cfea-5a9f-4b94-827c-905cf111383d)

#### Deploy with Terraform

For even greater control over App Hosting deployments, Terraform provides a
powerful 'infrastructure-as-code' solution. It allows you to define and manage
your App Hosting resources using declarative configuration files. A key
advantage of using Terraform is the ability to deploy your own pre-built
container image directly to App Hosting, instead of relying on App Hosting to
build from your source code. Key advantages of building your own container image
include:

*   You have full control over the build process and deployed environment,
    including each image layer and all your app’s dependencies
*   Faster rollouts, because you’re doing the build _before_ rolling out to App
    Hosting

Here's an example of the [`google_firebase_app_hosting_build`](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/firebase_app_hosting_build) and [`google_firebase_app_hosting_backend`](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/firebase_app_hosting_backend) resources:

**`app-hosting.tf`**

```hcl
resource "google_firebase_app_hosting_build" "example" {
    project  = google_firebase_app_hosting_backend.example.project
    location = google_firebase_app_hosting_backend.example.location
    backend  = google_firebase_app_hosting_backend.example.backend_id
    build_id = "mini-build"

    source {
        container {
            image = "us-docker.pkg.dev/cloudrun/container/hello"
        }
    }
}

resource "google_firebase_app_hosting_backend" "example" {
    project = "my-project-name"
    # Choose the region closest to your users

    location         = "us-central1"
    backend_id       = "mini"
    app_id           = "1:0000000000:web:674cde32020e16fbce9dbd"
    serving_locality = "GLOBAL_ACCESS"
    service_account  = google_service_account.service_account.email

    depends_on = [google_project_service.fah]
}
```

Visit [Get started with Terraform and Firebase](https://firebase.google.com/docs/projects/terraform/get-started) to learn more.

### Automatic emulator configuration

Along with new ways to deploy, we're introducing improvements to help you better
test your app. If you are using the Firebase JavaScript SDK's [`initializeApp` without arguments](https://firebase.google.com/docs/app-hosting/firebase-sdks#automatically-initialize-firebase-admin-and-web-sdks) to connect to Firebase services in your app (such as Auth or
Realtime Database) and using the Firebase Local Emulator Suite to run your app
locally, **the App Hosting emulator now automatically uses the emulated versions
of those services** instead of production. This means you can safely test locally
with peace of mind that you aren't messing with production data.

**`init-firebase.js`**

```js
// Use App Hosting's automatic initialization feature
const firebaseApp = initializeApp();

// Automatically connects to emulator locally,
// or to your production db when deployed to App Hosting.
const db = getFirestore();
```

### Summary

Firebase App Hosting is significantly expanding its deployment options to cater
to a wider array of developer workflows. Beyond the established GitHub
integration, you now have flexibility to deploy directly from Firebase Studio,
upload source code with the Firebase CLI, or leverage Terraform to roll out
pre-built container images. These new pathways, coupled with improvements for
local testing, empower developers to choose the deployment strategy that best
fits their project needs, from rapid prototyping to sophisticated, custom CI/CD
pipelines.

We hope that these new features will enhance your experience with App Hosting
and we’re excited to see what you build!

If you haven’t already, head over to the [Firebase console](http://console.firebase.google.com/project/_/apphosting) and explore
our [documentation](http://firebase.google.com/docs/app-hosting) to deploy your
first app. As always, if you have questions, you can hit us up on any of our
[support channels](https://firebase.google.com/support), or post questions on
Stack Overflow. And if you have ideas for any new features, let us know on [User Voice](https://firebase.uservoice.com/forums/948424-general?category_id=501599).
