How to deploy an Ionic or Angular build for “FREE”

Praveen Vishnu
3 min readApr 29, 2021

follow this for building ionic app

Let’s assume you have a build zip available (i.e. dist.zip or www.zip etc) with you and you would like to host it on a temp link on the web for testing.

We can use Firebase to host the build for free in 5 mins

One time steps

Step-1 Create Firebase account and project

  1. go to https://console.firebase.google.com/ and log in with a google account.
  2. Click on create a Project
  3. Enter equivalent name
  4. finish the project creation

Step-2 Install Firebase tools and Login to Firebase

  1. Create a folder somewhere (say “deploy”), open the terminal, and cd to the folder
  2. Install firebase tools using npm install -g firebase-tools
  3. Now you need to login into firebase-CLI, by using the command firebase login, You need to give it a few permissions, and CLI will forward you to the login page, you’ll get the link for the same in the terminal also. then just Login into your google account.
  4. Once login is successful. do the initialization in the command line firebase init
  5. Now copy the zip (say dist.zip to deploy folder) Unzip the file and you will get dist folder

Step-3 Firebase Init

  1. perform firebase init command in the same deploy folder
  2. it’ll list five services provided by firebase Database, Firestore, Functions, Hosting, Storage. You have to scroll down to Hosting by the down arrow key and select by space key. you can also select other services if you’re using them or use them in the future.

Then firebase-CLI will ask you to select the project name, that you created in step 1.

The CLI will ask you What do you want to use as your public directory? , here you need to provide the folder for your angular build files.. in the current case, it will be www

Everytime Deploy steps

Now that you have done the setup deploying is super simple — just run firebase deploy in command line

you will get the deployed link.

IF you wish to change the deployment from global to domestic just change the folder portal with the new deployment's content(or unzip and rename the folder with a name www) and perform firebase deploy you will get the new build hosted automatically for you.

--

--