1npm i -g firebase-tools
2firebase login # will be redirected to Google Auth page
3
4cd /your-project-directory
5
6firebase init # initialize a project
7# go through the initialization options
8firebase deploy # deploy a site
9# a public URL will be provided where you can see your websites
10firebase open # Hosting: Deployed Site
11firebase use --add # setup a staging environment (add a project alias)
12firebase use foo # use foo environment
13firebase deploy # deploy changes to foo (whatever env you are in)
You can only create a project through the Firebase console. In order to manage projects with the CLI, you should create it at the web interface first.
A project directory must have a firebase.json
to be able to deploy, which is created for you when you run firebase init
. Alias definitions are written to a hidden file called .firebaserc
, this file gets updated when you add an alias with firebase use --add
.
From the Hosting panel of the Firebase Console for your project, select Connect Domain.
You’ll need to either add a TXT
record at your domain host, or upload a file to your site to prove domain ownership.
To point your domain to Firebase Hosting you’ll need to add/update a CNAME
(for subdomains) or an A
(domains without subdomains) record.
After domain is provisioned, SSL provisioning starts and can take several hours.