Connect a Custom Domain

Firebase Hosting can connect to your own custom custom domain, like https://example.com or https://myrealtimeapp.example.com. Firebase Hosting provisions an SSL certificate for your domain and serves your content over a global CDN.

Verify domain ownership

Before connecting a custom domain, you'll need to deploy your site to its firebaseapp.com subdomain. This will give you access to the hosting admin panel, where you'll be able to see a history of deploys and manage custom domains.

From the Hosting panel of the Firebase Console for your project, select Connect a Custom Domain.

Enter the domain that you would like to use in the input and then select Continue.

You will need to update the DNS entries for your domain by adding two TXT entries. The entries are available from the Hosting panel once your custom domain has been checked that the domain is valid and hasn't already been taken. Depending on your domain provider, this verification step may be instant or it may take an hour or more.

If you're using Google Domains as your registrar, you'll need to create one TXT record with two values instead. A similar technique may work for other registrars that permit only one TXT record.

Wait for SSL certificate provisioning

Once domain ownership is verified we will provision an SSL certificate for your domain and deploy it across our global CDN. This process can take 24 - 48 hours.

Activate your domain

Now you need to point the DNS records for your domain to our service. The specific A or CNAME DNS records are displayed in the Firebase Console once your domain's certificate is activated. Once your DNS changes have propagated, users will be able to access your Firebase Hosting site on the connected domain.

Subdomain redirects with custom domain

If you have a custom domain enabled you can configure arbitrary subdomains to point to it by adding CNAME records to your domain name server. Every subdomain will redirect to the chosen custom domain with the 301 HTTP status code.

For example, if your chosen custom domain is realtime-all-day.com and you add a CNAME record for www to point to Firebase Hosting, then visitors to https://www.realtime-all-day.com will be redirected to https://realtime-all-day.com.

As another example, if you specify a subdomain as part of your chosen custom domain, such as www.realtime-all-day.com and configure the A record of your domain to point to Firebase Hosting, then all requests to https://realtime-all-day.com will redirect to https://www.realtime-all-day.com.

You can redirect all subdomains to your chosen domain by configuring a wildcard CNAME record in your DNS server.

Send feedback about...

Need help? Visit our support page.