Set custom domain free for Firebase hosting

Tram Ho

Set custom domain free for Firebase hosting

As the title, I have just found a way to set up Freenom’s Domain for Firebase Hosting to save the hassle of re-entering the .firebaseapp.com domain name quite hard for you: 3

Why Firebase?

  • Simply because Firebase is very happy to use: 3
  • Firstly, Firebase is available for us as Firebase Firestore and Firebase Realtime Database to access more quickly, there is also Realtime, multi-platform and Firestore can also cache offline, saving the call to Db get Data to: 3 Reduce load time for users
  • Firebase has Authentication available, instead of having to login with Facebook, Google can read the doc, you only need to use Authentication to be able to login: 3 It takes a few lines to call the API and we only need to manage Firebase accounts.
  • Serverless with Firebase Cloud Functions: I also came to Firebase because of this. Having a new User write a trigger that catches the event quickly and quickly: 3
  • There is Firebase Hosting with CDN Server so it loads quite quickly without sleepiness like on heroku

Defect:

  • Spend a lot to pay
  • There is no PHP
  • No SQL for anyone who is already using it

Start

The first step is to create a domain name for our project

If you do not have a domain name, go to Freenom to create it: 3 I could not think of a good domain name, so I ordered it. If anyone uses another party’s domain, see the instructions because I don’t know how the other domain’s name is. I do the testcustomfb.ml domain name.  I’m reviewing the mind of rationalization and I can’t think of any cool domain name. The registration process is quite ez, so I do not guide anymore Domain registration is completed: 3

Ok done then go to the next step

Create 1 Project Firebase

Maybe this is the step ez after the previous step. Everyone go to Firebase Console and click Add Project and then set name Create project

Set name, Id, region, then create

Upload your static web to the server

If you do not have NodeJS, please download NodeJS from NodeJS because we will need to use npm. After installation, try to install successfully.

Ok, next you need to download Firebase Tools CLI from npm

Ok then go to your web project to open cmd or terminal, type

By default, it will create a Public folder containing Index.html and 404.html. It has pre-imported Firebase scripts. If you do not need to use you just delete the entire folder in the public folder and paste your code into it

Then to deploy to us to use

By default, we will have the domain name projectid.firebaseapp.com The next step is to configure the domain of this freenom: 3

Point the domain name

alt text

If you go to the console page, select the Hosting tag and you will see the Connect Domain button: 3 Try clicking it alt text

Upon clicking it will ask the domain name we want to connect to. Earlier I created the domain name is testcustomfb.ml so I will enter alt text

It will have one like token type. We login to freenom to configure DNS alt text

Set TXT to remove the name. Paste the whole token into the target then save and go make yourself a cup of coffee and wait for it to connect alt text

If you click verify it will not be verified. I waited for 5-7 minutes or so After doing a few games of CS: GO I returned and verified it successfully  Actually only 5-7p but busy playing should be forgotten alt text Ok, it’s done, finish and wait for it to return: 3 EZ (about 10-15p or something) alt text

alt text

Done

NOTE: In some cases, it is possible that https will be red cross fix as follows

The doctor went to SSL For Free and entered the domain name of his website alt text

Select Manual verification and click Manually Verify Domain alt text

Set 2 more TXTs + add another www to point back to www: 3

It will take about 4 hours to SSL something So everyone try to wait offline

Today’s article is ending with any questions or comments, guys, please comment below

Share the news now

Source : Viblo