Advertisement

Responsive Advertisement

Flutter Setup with Firebase CLI: Full Integration Guide

Flutter Setup with Firebase CLI: Full Integration Guide

Flutter Firebase CLI Setup

Want to integrate Firebase into your Flutter app using the Firebase CLI? This guide will take you through the Firebase CLI-based setup step by step — clean, efficient, and suitable for scalable Flutter projects.

Prerequisites

  • Flutter SDK installed (flutter doctor)
  • Node.js and npm installed
  • Firebase CLI installed
  • Firebase account: Firebase Console

Step 1: Install Firebase CLI

If you haven’t installed it yet:

npm install -g firebase-tools

Check if it’s installed:

firebase --version

Step 2: Login to Firebase

firebase login

This will open a browser window for Google sign-in.

Step 3: Create a New Flutter Project (If Needed)

flutter create flutter_firebase_cli_app
cd flutter_firebase_cli_app

Step 4: Initialize Firebase in Your Project

firebase init

Choose the following options during setup:

  • Hosting: Configure and deploy Firebase Hosting
  • Firestore, Functions, or other services if needed

Follow the prompts:

  • Select existing Firebase project (or create one from Firebase Console)
  • Set public directory (for Flutter web use build/web)
  • Configure as SPA → Yes
  • Overwrite index.html → No

Step 5: Build Your Flutter Web App

flutter build web

Step 6: Deploy to Firebase Hosting

firebase deploy

After deployment, Firebase CLI will provide a Hosting URL. Open it in your browser to see your Flutter web app live!

Conclusion

You've now successfully set up Firebase Hosting using Firebase CLI with your Flutter project. This method is clean, repeatable, and perfect for professional deployment workflows.

Post a Comment

0 Comments