Add custom domain to Firebase

Mohammed Ijas
2 min readJun 15, 2020

How to add your custom domain in Firebase hosting?

If you want to know How to host a website for free in Google’s Firebase cloud? Follow this link. 👈

Requirements : ❗️

  1. A domain (obviously).
  2. A website hosted in Firebase.

If you have these, let’s get going 🐼

Step 0:

Goto Firebase console and choose your project.
Click the hosting tab on the left.

Now you will see Firebase hosting dashboard.
Click on the button Add custom domain.

Browser screenshot (Firefox developer edition)

Add your domain name there and click continue.

Step 1:

Verify domain ownership.

To do this you need to goto your domain registrar’s website and login.

Then go DNS page to edit DNS records. Finding this page may vary with registrars. You will know it when you see a page with some weird data.

If you are using google domains, this verification part won’t be necessary, it verifies automatically.
For other registrars like godaddy, namecheap etc… this part is compulsory.

Google domains DNS page
Godaddy DNS record page

You will see something like this.

Now all you have to do is, choose TXT from drop down and just copy the rest from firebase window. Put TTL to 1hr(here it is the 3rd box in google domains).

It will take some time to verify(less than an hr).

Step 2:

After verification, you will see some more DNS data with some ip address in Firebase.

Just choose record type as ‘A’
fill host as @
and value/text to the given ip addresses.

Next add another ‘A’ record
fill host as www
and value/text to the same ip addresses.

It will take a couple of minutes to be updated.

Now you can use your custom domain to access your website hosted in firebase.

❗️ you might see an SSL security error after updating the domain. It will automatically cleared after some time.

That’s it. End of Post. ❤️

To make free custom emails for your website, view my next post(coming soon)

--

--

Mohammed Ijas

Am I a magician? No, I am a guy who know many things, mostly related to computers and programming.