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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For a static website, the simplest Google Cloud deployment is a Cloud Storage bucket containing your HTML, CSS, JavaScript, and image files. Configure index.html as the main page and an optional 404.html error page, then either use the bucket’s HTTP endpoint or put an external Application Load Balancer and Google-managed certificate in front of it for a custom domain with HTTPS.

This guide covers the complete setup, including project and billing prerequisites, upload commands, public versus private access, DNS records, certificate provisioning, testing, costs, and when a different Google Cloud service is a better fit.

What is the best way to create a website on a Google Cloud server?

It depends on whether your site is static or dynamic. A static site can run without a traditional server: Cloud Storage serves the files, while an external Application Load Balancer provides a custom-domain HTTPS endpoint. A site that executes PHP, Python, Node.js, or another server-side runtime needs a compute service such as App Engine, Cloud Run, Compute Engine, or Google Kubernetes Engine (GKE).

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.

Cloud Storage is usually the right starting point for a portfolio, documentation site, landing page, or front-end application whose files are built before deployment. It has no operating system to patch and scales without you managing virtual machines. Cloud Storage alone does not provide custom domains over HTTPS; HTTPS requires an SSL certificate attached to an HTTPS load balancer.

#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 I need before deploying?

  • A Google Cloud project that you can select or create.
  • Billing enabled on that project. The storage and load-balancing components used in the official static-site workflow are billable.
  • Website files, including an index.html file at the location you plan to upload. Add 404.html so unknown paths receive a useful page.
  • A domain that you own or manage if you want a branded address such as example.com or www.example.com.
  • For the HTTPS load-balancer procedure, the Compute Engine API enabled and permissions that include Storage Admin and Compute Network Admin.
  • A local installation of the Google Cloud CLI (gcloud) if you prefer commands to the Cloud Console.

Keep the site files in a local directory with the intended relative paths. A common layout is site/index.html, site/404.html, site/css/, site/js/, and site/images/. Uploading the directory contents rather than an extra enclosing directory prevents URLs from becoming /site/index.html.

Which Google Cloud service should host my website?

Choose the service according to whether you need a server-side runtime and how much infrastructure control you want.

Service Best fit Runtime and control HTTPS and scaling considerations
Cloud Storage Prebuilt static HTML, CSS, JavaScript, and images No server-side runtime; Google manages the storage service Custom-domain HTTPS uses an external Application Load Balancer and certificate; storage and network usage are metered
App Engine standard Managed applications and static files using an app.yaml configuration Google-managed runtime with a project subdomain and custom-domain mapping Automatic platform scaling; configure the app and domain mapping rather than a VM
Compute Engine Traditional web servers or applications needing operating-system control Virtual machine; you install and maintain the OS, web server, and runtime You manage capacity, patching, firewall rules, and the load-balancing design
Cloud Run Dynamic or containerized web applications Deploy a container; no VM administration Managed scaling for request-driven containers; configure the service’s domain and HTTPS path
Google Kubernetes Engine (GKE) Workloads that require Kubernetes orchestration Container clusters, deployments, services, and cluster-level control Most operational complexity; HTTPS and ingress depend on the cluster architecture

If your build produces only files, start with Cloud Storage. Move to a runtime service when requests must execute code, access a database securely, authenticate users on the server, or perform background work.

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

How do I create a Cloud Storage website bucket?

Create the project and bucket first, then configure the website document settings. Bucket names are globally unique, so choose a name that has not already been taken.

1. Select a project and enable billing

  1. Open the Google Cloud Console and create a project or select an existing one.
  2. Attach a billing account. Without billing, the storage and networking resources required for this deployment cannot be used normally.
  3. Record the project ID; you will use it in the CLI and when checking resources later.

2. Create the bucket

In the Cloud Storage section of the Console, choose Create, enter a globally unique bucket name, select a location, and finish the creation wizard. Pick a location appropriate for your audience and data-governance requirements; changing location later generally means creating another bucket and moving the files.

With the CLI, authenticate and select the project, then create the bucket:

gcloud auth login
gcloud config set project PROJECT_ID
gcloud storage buckets create gs://BUCKET_NAME --location=LOCATION

Replace the uppercase values with your project ID, bucket name, and chosen location. The command creates an ordinary storage bucket; it does not yet make objects public or configure website pages.

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.
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.

