Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › cloud storage

How to Create a Website on a Google Cloud Server: Static Hosting, HTTPS, and DNS

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

For a static website, the simplest Google Cloud setup is a Cloud Storage bucket containing your HTML, CSS, JavaScript, images, and error page. A custom domain can point to that content over HTTP, but custom-domain HTTPS requires an external Application Load Balancer with a Google-managed SSL certificate in front of the bucket. If your site runs server-side code, use a managed application service or virtual machine instead of a bucket.

This guide walks through project setup, file upload, index and 404 configuration, public or private access, HTTPS, DNS, testing, costs, and the point at which Cloud Storage is no longer the right hosting model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As an Amazon Associate I earn from qualifying purchases.

Which Google Cloud service should host your website?

Choose the service according to whether the site needs only browser-delivered files or also needs a server-side runtime.

Service Best fit Operational control Scaling and HTTPS considerations
Cloud Storage Static HTML, CSS, JavaScript, images, fonts, and downloads Lowest operational overhead; no operating system to patch Use a bucket for the files; custom-domain HTTPS uses an external Application Load Balancer and certificate
App Engine standard Managed web applications and static assets with an app.yaml configuration Google manages the runtime platform Provides a project subdomain and supports custom-domain mapping
Compute Engine Sites that need a virtual machine, operating-system access, or traditional server software Highest control; you administer the VM, web server, updates, and firewall You design the web-server and load-balancing arrangement
Cloud Run Dynamic or containerized web applications Deploy a container without managing the underlying servers Suitable when the application needs code execution rather than file-only delivery
Google Kubernetes Engine Containerized systems that require Kubernetes orchestration Most orchestration control and operational complexity Use when cluster-level scheduling, networking, or multi-service deployment is a requirement

Cloud Storage is the direct path when every request can be answered by an existing file. A contact form that sends mail through a backend, a shopping cart, a database-backed login, PHP, Node.js server code, or another server-side process requires App Engine, Cloud Run, Compute Engine, GKE, or a separate backend.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

What do you need before creating the site?

  • A Google Cloud project that you can administer.
  • Billing enabled on that project. The documented static-site workflow uses billable storage and networking resources.
  • A domain that you own or manage if you want a branded address.
  • A finished site directory containing index.html. Add 404.html so unknown paths show a useful page.
  • For the HTTPS workflow, permission to enable the Compute Engine API and obtain Storage Admin and Compute Network Admin roles, or an administrator who can perform those actions.
  • A decision about whether objects may be publicly readable or whether the bucket must remain private behind load balancing and, optionally, Cloud CDN.

Keep the project ID, bucket name, chosen bucket location, and the exact hostnames you intend to use (for example, the root domain and www) in a deployment note. Bucket names are globally scoped, so a name already used elsewhere cannot be reused.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do you create the project and enable billing?

  1. Open the Google Cloud Console and create a project, or select an existing project dedicated to the website.
  2. Attach an active billing account. Without billing, the load-balancing portion of the HTTPS design cannot be used.
  3. For an HTTPS deployment, enable the Compute Engine API in APIs & Services → Library.
  4. Ask an administrator to grant the deployment identity Storage Admin and Compute Network Admin roles if your account does not already have them. Use narrower custom roles in a production organization when your security policy requires least privilege.
  5. Install and authenticate the Google Cloud CLI if you prefer commands, then select the project:
gcloud auth login
gcloud config set project PROJECT_ID

Replace PROJECT_ID with the actual project identifier. Console users can complete the rest of the procedure without running these commands.

How do you prepare and upload website files?

Place all browser-delivered assets under one local directory. Confirm that links use the correct case, that referenced files are present, and that the homepage is named exactly index.html.

Create the Cloud Storage bucket

  1. In Cloud Storage → Buckets, select Create.
  2. Choose a globally unique bucket name. A bucket name does not have to match your domain.
  3. Select a location suited to your users and organizational requirements. The documented workflow does not prescribe one universal location.
  4. Choose the access-control model. Uniform bucket-level access is generally easier to administer; do not disable public-access protections unless you have deliberately chosen public hosting.
  5. Create the bucket.

With the CLI, the equivalent creation command is:

gcloud storage buckets create gs://BUCKET_NAME --location=LOCATION

Replace both capitalized values before running the command.

Upload the site

In the console, open the bucket and select Upload files or Upload folder. Preserve the directory structure so relative links continue to work.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To upload a local site directory with the CLI:

