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.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Set Up Firebase Hosting
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
Log into Firebase using your Google account:
firebase login
Navigate to your Firebase project directory where you want to set up hosting.
Initialize Firebase in your project directory:
firebase initWhen 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:
Ensure your application is built and ready if you are using a framework that requires building (such as React, Angular, etc.).
Deploy your application to Firebase Hosting:
firebase deploy
Step 3: Connect a Custom Domain
In the Firebase Console, navigate to the Hosting section.
Click on "Add custom domain".
Enter your custom domain that you want to connect to Firebase.
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.
Step 4: Update Domain DNS Records
After verification, Firebase will give you two A records.
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
DNS changes might take some time to propagate, often within a few hours.
You can check if the domain is properly connected by accessing your custom domain in a browser.
If successful, your Firebase-hosted site should be displayed.
Step 6: Configure Firebase Hosting for HTTPS
Firebase automatically provisions an SSL certificate for your domain, providing HTTPS support by default.
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.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.