With firebase hosting how do I change the domain name
Asked Answered
N

3

7

I have previously configured firebase hosting successfully but now want to change the domain name I am using.

It appears you can Edit the current domain name but this doesnt seem to do anything that I can see when I enter a new domain name.

Not sure how to proceed.

Thanks, Craig.

Noncombatant answered 21/4, 2015 at 10:11 Comment(1)
Hey Craig, you'll have to reach out to [email protected] for that.Chancellery
N
9

So I sent an email to firebase support and this process involves removing your current domain and adding a new domain which involves some downtime whilst they procure a new SSL certificate, etc.

If anyone is attempting to do this and does not want to incur any downtime its not too difficult. The highlevel process I have followed to move from olddomain.com to newdomain.com without downtime is detailed below:

  1. Procure another temp server (i.e. amazon or whatever) and bring up nginx
  2. Deploy your static files (css, js, html, jpg, etc) to this temporary server
  3. Procure a cert for olddomain.com and deploy it on your server. You can get some free ones for a month if you have a search (dont want to endorse any particular product here)
  4. Ensure the site is running as olddomain.com on your temp server (hack you hosts file to force your domain name to point at the new temp server.
  5. If all good, modify your DNS for olddomain.com so it points at your temp server.
  6. Wait a few hours to ensure all traffic going to your temp server (look at w3c style logs to ensure traffic is coming in)
  7. You can now safely remove your olddomain.com and setup newdomain.com under firebase hosting without losing traffic to olddomain.com
  8. Once newdomain.com setup and running on firebase hosting, configure olddomain.com to do a redirect to newdomain.com. May want to leave this up for a while depending upon how much traffic you are expecting to olddomain.com.
  9. Job done without any downtime :)

Hope these steps are of use to others.

Thanks.

Noncombatant answered 22/4, 2015 at 9:48 Comment(1)
Glad to hear your got it sorted Craig. And thanks for the great step-by-step write-up.Chancellery
Q
3

I created a new project with the desired domain name, then switched to the new project using the firebase use <project_id> command from Firebase CLI.

Quinton answered 9/10, 2022 at 15:57 Comment(0)
E
3

I think changing domain names must have become easier with Firebase in 2023. All I needed to do was:

  1. Log into the Firebase web admin
  2. Select the project
  3. Click Hosting in the sidebar
  4. Click the blue "Add custom domain" button
  5. Add the new domain and set it up
  6. Hover over the old domain, click the 3 dots on the right, and click "Delete domain".
Eversion answered 16/4, 2023 at 22:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.