Get Started with Hosting

Easily deploy and host your app'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

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.

Initialize your app

Once you've chosen the Firebase app you'd like to deploy, cd into your project directory and run the command:

$ firebase init

Running the firebase init command creates a firebase.json settings file in the root of your project directory. You can learn more about this file in the Customize Hosting Behavior section of the guide.

Add a file

When you initialize your app, you will be 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 website

To deploy your website simply run:

$ firebase deploy

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

Manage and rollback deploys

From the Hosting panel in the Firebase Console 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".

Now your app is ready to share with the world! Next up, check out how to customize hosting behavior, 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.