DEV Community

Cover image for 🚀 Firebase Hosting: Free Hosting for your First Web Project
Alvin James Bellero
Alvin James Bellero

Posted on • Edited on

🚀 Firebase Hosting: Free Hosting for your First Web Project

Are you looking for a hosting solution for your first Web project? Look no further than Firebase Hosting! Firebase Hosting is a cloud-based hosting service provided by Google's Firebase platform, and it's completely free to use.

What makes Firebase Hosting stand out is its powerful features and easy setup process. You can quickly deploy static web pages, single-page applications, and even dynamic server-side content. Plus, Firebase Hosting comes with automatic SSL, a global content delivery network, and easy integration with other Firebase services.

So if you're a developer looking to launch your first web project, give Firebase Hosting a try. It's a powerful, flexible, and affordable hosting solution that can help you get up and running in no time!

💡 To learn more about Firebase Pricing, please check this out.



🏗️ Setting up Firebase Hosting

Setting up Firebase Hosting for your web project is a straightforward process. Follow these steps to get started:

  1. Create a Firebase account
    If you don't already have a Firebase account, go to the Firebase Website and sign up for a free account. Once you're logged in, you'll see the Console, which is where you'll manage your Firebase projects.

  2. Create a Firebase project
    In the Firebase console, click on the "Create a project" button to create a new Firebase project. Follow the prompts to name your project and enable Google Analytics if you want to track user behaviour on your website (optional).

  3. Install the Firebase CLI
    The Firebase CLI (Command Line Interface) is a tool that you'll use to deploy your website to Firebase Hosting. To install the Firebase CLI (globally), open a terminal window and run the following command:

    npm install -g firebase-tools
    

     

  4. Initialize your Firebase project
    Once you have the Firebase CLI installed, navigate to your project directory in your terminal and run the following command:

    firebase init hosting
    

💡 This will prompt you to the Firebase Hosting option. Follow the prompts to set up your project for hosting.


🚀 Deploying your website to Firebase Hosting

With your project set up for hosting, you're now ready to deploy your website to Firebase Hosting. Follow these steps to deploy your website:

  1. Build your website
    Before you can deploy your website, you'll need to build it. This typically involves running a build command that compiles your source code into a production-ready format. The specific build command will depend on your project's build system. Once your website is built, you should have a directory containing your compiled files.

  2. Deploy your website
    In your terminal window, navigate to the directory containing your compiled files and run the following command:

    firebase deploy
    

💡 This will deploy your website to Firebase Hosting, and you'll be given a URL where you can access your website.


Congratulations! 🤝

You've now set up Firebase Hosting for your web project and deployed your website. With its powerful features and easy deployment process, you'll be able to manage your website hosting needs with ease.

😎💯👌



P.S. Catch up on the highlights from Firebase @ Google I/O ‘23! 🤯 ❤️

Top comments (1)

Collapse
 
_eduard26 profile image
Eduard Constantin

nice, another one to the list