gcloud storage cp --recursive ./site/* gs://BUCKET_NAME

Run the command from the directory that contains the site folder, or change the path to your actual build output directory. Upload a new copy whenever you publish a release; a build system can run the same command after generating production assets.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

How do you set the homepage and 404 page?

Cloud Storage needs an explicit main-page suffix and error-page name to behave like a website rather than a file store.

  1. Open the bucket’s Configuration tab.
  2. Set Main page or MainPageSuffix to index.html.
  3. Set Error page or NotFoundPage to 404.html.
  4. Save the changes, then verify that both files exist at the bucket’s top level.

The CLI form is:

gcloud storage buckets update gs://BUCKET_NAME 
  --web-main-page-suffix=index.html 
  --web-error-page=404.html

A missing or incorrectly capitalized filename is a common reason the root address displays an XML listing, a generic error, or a blank response instead of the homepage.

Should the bucket be public or private?

Public hosting is the shortest path for a straightforward static site, but every object granted to allUsers is readable from the public internet. Never store passwords, private documents, API keys, customer exports, or other confidential material in a publicly readable bucket.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Public bucket

For the basic tutorial, grant unauthenticated users the Storage Object Viewer permission at the bucket level, then verify that public-access-prevention settings do not block the change. Make only the website bucket public; keep unrelated storage in separate private buckets.

Private bucket behind a load balancer

A private bucket can sit behind Cloud Load Balancing, with the load-balancer path serving the website and the bucket remaining inaccessible as a standalone public object store. Cloud CDN can be added when caching at the edge is useful. This design reduces direct bucket exposure but adds configuration and billable networking components, so test permissions before switching traffic.

How do you serve the site over a custom domain with HTTPS?

Cloud Storage does not provide custom-domain HTTPS by itself. Google Cloud’s documented design places an external Application Load Balancer in front of the bucket, attaches a Google-managed certificate to the HTTPS frontend, and sends requests to a backend bucket.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

“Cloud Storage doesn’t support custom domains with HTTPS on its own, so you also need to set up an SSL certificate attached to an HTTPS load balancer to serve your website through HTTPS.” — Google Cloud Documentation, “Host a static website”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Reserve a global external IP address

In VPC network → IP addresses, reserve a global, external IPv4 address. Record the address; it is the value your DNS A record will use. A regional address is not interchangeable with the global address required by this external frontend.

2. Create the backend bucket

In Network services → Load balancing, start an external Application Load Balancer and choose a backend bucket. Select the Cloud Storage bucket that contains the site. Enable Cloud CDN only if its caching behavior and additional charges fit the project.

3. Configure the URL map and frontend

Use the bucket as the default backend and create an HTTPS frontend on port 443. Associate the reserved global IP address with that frontend. If you also want HTTP, create an HTTP frontend that redirects to HTTPS rather than serving a second independent copy of the site.

4. Create a Google-managed certificate

Create the certificate with every hostname you plan to serve, such as the root domain and www. Google documents a limit of 100 domains per certificate. The certificate remains unusable until both its certificate status and its domain status become active.

5. Attach the certificate and finish the load balancer

Select the managed certificate in the HTTPS target proxy or the corresponding console field, complete the forwarding rule, and wait for the configuration to propagate. The load balancer’s frontend IP is the only address that should be published in DNS.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

How do you connect the domain to Google Cloud?

At the DNS provider that controls your domain, create an A record for each hostname that should resolve to the site.

Hostname Record type Value When to create it
Root domain, such as example.com A Reserved global load-balancer IP If visitors should reach the site without a subdomain
www A The same load-balancer IP If the site should answer at www.example.com

Do not point the record at the bucket name or an individual object. If your DNS provider offers an alias or flattening feature for the root, use the provider’s documented equivalent only when it ultimately resolves to the load-balancer address. Keep any old conflicting A or AAAA records in mind; they can send some visitors to a previous host.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How long does HTTPS activation take, and how do you verify it?

Google says a managed certificate may take up to 60–90 minutes to provision. During that period, the site can resolve to the correct IP while the certificate still reports provisioning.

  1. Check that every hostname in the certificate has the intended A record and no conflicting record.
  2. In the load-balancer or certificate view, wait for both certificate status and domain status to show active.
  3. Open the root URL over HTTPS in a private browser window.
  4. Request a known static asset, such as /styles.css, and confirm a successful response.
  5. Request a deliberately missing path and confirm that 404.html is returned.
  6. Inspect browser developer tools for mixed-content warnings. Change any hard-coded HTTP asset URLs to HTTPS or relative URLs.

Test from more than one network if the DNS change was recent. Resolvers can retain old answers until the previous record’s time-to-live expires.

What are the common failure modes?

Symptom Likely cause Fix
The root URL shows an object list or does not load index.html Main-page suffix is missing, points to another filename, or the file is not at the bucket root Set MainPageSuffix to index.html and verify the object path and capitalization
Unknown paths show a generic error No error-page setting, or 404.html was not uploaded Upload the file at the expected location and set NotFoundPage to 404.html
Objects return permission denied The bucket is private, public-access prevention blocks the intended policy, or the load-balancer backend cannot read it Choose public access deliberately, or correct the private backend permissions instead of making unrelated buckets public
HTTPS certificate remains pending DNS does not point every certificate hostname to the load balancer, or provisioning is still in progress Correct the A records, remove conflicts, and allow the documented provisioning window to pass
The domain resolves but displays an old website Another A/AAAA record or cached DNS answer is still being used Inspect authoritative DNS, remove obsolete records, and retest after TTL expiry
CSS or images fail while HTML loads Incorrect relative path, case mismatch, or an asset omitted from the upload Compare the requested URL with the bucket object name and re-upload the complete build output
HTTPS loads but browsers report insecure content HTML or scripts reference http:// resources Use HTTPS URLs or root-relative paths and rebuild the site
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What does Google Cloud website hosting cost?

There is no single flat hosting price for this design. The official static-site tutorial uses billable Cloud Storage and Cloud Load Balancing components. Your bill can also include network egress, data retrieval, load-balancer processing, and optional Cloud CDN charges.

  • Storage charges depend on the amount and class of data stored.
  • Network and retrieval charges depend on where visitors are located, how much they download, and whether data is retrieved from a storage class with retrieval pricing.
  • Load-balancer charges apply even when the files themselves are small.
  • Cloud CDN can change both performance and the cost profile because cached and uncached traffic are accounted for differently.
  • A managed certificate does not remove the networking charges of the HTTPS frontend.

Use Google Cloud’s Pricing Calculator with your expected stored gigabytes, monthly requests, egress volume, and load-balancer configuration. Set a budget alert, review billing reports after the first traffic period, and delete unused resources when a test deployment ends.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

How do you keep a Google Cloud website secure and maintainable?

  • Keep secrets and private data outside the public website bucket.
  • Separate production, staging, and unrelated files into different buckets or projects.
  • Use a private bucket and controlled backend when public object access is not acceptable.
  • Build the site locally or in CI, then upload only the generated production directory.
  • Check the bucket, load balancer, certificate, DNS records, and billing status after each major change.
  • Retain a small test object and a deliberate missing path so future deployments can verify both normal and error behavior.
  • When retiring the site, remove the load balancer, reserved IP, certificate, bucket, and project resources that are no longer needed. Leaving any one of these active can continue to incur charges.

When should you move beyond Cloud Storage?

Move to a runtime service when the request must execute code or maintain state. Cloud Run is a practical fit for a containerized application; App Engine standard provides a managed application environment with an app.yaml; Compute Engine gives you operating-system and web-server control; and GKE is intended for Kubernetes-based orchestration.

You can keep the static frontend in Cloud Storage while placing APIs, authentication, payments, or other dynamic features on one of those services. Define the API hostname and access policy separately, and do not expose credentials in JavaScript shipped to browsers.

What should you check before going live?

  • The selected project has billing enabled and the required APIs and roles are in place.
  • index.html and 404.html are uploaded with the correct case.
  • Main-page and error-page settings are saved.
  • The chosen public or private access model matches the data in the bucket.
  • The global external IP belongs to the intended load balancer.
  • Every production hostname has an A record to that IP.
  • The managed certificate and domain statuses are active.
  • HTTPS, a real asset, a missing path, mobile layout, and browser console output have all been tested.
  • Budget alerts and a cleanup plan are configured.

Frequently Asked Questions

Can a Cloud Storage website run PHP, Node.js, or Python code?

No. A bucket returns stored objects and does not execute server-side programs. Keep the static files in Cloud Storage and place code that handles forms, sessions, or APIs on a runtime such as Cloud Run, App Engine, Compute Engine, or GKE.

Do I need to move my domain’s DNS hosting into Google Cloud?

No. You can leave DNS with your registrar or another DNS provider. You only need authority to create the required records that resolve your chosen hostnames to the load balancer’s external IP.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What happens if I publish a file with the wrong capitalization?

Cloud Storage object paths are case-sensitive, so a link to /Images/logo.png will not find an object stored as images/logo.png. Match URL case to object names or rename the files during your build.

Can I use the same bucket for staging and production?

It is safer to separate them. Distinct buckets or projects prevent a test upload, access-policy change, or accidental deletion from altering the live site and make billing and permissions easier to audit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

cloud storageDNSGoogle CloudHTTPSStatic Websiteswebsite hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.