Looking for a trusted Hosting service to grow your business? Google Cloud is the way to go!
Choosing a hosting provider for your website will make or break your opportunity to sell your products or services via your website. Web hosting providers serve your website files to visitors and control how your website works, its availability during outages, how fast it loads, and its security. In other words, it directly affects your visitor’s user experience and the success of your business.
Google’s cloud hosting service has increased in popularity as a leading solution for millions of customers worldwide, owing to its private network, security, enhanced execution, constant development, redundant backup, and many other sought-after features.
If you have already decided to choose Google Cloud to host your website, keep reading as we show you how to host your website on the reputable Google Cloud in only seven easy steps!
Table of Contents
Step 1: Create a Google Account
The first and most obvious step to host a website on Google Cloud is to have a Google Account. If you don’t have one, follow these steps to start creating your Google Account:
1) Head to the Google Account sign-in page.
2) Select Create account.
3) Type your name.
4) Type a username In the Username field.
5) Type and confirm your password. The first letter isn’t case-sensitive when you enter your password on your mobile.
6) Select Next.
7) Add and verify a phone number for your account (optional).
8) Select Next.
There you have a brand new Google Account to host your website on Google Cloud!
Step 2: Have A Domain that You Manage or Own
Before you host a website on Google Cloud, you’ll need to have a domain you manage or own first. Having an existing domain is not as complicated as it might seem—many services enable you to register a new domain, including Google Domains.
You’ll also need to verify that you manage or own the domain before being able to host the website. Make sure to verify the top-level domain, not the subdomain.
Note: if you purchase your domain name through Google Domain, you’ll get an automatic ownership verification from Google. On the other hand, you could have a few more steps if you use another registrar.
Step 3: Create a CNAME record
Domain Name Services (DNS) is one of the many web systems used to ensure that users can get where they need to go. This system helps convert human-readable names into an IP Address number of the server hosting a certain website.
To aid in properly configuring other services, DNS offers the option to add RECORDs to the DNS record. MX or Mail exchange RECORDs are some of the more popular ones that support email systems.
Simply put, to ensure that the correct server will be reached even if someone only types the domain name without the ‘www,’ you need to create a CNAME. Here’s how to do this:
1) Head to Google Domains.
2) Select My domains.
3) Use your email address to log in.
4) Find your domain.
5) Select Manage.
6) Select DNS.
7) Go to the Custom resource records panel.
8) Add a CNAME record, a type of DNS record that directs traffic requesting a URL from your domain to the resources you want to serve. Those are objects in your Cloud Storage buckets in this case.
Step 4: Create a Cloud Storage Bucket
You’ll need to create a Cloud Storage bucket to hold your static site files. Here’s how to do it:
1) Head to the Cloud Console.
2) Scroll down to the STORAGE category In the left-hand menu and select the Storage task.
3) Select Create Bucket.
4) Name your bucket (make sure you do this with your site name).
5) Select the storage location of your data (choose Multi-region to make content available from more than one cloud region).
6) Select a default storage class for your data (the Standard option is recommended).
7) Select how to control access to objects (Set permission uniformly at bucket level option is recommended).
8) Select Create.
Step 5: Upload the Files & Images of Your Website
The next step is to get the static files from the website developer or marketing team. And don’t worry If you are doing it yourself—you can find tons of informative tutorials on HTML and CSS in this regard.
Now, it’s time to upload the static files into the created. When it comes to uploading your static files, there are three different ways to do it:
Method 1: Uploading Files Using Cloud Console
This is a simple and hassle-free way of uploading your static files:
1) Head to the Cloud Console.
2) Select the STORAGE category in the left-hand menu and choose Storage.
3) Select the bucket name.
4) Click Upload folder under Bucket details.
5) Upload the folders and files of your website.
Method 2: Uploading Files By Draggin & Dropping Them
Another easy way to upload static files is to drag and drop them simply. There are no steps for this method—simply drag and drop, and you’re all set!
Method 3: Uploading Files Using Gsutil Rsync
To copy many files from your local machine to Cloud Storage, using the “gsutil rsync” command is your best bet. By copying any missing files and deleting any extra files, this command makes the contents under dst_url the same as those under src_url.
Click here for more information about this method.
Step 6: Set Access Permissions
After uploading all your static folders and files, it’s time to set access permissions. You have two options to do this: set individual objects to be accessible through your website or make all files in your bucket publicly accessible. If you want the fast and easy method, make all files in your bucket accessible.
You want to apply access permission to the whole bucket, which is much safer than other options. Additionally, all the contents will probably need to be readable for the site to load, given that it’s a static website. If you have some design metadata, they can be deleted or hidden separately.
Here’s how to apply access permission to the whole bucket in 4 simple steps:
1) Select the Bucket details.
2) Select Permissions.
3) Select Add members.
4) Add all Users, and make sure it’s with Storage Object Viewer rights.
Now your files should be visible to the general public. Congrats!
Step 7: Assign An Index Page Suffix & Custom Error Page
It’s time to assign an index page suffix and a custom error page. While this step is optional, it’s worth mentioning that nothing is served when users access your top-level site if you don’t have an index page.
An index page, or a webserver directory index, is a file served to any visitor requesting a URL that does not have an associated file. But assigning a MainPageSuffix makes Cloud Storage look for a file with that name and a prefix that matches the URL requested by visitors. Additionally, the MainPageSuffix controls the file served when any user requests the top-level site.
The error page is the file returned to any visitor of your site when requesting a URL that doesn’t correspond to an existing file. If you’ve already assigned a MainPageSuffix, Cloud Storage will only display the error page if neither the requested file name nor an appropriate index page is present.
The HTTP response code is 404 when a page with an error is returned. Why does that even matter? NotFoundPage is a property that determines which file serves as the error page. Users will get a generic error page if NotFoundPage is not set.
And you’re all set. Hooray!
Now we know you’re excited to follow these steps and start hosting your website on Google Cloud, but keep in mind that Google Cloud (like any other hosting provider) has a negative side.
For example, it’s not the most reliable option you can find, and it’s way more expensive than other traditional hosting services. Nevertheless, Google Cloud is an insanely fast and secure hosting provider, so it’s probably worth the peace of mind!
Is Google Web hosting free?
There’s a wide range of robust website builders provided by Google Domains that have both free-of-cost and paid options.
How much does it cost to host a website on Google Cloud?
Last we checked, Google web hosting prices start at $49.00 per month.
Why is Google Cloud so expensive?
Google Cloud is pricier than other options because it offers a suite of services that aren’t always cost-effective or necessary. For instance, Google Cloud Storage is pricy since it limits you to a specific number of storage buckets and has a one-time upfront fee.
How long is Google Cloud free trial?
The free cloud platform tier enables access to Google’s Cloud’s useful features in 2 different ways: Always Free and a 12-month free trial.
Thank you for reading my blog.
If you have any questions or feedback, please leave a comment.