Get Started with Firebase Hosting

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

To use Firebase Hosting, make sure that you've created a Firebase project and completed the "Get Started" wizard on your Firebase project's Hosting page.

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 https://nodejs.org/. 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

From the root of your project directory, 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 from your project's root directory:

firebase deploy

Your content will be deployed to your Firebase project's default Hosting site, your-firebase-project-id.firebaseapp.com.

Next steps

Now your site is ready to share with the world! You can also learn how to:

Also, take a look at the full documentation for the Firebase CLI.

Оставить отзыв о...

Текущей странице
Нужна помощь? Обратитесь в службу поддержки.