How do I remove a hosted site from firebase
Asked Answered
T

13

153

I have a hosted site on firebase which I am not using anymore. I still want to keep the project but want to remove the hosted site. Is there any way to do this or do I just need to upload an empty directory. Doesn't seem to be an option in the UI

Tweak answered 4/3, 2017 at 1:35 Comment(4)
You can run firebase hosting:disable from the CLIDeadeye
That disables the last deployment, but I have a whole list of old deployments I want to get rid of.Tweak
How to enable again after that? firebase hosting: enable?Alboin
To disable a different target / site: firebase hosting:disable --site <site name>. Target syntax is usually hosting:<target> but in this case I couldn't find a way to specify a target while using the :disable commandHairball
C
270

It can be deleted.

  1. Run firebase hosting:disable through the firebase-tools CLI first.
  2. Go to Firebase Console and select Hosting from the menu of the left.
  3. You will see the deployed project with a list of your historical actions like Deployed, disabled, etc.
  4. Only after you have disabled the site, the "three vertical dots" menu will be available for you to choose the action to delete the deployment.
Candelabrum answered 16/6, 2017 at 8:15 Comment(4)
This seems to have a few votes but I can't test this works any longer. I just changed the billing to the free version so I don't get charged $0.02 a month from google anymore. If someone can confirm that this works for them I'll accept it as the correct answer.Tweak
Confirmed, status changes to deleted. When I go to the Usage tab on the same page the my storage size drops, after a few minutes.Dorsy
For the record, running firebase hosting:disable does not delete nor disable Firebase functions. I didn't find any documentation and had to try this the 🙈 way.Approximate
Is there a way to disable multiple sites? firebase hosting:disable seems to only disable the main site for your firebase projectStanwood
I
33

If you have multiple site hosted in same project, then use -s flag to specify the site you want to disable.

firebase hosting:disable -s yoursitename
Inversely answered 10/7, 2020 at 6:16 Comment(0)
D
11

You don't need to upload empty directory.

Just open your project's root directory and enter the following command

firebase hosting:disable

CLI Response :

$ firebase hosting:disable
? Are you sure you want to disable Firebase Hosting for the site xyz
This will immediately make your site inaccessible! Yes
✔  Hosting has been disabled for xyz. Deploy a new version 
to re-enable.

This will instantly disable running website also adds a Disabled status in release history. Tested on firebase CLI version 9.20.0

Danit answered 18/10, 2021 at 13:58 Comment(0)
V
7

[Update]

For multiple site hosted !! use command

firebase hosting:disable --project yoursitename

for me it work!! Can your try?

Version answered 23/6, 2021 at 9:29 Comment(0)
V
6

It's a bit hidden, but here are the steps:

  1. Go to the Firebase Hosting console for your project, you will see your domain.
  2. Hover over your domain. There's an overflow menu ( three vertical dots) on the right.
  3. From the overflow menu select Delete Domain
Verleneverlie answered 4/3, 2017 at 3:10 Comment(8)
That will delete the domain but not the actual deployed site. It is still taking up space on google cloud.Tweak
When you hover over non-active versions of your site in the same Firebase Hosting console, you will also see an overflow menu with the option to delete that deployed version.Verleneverlie
Hmm, I have a lot of previous deployments. That would be pretty painful to go through all of themTweak
This no longer works. The overflow menu won't appear.Keesee
I just checked and the overflow menu is still there for me. If you're having problems with this, reach out to Firebase support for personalized help in troubleshooting.Verleneverlie
works for me too! But would be nice to be able to delete a bunch via CLIUnharness
That sounds useful indeed, so I'd file a feature request.Verleneverlie
I did firebase hosting:disable and it returned with Hosting has been disabled Then deleted the deployment in the console. But I can still access the app. Oops, no that was my browser cache. It is deletedSynod
T
5

You can use the following command:

firebase hosting:disable -s <firebase_project_name>

