Static Site Hosting on Google Cloud Platform (GCP)
Deploy your static sites with Google Cloud Storage and Cloud CDN for global performance and reliability
You can host static sites on GCP using Google Cloud Storage buckets and optionally serve them globally with Cloud CDN.
Method: Deploy with Google Cloud Storage
1. Prepare Your Static Site
- •Click on 'Save & Download' in ThemesForApp builder dashboard to get your site files.
- •Unzip the downloaded file to access your static site files (HTML, CSS, JS, assets).
2. Create a Google Cloud Project
- •Go to the Google Cloud Console (https://console.cloud.google.com/).
- •Create a new project or select an existing one.
3. Enable the Cloud Storage API
- •In the Cloud Console, navigate to APIs & Services > Library.
- •Search for 'Cloud Storage' and enable the API.
4. Create a Storage Bucket
- •Go to Storage > Browser and click 'Create bucket'.
- •Enter a globally unique name (e.g., your-site-name).
- •Choose a location type (Multi-region recommended for static sites).
- •Click 'Create'.
5. Upload Your Site Files
- •Click into your bucket and use the 'Upload files' or 'Upload folder' button to upload your static site files.
- •Ensure your index.html is at the root of the bucket.
6. Configure the Bucket for Website Hosting
- •In the bucket details, go to the 'Website configuration' tab.
- •Set 'Main page' to index.html and 'Not found page' to 404.html (if available).
- •Save the configuration.
7. Make Your Site Public
- •Go to the 'Permissions' tab in your bucket.
- •Click 'Grant access', add 'allUsers' as a new principal, and give it the 'Storage Object Viewer' role.
- •Save the changes.
8. Access Your Live Site
- •Your site will be available at https://storage.googleapis.com/[BUCKET_NAME]/index.html or the bucket's website endpoint.
- •You can map a custom domain using Cloud Storage and Google Cloud DNS if desired.
9. (Optional) Enable Cloud CDN for Global Performance
- •Set up a load balancer in Google Cloud and point it to your storage bucket.
- •Enable Cloud CDN on the backend bucket for faster global delivery.