Deplying to Firebase

Getting prepared

1. Install packages

If you've never worked with Firebase on your computer, you may need to install a command-line tool first. If you already have it installed, there is no harm in doing this step again.

$ npm install -g firebase-tools

If you get an error about npm not being found, it's a sign you don't have Node.js installed properly. Please follow the set up instructions

2. Sign-up

If you haven't already, you'll need to sign up using your Google account.

Making a project

Before you can deploy to Firebase, you need to make a project. You can do it via their web-based portal, or using the command-line tool we installed earlier.

In your terminal, change directory to location of the particular sketch or project you want to deploy - or make a new directory to store it. It's probably the same folder that contains your 'index.html' file.

  1. Verify you're in the right place in your terminal. On a Mac, running pwd (print working directory) tells you that, and on Windows you'll see it in the prompt itself.
  2. Authenticate by running firebase login and signing in to the website which pops up.
  3. Run firebase init, and create a new Firebase or use an existing one.
  4. You'll need to select what options you want for your project. You probably just want hosting.
  5. When prompted for what directory should be the root, type . (remember, a period . refers to the current directory)

Deployment

Once you’ve run the steps above, you can now run firebase deploy to push your code to Firebase.

There are more detailed instructions available.