Installing Ghost on a Firebase hosted site as a subdirectory

Hi all,

We’re building a site on Firebase (to be launched soon). We’ve previously had our Ghost blog hosted on an Azure web app (working so-so).

I have been able to install Ghost (via Bitnami) og Google Cloud (on a VM), however it seems like this is not easy to integrate with our Firebase hosted site.

My question is therefore:

  • Is it possible to install Ghost directly on Firebase Hosting (as a subdirectory)?
  • If not, is there a way to use rewrites (or other methods) with the Google Cloud VM instance?

Thank you so much for your help!

PS. I’ve read through most topics here on hosting as a subdirectory, but sadly hasn’t been able to find anything that fits my case (Although this might be because of ignorance)

You probably won’t easily be able to do this directly, Firebase really discourages you from doing anything outside of its own platform. You could set up a redirect in the firebase config to another domain name where Ghost is running, but I imagine you’re wanting to avoid that and keep everything on the same domain.com address. I’ve seen deployments where people have used a frontend load balancer and used that to proxy traffic to either the Firebase or Ghost backend servers based on URL. That might be more added complexity than you’re after, and would probably come at an extra cost.

1 Like

Thanks a lot for the reply! It makes a lot of sense.

You are quite right in terms of the domain setup - SEO is a major part of setting up the blog, and has max effect if it’s on a /blog address.

If a bit of complexity and cost is necessary that is ok. However, what kind of load balancer would you suggest? Google Cloud Platform’s own load balancer doesn’t seem to do the job, as the Firebase hosting is not directly hosted within GCP…

https://docs.ghost.org/faq/can-i-run-ghost-from-a-subdirectory/ provides at least some idea of how you’d do a subdirectory host with Ghost(Pro), but even the Ghost team recommend you really know exactly what you’re doing before setting it up that way.

The simplest way forward would be (like described in that document) a reverse proxy to forward traffic to the appropriate servers.

Vendors like Cloudflare have solutions that could in theory do this for you without you having to set up and maintain a Linux system yourself, but I’ve never used them.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.