0
0
Firebasecloud~5 mins

Firebase services overview - Commands & Configuration

Choose your learning style9 modes available
Introduction
Firebase is a set of tools that helps you build and run apps easily. It solves common problems like saving data, managing users, and sending messages without needing to build everything from scratch.
When you want to save user data quickly without setting up your own database server
When you need to let users sign in with email or social accounts without building login systems
When you want to send notifications to users to keep them engaged
When you want to host your app on the internet without managing servers
When you want to track how users use your app to improve it
Commands
This command logs you into your Firebase account so you can manage your projects from the command line.
Terminal
firebase login
Expected OutputExpected
✔ Success! Logged in as user@example.com
This command starts setting up Firebase services in your project folder. You choose which services to use like Firestore, Hosting, or Functions.
Terminal
firebase init
Expected OutputExpected
You're about to initialize a Firebase project in this directory. ? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. ✔ Firestore: Configure security rules and indexes files for Firestore ✔ Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys Firebase initialization complete!
This command uploads your app and Firebase service settings to the cloud so your app can run and users can access it.
Terminal
firebase deploy
Expected OutputExpected
=== Deploying to 'my-firebase-project'... ✔ firestore: Firestore rules and indexes deployed ✔ hosting: Hosting files uploaded successfully ✔ Deploy complete!
This command shows all Firebase projects linked to your account so you can pick which one to work on.
Terminal
firebase projects:list
Expected OutputExpected
Active Projects: Project Display Name Project ID my-firebase-project my-firebase-project example-app example-app
Key Concept

If you remember nothing else, remember: Firebase provides ready-made tools to build app features quickly without managing servers.

Common Mistakes
Trying to deploy without logging in first
Firebase CLI needs your account info to upload your app and settings.
Always run 'firebase login' before deploying or managing projects.
Not selecting needed services during 'firebase init'
Your app won't have the Firebase features you want if you skip setup steps.
Carefully choose all Firebase services your app needs during initialization.
Running deploy in the wrong folder without Firebase config files
Firebase CLI won't find your project settings and will fail to deploy.
Run deploy commands inside the folder where you ran 'firebase init' and have config files.
Summary
Use 'firebase login' to connect your CLI to your Firebase account.
Run 'firebase init' to set up Firebase services in your project folder.
Use 'firebase deploy' to upload your app and Firebase settings to the cloud.
Check your projects anytime with 'firebase projects:list'.