-
Create a Firebase Project:
- Go to the Firebase Console (console.firebase.google.com).
- Click on "Add project" and follow the prompts to create a new project.
-
Install nodejs
- Visit the official Node.js website (https://nodejs.org/).
- Download and install the LTS version suitable for your operating system.
- After installation, open your terminal or command prompt and run
node -vto verify that Node.js is installed.
-
Install Firebase CLI:
- Open your terminal or command prompt.
- Run
npm install -g firebase-toolsto install the Firebase CLI globally.
-
Initialize Firebase Project:
- Navigate to your project directory using the terminal.
- Run
firebase loginand log in with your Google account. - Run
firebase initto initialize Firebase in your project directory. - Choose Hosting as the feature and select your project.
-
Create a Simple Website:
- In your project directory, create an
index.htmlfile and add some basic HTML content.
- In your project directory, create an
-
Deploy to Firebase Hosting:
- In the terminal, run
firebase deployto deploy your website to Firebase Hosting. - Once the deployment is successful, Firebase will provide you with a hosting URL.
- In the terminal, run
Here's a simple example of an index.html file you can use:
<!DOCTYPE html>
<html>
<head>
<title>My Firebase Website</title>
</head>
<body>
<h1>Welcome to My Firebase Website</h1>
<p>This is a simple website hosted on Firebase.</p>
</body>
</html>