Firebase storage with custom domain?

4,605 views
Skip to first unread message

Eli Horne

unread,
Jan 14, 2017, 7:54:21 PM1/14/17
to Firebase Google Group
Hi - I've been diving into Firebase and loving every bit of it.  

I got an app running with hosting, database and storage all purring.  Now that I'm ready to put it behind the custom domain, I'm running into a specific problem with storage.


I'd love them to be served behind the custom domain that I've already associated with Firebase hosting.  I'd even settle for a sub domain, as long as it's on brand.

As far as I can tell from the documentation, Google Cloud Storage (the system behind Firebase Storage) only allows CNAME masking if the bucket is named something like "sub.domain.com" where you have verified that you own domain.com.

I've set up a bucket like this, but I can't seem to get firebase to look at any storage bucket other than the "app-name.appspot.com" bucket it initially created.

I've tried many things like:
Any tips or advice would be greatly appreciated.


Mike McDonald

unread,
Jan 25, 2017, 1:40:09 AM1/25/17
to Firebase Google Group
Hey Eli,

Glad you're liking Firebase Storage :)

The short answer is that we don't yet support non appspot.com domain buckets, and even if you could use one, it wouldn't change the domain the content is served off (it would still be firebasestorage.googleapis.com/your-non-appspot-bucket/...).

That said, you've piqued my curiosity: what's the use case for serving off your own domain? You mention branding, but I'm curious when people are going to use the actual links? Are these files shared with the known public URL and that's a main feature of the app? We've heard this a few times and I'm curious to hear more.

Would something like setting up GCS with Fastly (and your custom domain) work for the sharing use case?

Thanks,
--Mike

Thomas Yip

unread,
Feb 9, 2017, 10:50:38 AM2/9/17
to Firebase Google Group
Hi Mike,

For us, we would like to store different things on different buckets, perhaps use a different lifecycle management on each of them. It's just better organized, and it scares us to have everything in a single bucket. At the moment, because you don't support non appspot.com buckets, this means we are stuck on the default bucket. We can use another project, but that would involve separate payments, etc.

I would strongly request that you implement different buckets soonest, as that would make firebase stoarge so much more easier to use and to be able to store millions of files in different buckets rather than just one at the moment. Looking forward to your reply.

Thanks,
Tom

Eli Horne

unread,
Feb 24, 2017, 12:58:11 AM2/24/17
to Firebase Google Group
Thanks for the response.  I was able to solve my particular problem by setting up a Google Cloud Storage bucket (since they support custom domains), and then writing to it via my Node app, rather than via the Firebase web api.

My service hosts files which users then reference on their sites.  While it's not a deal breaker, it was less than ideal to expose what hosting provider I was using at this final moment in the user experience.

I could imagine not caring about things like user avatar image URLs, but in my case, the final file URL is a larger part of the product story.

Rishi Uttam

unread,
Jan 24, 2018, 11:00:13 AM1/24/18
to Firebase Google Group
Hi guys, I've actually got same problem. Im creating a file storage/sharing application for some of my vendors and the public. I am using sendgrid to send out emails via firebase cloud function triggers. This words well as sendgrid is able to mask(whitelist) the download link as if it were coming from my domain, but then the url changes to the downloadUrl which is appspot.com and kinda kills the branding altogether.  

What are other solutions for masking whitelisting a cname domain on firebase storage?  I am hoping that someone will reply saying this issue has been resolved and cname domains are supported!

Thanks.
Rishi

Daniel Krause

unread,
Mar 2, 2021, 5:47:39 AM3/2/21
to Firebase Google Group

Hi All

We're looking at solving the same problem.
Is this possible yet? Perhaps using a ALB pointed at the storage bucket?

Regards

Artem Bogush

unread,
Apr 28, 2022, 11:18:47 AM4/28/22
to Firebase Google Group
You can actually host content of storage under your custom domain. The approach is a bit different though and it can be achieved quite easily using firebase functions. I've found this idea on stackoverflow where it's described in a bit more details:

Reply all
Reply to author
Forward
0 new messages