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.

C. Verify the Deployment
After successful deployment, check the Firebase Console for the hosting URL:

D. Adding a Custom Domain
If you want to use a custom domain instead of the default Firebase-provided URL, follow these steps:
- Go to Firebase Console > Hosting.
- Click on Add custom domain.
- Enter your domain name (e.g.,
yourdomain.com
). - Follow the verification steps and update your DNS records.
- Once verified, Firebase will serve your app from the custom domain.
For more details, refer to Firebase Custom Domain Setup.