Step-by-step guide to deploying your app with Firebase CLI. Install Node.js, log in, initialize your project, configure hosting, and deploy your application easily.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Install Node.js
Before using Firebase CLI, you need to have Node.js installed. Visit the official Node.js website and download the LTS version for your operating system. Follow the installation instructions provided on the website.
Step 2: Install Firebase CLI
Open your terminal or command prompt and run the following command to install Firebase CLI globally using npm:
npm install -g firebase-tools
Step 3: Log in to Firebase
You must log in to Firebase using the CLI to deploy your application. Use the following command to log in:
firebase login
This will open a browser window prompting you to authenticate with your Google account. After successful authentication, you can proceed to the next step.
Step 4: Initialize Your Firebase Project
Navigate to your project directory using the terminal or command prompt. Run the following command to initialize Firebase in your existing project:
firebase init
You will be prompted to select the Firebase features you want to use, such as Firestore, Functions, Hosting, etc. Use the arrow keys to navigate and spacebar to select. Once you’ve made your selections, press Enter to proceed.
Step 5: Configure Firebase Hosting
During the initialization process, if you selected Firebase Hosting, you'll be prompted to configure it. Specify the public directory (the folder with your production-ready files, often named build or public). When asked if you want to make it a single-page app, type y if you're developing something like a React or Angular app.
? What do you want to use as your public directory? (public directory)
? Configure as a single-page app (rewrite all urls to /index.html)? (y/N)
Step 6: Deploy Your Application
Once the Firebase project is initialized and configured, use the following command to deploy your application:
firebase deploy
This will deploy all the selected services (like Hosting, Functions, etc.) to Firebase. The terminal will display the deployment status and provide URLs to access your deployed application.
Step 7: Manage Your Firebase Project
You can manage your Firebase project using various CLI commands. Some useful ones include:
To display the URL of your deployed site:
firebase open hosting:site
To open the Firebase console in your default browser:
firebase open console
To view the list of available CLI commands, type:
firebase --help
This completes the step-by-step guide to deploying your application using Firebase CLI. Make sure to check Firebase documentation for the latest updates and more detailed information.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.