How to host your Angular APP with Firebase for FREE in just 2 minutes

Jaime Dantas
Reverse Engineering
3 min readFeb 12, 2020
Photo by Jaime Dantas — Paraiba — Brazil

This is not clicking bate! I’ll show you how to put your Angular 8 APP in the cloud with Firebase for FREE forever in just under 2 minutes! If you think this is not a good deal, stick until the end of this article to find out how to get your free SSL and Domain to use with your application. This will be a short reading, I promise.

Firebase

After all, what the heck is Firebase? Where this came from? Firebase is a company owned by Google which offers among other things mobile and app hosting. That’s all you need to know if you just want to host your app in the cloud for free. There are several other services offered by Firebase to enhance your project in case you’re wondering. They have Machine Learning products, Database, Authentication, and so on and so forth.

Hosting your App

First of all, you need to create a Firebase account. In order to do so, go to firebase.google.com and sign up.

With your account in hand, now it’s time to create your first project.

  1. Go to console.firebase.google.com
  2. Click in Add Project
  3. Enter a project name
  4. Select use Google Analytics and click in Continue

Ok, we’re almost there. Now you need to push your Angular APP to your Firebase account. Go to your Firebase console and hit the App button to start your configuration. Now, you’ll need to name your app and check the Firebase Hosting as shown below.

5. From your Angular APP root folder, install the Firebase CLI console.

$ npm install -g firebase-tools

6. Login into your account.

$ firebase login

7. Init Firebase from your root folder.

$ firebase init

It’ll ask for the build folder. Write dist. Then it’ll ask if you want to build as a single app page. Write Yes.

8. Now, build your Angular APP with the production profile.

$ ng build --prod

9. Deploy your application.

$ firebase deploy

That’s all you need my friend. Your application should be up and running in the URL provided. If you want to open it from your terminal, you can run the following command.

$ firebase open hosting:site
The expected output for the firebase deploy command

This command should open your application in your default web browser.

Angular 8 APP hosted by Firebase

SLL and custom domain

As you can see, your Application comes with an SLL certificate ready to go, so it’s secured over HTTPS. That being said, if you want to, you can pick your own domain and link it with your Firebase hosted app. However, bear in mind it MUST support TXT record in order to be verified by google, thus allowing to be used by Firebase.

Conclusion

This is by far the quickest and perhaps one of the best ways to host your app in the cloud for free I’ve ever tested. It took me approximately 2 minutes to get my application up and running with Firebase.

Not to mention the hundreds of Google features included by default like Google Analytics for instance. There is no question this is the way to go for small businesses and startups.

I’ll be happy to answer your questions if any. Thanks for reading it!

www.jaimedantas.com

--

--