Sajan Chhipa
Sajan Chhipa

Reputation: 1359

Deploy angular site on Firebase (FREE) using CLI

How I can deploy an angular application on Firebase cloud for free using CLI. I just started practicing of angular 9 and Firebase cloud server to explore my self, and want to check how easy to deploy an app on Firebase.

Upvotes: 0

Views: 270

Answers (2)

Poul Kruijt
Poul Kruijt

Reputation: 71901

The package @angular/fire has a built-in deploy functionality. You can read the documentation here.

Basically what you have to do to get your angular application running in firebase:

// this will guide you through the authentication system, and make the necessary changes
ng add @angular/fire

// now you can deploy your app
ng deploy

And you are done :)

If you want support for multiple projects you can re-run the previous commands, but then you include a --project parameter:

ng add @angular/fire --project=[PROJECT_NAME]
ng deploy --project=[PROJECT_NAME]

Upvotes: 1

Sajan Chhipa
Sajan Chhipa

Reputation: 1359

Deploy angular/any site on Firebase absolutely free using below steps:

Prerequisite: Sign in into Firebase console using google account and then create project for angular app.

  1. Add Firebase package in angular app

    CLI: >ng add @angular/fire

  2. Install Firebase tools on your system

    CLI: >npm install -g firebase-tools

  3. Make sure Firebase tools has been installed properly

    CLI: >firebase --version

  4. Login into Firebase account

    CLI: >firebase login

  5. Setup Firebase... You will be asked some options to set here

    CLI: >firebase init

  6. Finally deploy the angular app on Firebase cloud

    CLI: >firebase deploy

Now we can see angular app running on Firebase server: https://[firebase-project].web.app/.

Upvotes: 0

Related Questions