Deploy your app to firebase — in seconds!

Wassim Chegham
Google Developer Experts
3 min readJul 30, 2016

I was recently asked about the deployment and hosting of the “Let Me See” application. In this quick post, we will see how to use the hosting service of Firebase and how to deploy your Web application really quickly.

This application was created during the 48H AngularAttack Hackathon and I used Firebase as a hosting service.

Let us get started!

First things first, in order to use Firebase, you need to log in to your firebase console and create a new project:

Once you have your project created. You then need to install the firebase CLI tools:

$ npm install -g firebase-tools
$ firebase -V
3.0.4

Build your app

For the following steps, we are going to need an application that we want to deploy, obviously! I am going to use the “Let Me See” application.

Now, cd to your application root directory and build it—using your setup. In my case, I am using the Ionic CLI:

$ ionic build browser

This command will create a www folder. This is the folder we are going to deploy.

firebase init

Next, we will setup a firebase context for the current application. For that, in the same root folder, type:

$ firebase init

And answer some questions…

You have to do this only once per project, so do not panic!

Choose the instance of the project you would like to use:

Here is the complete output:

One important thing to note: When you are asked to use the public directory, you should use your folder that contain the bundled application. For instance, in my case that was the www folder.

Also, If you are asked to overwrite some files, it is up to you to decide. I decided to keep my files untouched.

After running the init command, firebase will create two files:

  • firebase.json: this is the configuration file of your project
  • .firebaserc: this file contains some ressources configuration for Firebase

Please that in order to be able to deploy your app, you must have the firebase.json file at the root of your project.

firebase login

One final step before deploying your application: you just need to make sure that you are logged in to your Firebase account:

$ firebase login

This command will open a browser window asking you to choose your Google account, and accept all the required permissions. Once you are logged in, you can close the window:

firebase deploy

Finally, it is time to deploy our application to millions of users:

$ firebase deploy

Done! Now you can visit the generated URL and enjoy your live application.

Follow @manekinekko to know more about the Web Platform.

--

--

Wassim Chegham
Google Developer Experts

#javascript @ Microsoft ★ GDE for Angular, Action On Google and GCP at Google ★ Member of Node.js Foundation and core contributor ★ Follow me @manekinekko