Get Started with Firebase Hosting

Easily deploy and host your site's static assets (HTML, CSS, JavaScript, etc) with our production-grade hosting service. All of your content is served over HTTPS and backed by a global CDN.

Install the Firebase CLI

The Firebase CLI (Command Line Interface) requires Node.js and npm, which can both be installed by following the instructions on Installing Node.js also installs npm.

Once you have Node.js and npm installed, you can install the Firebase CLI via npm:

npm install -g firebase-tools

This installs the globally available firebase command. To update to the latest version, simply re-run the same command.

Access your Firebase projects

To connect your local machine to your Firebase account and obtain access to your Firebase projects, run the following command:

$ firebase login

Initialize your site

After you've chosen the Firebase project that you'd like to deploy, cd into your project directory, then run the following command:

$ firebase init

Running the firebase init command creates a firebase.json configuration file in the root of your project directory. You can learn more about this file in the customize hosting behavior section of this guide.

Select a public root directory

When you initialize your site, you are prompted for a directory to use as the public root (default is "public"). If you don't already have a valid index.html file in your public root directory, one is created for you.

Deploy your site

To deploy your site, run the following command:

$ firebase deploy

Your site will be deployed to the domain <YOUR-FIREBASE-APP>

Manage and rollback deploys

From your project's Hosting page, you can see a full history of your deploys. To rollback to a previous deploy, hover over its entry in the list, click the overflow menu icon, then click Rollback.

Next steps

Now your site is ready to share with the world! You can also learn how to customize hosting behavior or connect a custom domain, or take a look at the full documentation for the Firebase CLI.

Send feedback about...

Need help? Visit our support page.