/firebase-tutorials

How to set up custom domain in Firebase hosting?

Learn how to set up a custom domain in Firebase Hosting with our step-by-step guide. Deploy your app, update DNS records, and enable HTTPS with ease.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to set up custom domain in Firebase hosting?

 

Step 1: Set Up Firebase Hosting

 

  1. If you haven't already, make sure you have Firebase CLI installed. To install or update, use the following command:

    npm install -g firebase-tools
  2. Log into Firebase using your Google account:

    firebase login
  3. Navigate to your Firebase project directory where you want to set up hosting.

  4. Initialize Firebase in your project directory:

    firebase init
  • When prompted, use the arrow keys to select "Hosting" and press Space to select it. Then press Enter.

  • Select the Firebase project you want to use from the list.

  • Choose the default public directory, usually public or build.

  • Choose whether to configure as a single-page app and whether to overwrite existing files.

 

Step 2: Deploy to Firebase Hosting

 

Once Firebase is configured in your project:

  1. Ensure your application is built and ready if you are using a framework that requires building (such as React, Angular, etc.).

  2. Deploy your application to Firebase Hosting:

    firebase deploy

 

Step 3: Connect a Custom Domain

 

  1. In the Firebase Console, navigate to the Hosting section.

  2. Click on "Add custom domain".

  3. Enter your custom domain that you want to connect to Firebase.

  4. Verify your domain ownership:

  • Firebase will provide a TXT record for you to add to your domain's DNS records.

  • Access your domain registrar's DNS management console and add the TXT record provided by Firebase.

  1. Once the TXT record is added, return to Firebase Console and click "Verify" to check domain ownership.

 

Step 4: Update Domain DNS Records

 

  1. After verification, Firebase will give you two A records.

  2. Go back to your domain's DNS settings and add these A records. These records will point your domain to Firebase's IP addresses.

 

Step 5: Check Domain Connectivity

 

  1. DNS changes might take some time to propagate, often within a few hours.

  2. You can check if the domain is properly connected by accessing your custom domain in a browser.

  3. If successful, your Firebase-hosted site should be displayed.

 

Step 6: Configure Firebase Hosting for HTTPS

 

  1. Firebase automatically provisions an SSL certificate for your domain, providing HTTPS support by default.

  2. Ensure HTTPS is active by checking the Firebase Console, under your Hosting settings.

 

That's it! Your custom domain should now be set up with Firebase Hosting, and your website accessible via this domain, with HTTPS enabled.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022