Setup - Deploying to Firebase Hosting

Step 11: Deploying the Web App to Firebase Hosting

After setting up your project, you can deploy your Flutter web application to Firebase Hosting using the following steps.

A. Build the Web Application

First, clean and fetch dependencies, then build the web app in release mode:

flutter clean
flutter pub get
flutter build web --release

This process will create a build/web folder containing the final version of the application.

B. Deploy to Firebase Hosting

Run the following command to deploy the application:

firebase deploy --only hosting

Once deployed, Firebase will generate a hosting URL where your app is available.

Firebase Deploy
C. Verify the Deployment

After successful deployment, check the Firebase Console for the hosting URL:

Firebase Hosting
D. Adding a Custom Domain

If you want to use a custom domain instead of the default Firebase-provided URL, follow these steps:

For more details, refer to Firebase Custom Domain Setup.