Setup the Firebase command line tools
First Time Installation
The Firebase command line tools require 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 command line tools via npm:
$ npm install -g firebase-tools
# or use sudo (with caution) if required by your system permissions
# sudo npm install -g firebase-tools
This installs the globally available firebase command.
Updating Previously Installed Firebase Tools
If you have a previously installed version of Firebase command line tools, you can easily update them to the latest version:
$ npm update -g firebase-tools
# or use sudo (with caution) if required by your system permissions
# sudo npm update -g firebase-tools
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
Then you'll be prompted to select the Firebase app you'd like to deploy. You only ever need to run this init command once.
Running the firebase init command will create a firebase.json settings
file in the root of your project directory. You can learn more about this file in the
Advanced Configuration section of the guide.
Deploy your website
To deploy your website simply run:
$ firebase deploy
Your app will be deployed to the domain <YOUR-FIREBASE-APP>.firebaseapp.com
Manage and rollback deploys
From the Hosting tab in your App Dashboard you can see a full history of your deploys. To rollback to a previous deploy, click on the arrow icon on the right.
Now your app is ready to share with the world! For more details on Firebase Hosting, check out our complete hosting documentation and the documentation for our command line tool.