8

I want to host some html files on Google Cloud and wondered, if this is possible to do, without adding a custom domain...

With for example Cloudflare or AWS, that's possible...

1
  • can noone answer this?
    – Ben Tailer
    Mar 20, 2018 at 20:22

2 Answers 2

11

GCS objects can be loaded just fine from a web browser, with or without a domain. They follow either of these naming schemes:

https://storage.googleapis.com/YOUR_BUCKET_NAME/YOUR_OBJECT_NAME
https://YOUR_BUCKET_NAME.storage.googleapis.com/YOUR_OBJECT_NAME

If you simply need to serve resources via a web browser, this is quite sufficient.

If you need a bucket to represent an entire website, it'd be a good idea to use a custom domain. This enables a handful of nice, website-like features, such as defining default pages when none is specified as well as providing a customization 404 page.

2
6

You have three options (well, only two of them are really viable, but the last one can be useful in certain situations).

In order of ease to use and viability:

1) Google App Engine:

The default Google App Engine app is served out of *.appspot.com site, so if you create a project call "cutekittens", your site address will be cutekittens.appspot.com.

Furthermore, you can choose to do something simple like a static webpage, or you can host an entire webapp on Google App Engine. It's easy to use and very powerful. Google App Engine supports its own storage (Datastore), bigdata (Big Query), and MySQL (Cloud SQL) solutions and all of that can be served out of the default appspot.com site which acts the the front end.

2) Static Website on Google Cloud Storage. Google Cloud Storage is less powerful but should suffice if you just need a static website served. It uses "storage.googleapis.com/[BUCKET_NAME]/[OBJECT_NAME]", in which your object is probably an index.html.

3) Use a Google Compute Engine VM on static IP. This option is probably the MOST powerful, as you can do anything you want on your own VM. However this is also the less friendly usage since you will need the actual IP address to access the site and its resources.

2
  • Ok, thank you! Does this work? "console.cloud.google.com/storage/[BUCKET_NAME]/[OBJECT_NAME]" or just "storage.googleapis.com/[BUCKET_NAME]/[OBJECT_NAME]" ?
    – Ben Tailer
    Mar 21, 2018 at 15:17
  • No. That's just your console link, it's not the bucket link.
    – Ying Li
    Mar 21, 2018 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.