3. Upload the site files

From the directory that contains your site files, upload the contents recursively:

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

Alternatively, use the bucket’s Upload files and Upload folder actions in the Console. Confirm that index.html is at the bucket’s top level (or at the exact prefix you intend to serve).

4. Set the main and error pages

Configure the main-page suffix as index.html and the not-found page as 404.html:

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

In the Console, open the bucket, go to its website configuration, and enter the same two filenames. A request for a directory-like URL can then resolve to that directory’s index.html, while an unknown object can return your custom error document.

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

Should the bucket be public or private?

Public objects are the straightforward option for the basic HTTP tutorial: browsers can fetch the files directly from Cloud Storage. A private bucket is safer when the content should not be generally readable; place it behind Cloud Load Balancing (and, if needed, Cloud CDN) so the bucket is not directly exposed.

Public bucket trade-off

Granting public object viewing means anyone who can discover an object URL can request it. Never put passwords, API keys, customer records, backups, or other confidential data in a publicly readable bucket. Review every uploaded file, including source maps and configuration files, before changing access.

The exact IAM change depends on your organization’s policy. Where public access is allowed, the CLI pattern is:

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.
gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME 
  --member=allUsers 
  --role=roles/storage.objectViewer

If your organization enforces public-access prevention, this command will be rejected; use a private backend design instead of weakening the policy.

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

Private backend trade-off

A private bucket limits direct reads and lets the load-balancing layer be the public entry point. This adds configuration and permission work, but is preferable for content that must not be reachable through a raw storage URL. Test the load-balancer path rather than assuming bucket-level permissions are correct.

How do I publish the site over a custom domain with HTTPS?

Cloud Storage does not terminate HTTPS for a custom domain by itself. The supported pattern is an external Application Load Balancer with a backend bucket, a Google-managed SSL certificate, a reserved IP address, and DNS A records pointing your hostname to that address.

1. Enable the required API and permissions

Enable the Compute Engine API in the project. Ensure your account has Storage Admin for bucket and object work and Compute Network Admin for the load-balancing resources. Organizations may separate these duties; in that case, coordinate with an administrator rather than granting broad permissions unnecessarily.

2. Reserve a global static IP address

In the Console, open VPC network > IP addresses, reserve an external, global IPv4 address, and keep the address name and value. A static address prevents your DNS record from changing when the load-balancer configuration is updated.

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

3. Create a Google-managed certificate

In Certificate Manager or the load-balancer certificate workflow, create a Google-managed certificate and list every hostname you intend to serve, such as the apex domain and www. One certificate can contain up to 100 domains according to Google’s current tutorial guidance. The certificate is not usable until both its certificate status and domain status are active.

4. Create the load balancer and backend bucket

  1. Start an Application Load Balancer with an external, global frontend.
  2. Create a backend bucket that points to your Cloud Storage bucket. Enable Cloud CDN only if its caching behavior and additional charges fit your site.
  3. Configure a URL map so requests for the selected hostnames use that backend bucket.
  4. Create an HTTPS frontend using the reserved global IP, port 443, and the Google-managed certificate.
  5. If you want HTTP requests redirected, add an HTTP frontend and redirect rule. Otherwise, test only the HTTPS hostname.

The Console wizard names these objects differently depending on the interface version, but the required relationships remain the same: HTTPS frontend, certificate, URL map, backend bucket, and global IP.

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

5. Point DNS at the load balancer

At your DNS provider, create A records for each hostname you included in the certificate. For an apex domain, create an A record for @ (or the provider’s equivalent); for www.example.com, create an A record for www. Set each value to the reserved load-balancer IP. Do not point the records at the bucket’s storage hostname when using the HTTPS architecture.

6. Wait for provisioning and validate

Google notes that a managed certificate may take up to 60–90 minutes to provision. DNS propagation can add delay. Wait until the certificate and domain status are active, then request the HTTPS root URL and a known object such as /images/logo.png. Also request a deliberately nonexistent path to verify that 404.html is returned.

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

How can I use the simpler HTTP-only bucket endpoint?

If a custom domain and HTTPS are not requirements, you can use Cloud Storage’s website endpoint after setting the main and error pages. This avoids the load balancer and certificate, making it the quickest way to demonstrate a static site.

