Launch FREE Websites with Firebase Hosting
Firebase Hosting is a fast and secure way to deploy websites for free.
It is ideal for static websites, portfolios, landing pages, and web apps.
In this guide, you will learn how to launch your website using Firebase Hosting step by step.
By the end, your site will be live on the internet with a public URL.
Concept Overview
Firebase Hosting allows you to deploy static files like HTML, CSS, and JavaScript with a global CDN.
It provides SSL security and fast loading speeds by default.
Prerequisites
A Google account.
Node.js installed on your system.
Basic knowledge of terminal commands.
Step 1: Install Firebase CLI
npm install -g firebase-tools
Step 2: Login to Firebase
firebase login
Step 3: Initialize Project
firebase init
Select Hosting and choose your project.
Set the public directory (e.g., public or build).
Choose 'Yes' for single-page app if needed.
Step 4: Add Website Files
Place your HTML, CSS, and JavaScript files inside the public folder.
Step 5: Deploy Website
firebase deploy
Output
Hosting URL: https://your-project.web.app
Detailed Explanation
Firebase CLI is used to manage and deploy your project.
The 'firebase init' command sets up configuration files.
The 'firebase deploy' command uploads your files to Firebase servers.
Your site is hosted on a global CDN for fast access.
Example Walkthrough
Create an index.html file inside the public folder.
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Hello Firebase Hosting!</h1>
</body>
</html>
Run 'firebase deploy' and open the provided URL to view your live website.
Applications
Hosting portfolios, landing pages, and static web apps.
Quick deployment for testing and demos.
Advantages of Firebase Hosting
Free SSL certificate.
Fast global CDN.
Easy deployment with CLI.
Limitations
Best suited for static websites.
Limited free usage for large-scale apps.
Improvements You Can Make
Connect a custom domain.
Use Firebase Functions for backend features.
Integrate with Firebase Authentication and Firestore.
This method is one of the easiest ways to launch a website for free using modern tools.
Codecrown