How to host a static website for free using Google Cloud Platform


What is Google Cloud Platform ?

Google Cloud Platform is a data center infrastructure that Google uses for their products like Youtube, Search, etc. GCP is one of the popular cloud services especially for startups and websites since its price is cheaper and affordable than other cloud computing providers. Other popular cloud service providers are Amazon Web Services, Microsoft Azure, Oracle and IBM Cloud.

Google provides 300$ credit for free to new users. We can use this to host a new html site for free.

Steps for hosting a website in Google Cloud Platform :

  1. Signup for free quota from Google cloud website using your google account and validate credit card details.


  1. Then Create a project by giving your needed website name.

  2. Create an app in App Engine to your project
    Create an App

  3. To Deploy your website to the created app, download Google Cloud SDK from the link .

  4. Run Google Cloud SDK

  5. Initialize the Google cloud SDK with gcloud init command.
    Gcloud Init
    Next Step

  6. Create a website design for your startup in path_to_website_root_folder

  7. Point command prompt to the folder the website files exists
    cd ../../path_to_website_root_folder/

  8. Create app.yaml file and map website files in the website root folder. Follow the standards and code snippets in the link

  9. Deploy the app using command gcloud app deploy

  10. The files will be uploaded successfully and a subdomain will be generated on appspot domain. You can use that subdomain or connect your own domain to the project.

Previous Post Next Post