In this tutorial, I will show you how to host your Angular website for free using Firebase.
In this tutorial, I will show you how to host your Angular website for free using Firebase.
To begin, you need to have a Google Account ready. If you do not have one, go to Google.com and sign up.
https://www.google.com/
Once you have your Google account, go to Firebase.google.com and sign in if you have not already.
https://firebase.google.com/
Then go to the Console, click on the Go to console button.
Create a project for your Angular website. Click on “Create a project.”
Enter your project name.
Keep in mind, you should use a unique name otherwise the free domains that you get from Firebase will end up with random characters at the end of it.
Accept the agreement and Continue.
Enable Google Analytics and continue. Google Analytics will give us useful statistics for our app.
Creating the Web App
To host our website, create a web app. Click on the web icon.
Give the app a name and enable Firebase Hosting for the app.
npm install -g firebase-tools
Once the Firebase tools are installed on your computer, click Next and then continue to the console.
Setting Up Your Angular Project
To host the Angular website, we have to build and compile the project first. Open your Angular project and the terminal window on Visual Studio Code - Press the [ CTRL + ~ ] keys.
ng build --prod
Once the command finish, it will generate a dist directory with our compiled project files. Go into it by right clicking on the dist directory and select the “Reveal in File Explorer” option.
Deploying Your Project to Firebase
firebase login
It will open up a browser. Sign into the Google account with the Firebase project and allow Firebase CLI to modify your data.
firebase init
firebase deploy --only hosting
If you see Deploy complete!, it means the project is now live and everyone can access it.
https://freeangularhosting.web.app
https://freeangularhosting.firebaseapp.com