Skip to main content

Command Palette

Search for a command to run...

Hosting a website in Firebase

Updated
2 min read

We can host a website to Firebase in 2 mins

Prerequisite

Node should be installed. If the node is not installed in your system you can download node from this download link

You can check whether node is installed or not by checking it’s version using the following command :

node -v

Once the node is installed we can host a website to firebase

Step 1: Go to your firebase console and create a new project

Step 2: Once you create a new project in firebase open your terminal

Step 3: Once the terminal is opened install firebase tools in your system by the following command

npm install -g firebase-tools

Step 4: Log in to your firebase account using the following command

firebase login

Step 5: Go to your project folder which is to be hosted and open the terminal and give the following command

firebase init

Step 6: Select hosting in the firebase option by pressing spacebar

Step 7: Enter the name of the folder which you want to be hosted in firebase

Step 8: once folder name is entered enter no for single-page access and overwriting the index.html file of your website

Step 9: Once done firebase will create the following files in your project folder

404.html  
firebase.json  
.firebaserc

Step 10: Once these files are created deploy your code to your firebase account using the following command:

firebase deploy

Once done your project will be deployed to firebase hosting and a hosting URL will be available.

Hosting Website in firebase

More from this blog

Nidhin's blog

168 posts

✨Crafting Code with a Smile for 8 Years:) Merging the Formal Dance of Angular, the Playful Rhythms of React, and the Next-level Moves of Next.js 🚀