/firebase-tutorials

How to use Firebase CLI for deployment?

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.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to use Firebase CLI for deployment?

 

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.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022