# Hosting a website in Firebase

We can host a website to Firebase in 2 mins

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055753642/022686b2-98b5-495b-899f-36c1aae387b9.png align="left")

**Prerequisite**

Node should be installed. If the node is not installed in your system you can download node from this [download link](https://nodejs.org/en/)

> 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](https://firebase.google.com/)

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055755050/0cf6d3dc-b9f9-4291-b85a-e0d190b994ee.jpeg align="left")

**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

```javascript
npm install -g firebase-tools
```

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

```javascript
firebase login
```

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

```javascript
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

```javascript
404.html  
firebase.json  
.firebaserc
```

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

```javascript
firebase deploy
```

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

<iframe src="https://www.youtube.com/embed/lQ1cUoP3a-Q?feature=oembed" width="700" height="393"></iframe>

Hosting Website in firebase
