Host your Single Page Application with Firebase Hosting. Follow our step-by-step guide to set up, build, and deploy your SPA quickly and 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: Prerequisites
Before starting, ensure you have the following:
If you haven't installed Firebase CLI, you can do so using npm:
npm install -g firebase-tools
Step 2: Initialize Firebase in Your Project
Create a Firebase project through the Firebase Console if you haven't already. Once you have a project, initialize Firebase in your local project by opening a terminal and executing:
firebase login
Then, navigate to your project's root directory and run:
firebase init
You'll be prompted with several options:
build or dist.
Step 3: Build Your SPA
Before deploying, ensure your SPA is ready and built for production. Depending on the framework you used, this step may vary. For instance, with React:
Navigate to your project directory and run:
npm run build
This will create an optimized bundle in the build directory.
For Angular:
ng build --prod
This creates a build in the dist/project-name directory.
Step 4: Deploy to Firebase Hosting
Now that your SPA is built and Firebase is initialized, run the deploy command:
firebase deploy
Firebase CLI will take care of the rest. It uploads your files to Firebase Hosting and provides you with a deployment URL.
Step 5: View Your Deployed Application
After a successful deployment, you'll see a URL in the terminal output. Open this URL in your browser to view your hosted SPA.
Step 6: Manage Hosting via Firebase Console
You can manage your hosting and view more details about your deployments in the Firebase Console:
This completes the step-by-step guide to hosting a Single Page Application on Firebase Hosting. Make sure to verify everything is functioning correctly after deployment.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.