replace <firebase_project_name> with the name of your firebase project. This allows you to unsubscribe from the current project and place it in disable mode and you cannot receive traffic from the published web page. When you want to re-enable it, you can do it from the visual platform. I leave an image attached so that you can be guided.

enter image description here

Thriller answered 16/7, 2020 at 20:38 Comment(1)
There's an extra space between '-s' there in your answer. But yes, -s lets you specify the site you want to disable from firebase hosting:disable.Zoellick
B
5

Manually

You can easily go to the console, and click on the 3 vertical dots and delete the site.

enter image description here

Using CLI

Disable only

Stops serving Firebase Hosting traffic for the active Firebase project.

Your project's Hosting URL will display a "Site Not Found" message after running this command.

If you want to disable, as the other answers are saying use this command:

firebase hosting:disable

If you're using multi-sites, you have to specify the project name:

firebase hosting:disable --project yoursitename

Delete forever

Deletes the specified Hosting site.

Deleting a site is a permanent action. If you delete a site, Firebase doesn't maintain records of deployed files or deployment history, and the site cannot be reactivated by you or anyone else.

(Optional) Skip the confirmation prompt by passing the following flags: -f or --force

To delete this site (similar to when you go to the console > delete manually) run this command:

firebase hosting:sites:delete yoursitename -f 

Be careful when using the -f, but if you're running this as a script command, it might be required.

Bilodeau answered 22/7, 2022 at 13:7 Comment(1)
It is worth noting that you can disable, but not delete the default hosting site. The CLI will output the following error. Error: HTTP Error: 400, Cannot delete default Hosting SiteNatation
S
2

I spent too much time on this and hopefully this can be helpful. I did deploy my stuff using firebase deploy however I was not able to see in on the firebase console. When I tried firebase hosting:disable I got this Error: HTTP Error: 400, Invalid project ID specified.

The steps below helped me delete my project.

  • To find the project, you have to get the output of firebase deploy which will have a console url that looks like this: Project Console: https://console.firebase.google.com/project/<your-project-id>/overview.

  • Follow this link and go to project settings. You should be able to
    delete your project in there.

Selfinduction answered 12/7, 2018 at 22:56 Comment(0)
F
1

I had to spend several hours removing the default website on Firebase hosting.

The way that I found was :

Enter "firebase init database" in Terminal. It initialize all websites including the default one so that you can set up a new one.

I hope it helps you.

Feuar answered 17/7, 2022 at 4:42 Comment(0)
D
0

Easy solution in 2024.

  • Access the Firebase console and select 'Hosting'.
  • View all hosted sites.
  • Each site has a '3-dot' menu.
  • Click to find and select the 'Delete site' option.

enter image description here

Donaldson answered 5/2, 2024 at 10:36 Comment(0)
D
0

A comment suggests changing the billing to free plan. In my case it keeps changing back to "Pay as you go" after successfully selecting the no-cost "Spark" plan.

However I did the following to successfully render my site as not found.


Douce answered 25/2, 2024 at 9:24 Comment(0)
N
-4

As of now there is no proper way to bulk delete all the previous deployments in a project.

However the best thing you can do is to empty the firebase hosting folder and then deploy it using firebase deploy

This option has been given as a feature request to firebase. Lets hope its get implemented soon :)

Natividadnativism answered 16/6, 2017 at 10:6 Comment(1)
You cannot empty the hosting folder. Firebase deploy complains that index.html doesn't exist. And, if you delete the folder entirely the console will not even attempt to deploy hosting. Your only option is to create a blank index.html file and basically deploy a skeleton project. Not ideal.Turbidimeter
S
-5

1.Sign in to Firebase, then open your project.

2.Click the Settings icon near project Overview button, then select Project settings.

3.In the Your apps card, select the app that you want to delete.

4.Find the Delete Project button from bottom of the page , click Delete Project.

5.Check the points , then click Remove app permanently.


Seventeen answered 15/10, 2019 at 7:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.