HTTP-only hosting is not appropriate for login forms, private content, or any site where visitors need transport encryption. It also does not give you the branded HTTPS URL that browsers and search engines generally expect. Treat it as a low-complexity option for non-sensitive demonstrations or internal testing.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I test and troubleshoot the deployment?

The root URL shows an access error

Check that index.html exists at the bucket root, the website main-page suffix is exactly index.html, and the chosen access model permits the request. For a public design, verify that the object-viewer policy actually applies. For a private design, test the load-balancer hostname and backend permissions rather than the direct bucket URL.

CSS, JavaScript, or images return 404

Inspect the browser’s requested path and compare its capitalization with the object name. Cloud Storage object names are case-sensitive. Re-upload missing directories with the recursive copy command and ensure your HTML uses relative paths that match the uploaded structure.

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

The certificate remains pending

Confirm that every certificate hostname has a DNS A record pointing to the load-balancer IP and that no stale record directs traffic elsewhere. Check both certificate status and domain status in the Console; HTTPS will not work reliably while either status is inactive. Allow the documented 60–90-minute provisioning window before treating the process as failed.

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.

The domain resolves but the wrong page appears

Verify that the URL map’s host rules include the requested hostname and that its backend bucket is the intended bucket. If you recently changed objects, test an object with a new name to distinguish a routing problem from cached content, especially when Cloud CDN is enabled.

HTTPS works for one hostname but not another

Each hostname must be listed on the managed certificate and have its own DNS record pointing to the same frontend. A certificate covering the apex domain does not automatically cover www unless that name was included.

What will Google Cloud charge for this website?

There is no single flat hosting price for this architecture. Charges can accrue for stored data, network egress, retrieval operations, the external load balancer, and optional Cloud CDN. The amounts depend on location, traffic, cache behavior, and how often objects are read.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Cloud Storage: stored bytes, operations, and any applicable retrieval or network charges.
  • External Application Load Balancer: forwarding and related networking resources.
  • Cloud CDN: optional cache and bandwidth charges when enabled.
  • DNS: charges depend on the DNS provider and plan you use.

Use Google’s Pricing Calculator for an estimate based on your expected storage and monthly traffic, and monitor the project’s billing reports after launch. A small site can still incur ongoing load-balancer costs even when it receives little traffic.

How do I remove the site and stop charges?

Delete resources you no longer need instead of leaving the project running indefinitely. Remove DNS records only after you are ready to take the hostname offline, then delete the HTTPS frontend, certificate, URL map, backend bucket, reserved IP address, and any CDN configuration. Empty and delete the Cloud Storage bucket last if its files are no longer required. Deleting the entire project is the simplest cleanup when it contains nothing else; otherwise remove each resource individually and verify that billing reports stop showing usage.

What security and maintenance checks should I perform?

  • Keep secrets and personal data out of public buckets; treat every object as potentially discoverable when public access is enabled.
  • Use a private bucket behind the load balancer for content that should not have a direct public storage URL.
  • Review IAM grants periodically and avoid granting project-wide roles when a narrower resource-level role is sufficient.
  • Retest the root page, a nested asset, the custom 404 page, and both apex and www hostnames after configuration changes.
  • Watch storage, network, load-balancer, retrieval, and CDN usage so unexpected traffic is visible quickly.
  • Keep a copy of the site files and deployment commands so you can recreate the bucket or move to another Google Cloud service.

Frequently Asked Questions

Can I host PHP, WordPress, or another server-side application in a Cloud Storage bucket?

No. A bucket serves objects and does not execute PHP, database queries, or other server-side code. Use App Engine, Cloud Run, Compute Engine, or GKE for the application runtime, and keep Cloud Storage for static assets if that division suits the design.

Why does my certificate stay pending even though I created the DNS record?

Check that the record is an A record for every hostname on the certificate and that it contains the load-balancer IP, not a bucket address. Also confirm that the certificate’s domain status is active; a correct record can still require the full Google provisioning window before issuance completes.

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

Do I need separate DNS records for the root domain and www?

Yes, if visitors should reach both names. Create an A record for the apex and another for the www hostname, include both names on the managed certificate, and ensure the load balancer has host rules for each.

Can I delete only the bucket after moving the website elsewhere?

You can, but the load balancer, reserved IP, certificate, and related networking resources may continue generating charges. Remove unused frontend and networking resources as well, or delete the entire project when it contains no other workloads.

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.