Firebase Hosting Custom Domain
Every Firebase Hosting site gets a free subdomain like your-project.web.app. You can also connect your own domain — like www.yourbrand.com — to your Firebase-hosted site. Firebase handles the SSL certificate for your custom domain automatically and renews it before expiry.
What You Need
- A domain name you own (purchased from a registrar like GoDaddy, Namecheap, Google Domains, or Cloudflare)
- Access to your domain's DNS settings at the registrar
- Your app deployed to Firebase Hosting
How Custom Domain Connection Works
User types: www.yourbrand.com
|
v
DNS resolves to Firebase's IP addresses
|
v
Firebase checks which project owns this domain
|
v
Firebase serves your hosted app
|
v
Browser shows: https://www.yourbrand.com
Step 1 — Add a Custom Domain in the Console
Go to the Firebase Console and click Hosting in the left sidebar. Click Add custom domain. Enter your domain name, for example: www.yourbrand.com. Click Continue.
Step 2 — Verify Domain Ownership
Firebase generates a TXT record for you to add to your domain's DNS settings. This proves you own the domain.
Type: TXT Name: @ (or leave blank — depends on your registrar) Value: firebase=abc123xyz...
Log into your domain registrar, find the DNS management section, and add this TXT record. DNS changes can take a few minutes to a few hours to propagate. Firebase automatically detects when the record is live and moves to the next step.
Step 3 — Add A Records
After verification, Firebase shows two IP addresses. Add them as A records in your DNS:
Type: A Name: @ (for root domain) or www (for www subdomain) Value: 151.101.1.195 Type: A Name: @ (or www) Value: 151.101.65.195
Add both A records. Firebase uses both IP addresses for redundancy — if one is unavailable, traffic routes to the other.
Step 4 — Wait for SSL Certificate Provisioning
Firebase automatically provisions an SSL certificate for your custom domain using Let's Encrypt. This process takes a few minutes after DNS propagates. While provisioning, the Console shows "Certificate pending." Once done, your site loads with HTTPS on your custom domain.
Connecting a Root Domain vs Subdomain
Two common configurations:
Root domain: yourbrand.com (no www) Add A records pointing @ to Firebase IPs Subdomain: www.yourbrand.com Add A records pointing www to Firebase IPs Add a redirect from yourbrand.com to www.yourbrand.com at your registrar
Most registrars offer a redirect or forwarding setting in DNS that redirects the root domain to the www version. This ensures users reach your site whether or not they type www.
Connecting a Firebase-Managed Domain via Cloudflare
If you use Cloudflare as your DNS provider, disable Cloudflare's proxy (orange cloud) for the A records pointing to Firebase. Set them to DNS-only (grey cloud). Firebase needs to handle the SSL certificate itself — Cloudflare's proxy interferes with Firebase's certificate provisioning.
Cloudflare DNS record: Type: A Name: www Value: 151.101.1.195 Proxy: DNS only (grey cloud, NOT orange cloud)
Removing a Custom Domain
Go to Hosting in the Firebase Console, find the custom domain in the list, click the three-dot menu, and select Remove. Firebase stops routing traffic to that domain. Remove the corresponding DNS records at your registrar to fully disconnect.
Multiple Domains per Project
One Firebase project supports multiple custom domains. A business might connect www.yourbrand.com for the main site and app.yourbrand.com for the logged-in application — both served by the same Firebase Hosting project or different targets within it.
Key Takeaway
Connecting a custom domain to Firebase Hosting takes three steps: add the domain in the console, verify ownership with a TXT DNS record, and add A records pointing to Firebase's IP addresses. Firebase handles the SSL certificate automatically. When using Cloudflare, disable proxy mode for the A records to let Firebase manage SSL. The entire process takes anywhere from a few minutes to a few hours depending on DNS propagation speed.
