How to Build a Website on the Google Cloud Platform: In this easy access to the internet era, there are many ways to build a website by using various platforms and various hosting. If we talk about 5-6 years back, the building website was a complex and expensive thing. But in the present day website building becomes as easy as it was hard before. Nowadays, cloud platforms are suddenly spiked in demand because of their ease of access and their ability to handle much more traffic for a website.
How to Build a Website on the Google Cloud Platform
Google Cloud Platform (GCP) is well offered product by Google. By using it you can host many websites on the cloud platform which will make your website more reliable with high speed in a more cost-friendly way. In this article, we will discuss how to build a website on the Google Cloud platform and its benefits, and why you should use the cloud platform to build a website.
At firt, to build a website on Google Cloud you have to know how to create a VM (Virtual Machine) to host you wesite on Google Cloud.
Related Post: How to Schedule a meeting in Microsoft Teams?
How to Create a VM to host your website :
- Go to Google Cloud Platform Console
- You will see a Navigation Manu.
- Click on Computer Engine
- Then go to VM instances
- To create a New VM instance, click on create
- On the “Name Heading” enter the name of a New instance
- Enter/Select the Region and Zone that applies to you
- Select Machine Configuration which applies to your requirements and needs.
- Go to the Boot Disk option and select the boot disk as per your use.
- It will show you “Ubantu” in the version task.
- If you want to change the boot disk then select to change according to your requirements.
- After choosing your requirements, Click on Select to select the boot disk.
- After that, you will see the select Firewell option.
- You will see two options “Allows HTTP traffic” and “Allows HTTPS traffic”
- Tic on both the options you see.
- Lastly click on “Create” to create the VM instance.
Also Read this Article: How Do I Find Restaurants Along My Route?
How to install Apache Server in the Virtual Machine:
- Go to navigation Bar/Manu
- Click on Computer Engine
- Go to VM Instance
- You will see below interface
- Click on SSH to connect VM
- Wait until VM connect to your SSH
- Run the below command to intall the Apache Server in your Vartual Machine.
- $ sudo su
- $ apt-get install apache2
- Enter “Y” if prompted.
- To check the running status run the command “$ apt-get install apache2 status”
- Going to External IP address of the mywebsite VM you can check wether the server is running or not.
- The below window will appere if server is runing properly.
That all, the linking process has been completed. After the linking and creating VM you need to create a first Web Page for your GCP website. Lets Discuss about the proces How to create first web page for your GCP website.
Check Out this Article: How To Record In Microsoft Teams?
How to build a first web page for your GCP website
Modify the index.html web page which is stored in var/www/html folder after installing the Apache server on your host machine. After modification follow the below steps to build your first web page on Google Cloud Platform.
- On the website, the Virtual Machine enters the commands into SSH.
You can use the below commands for various purposes.
- $ ls /var/www/html You will see index.html file
- $ rm /var/www/html/index.html To delete the default home web page.
- $ vi /var/www/html/index.html To create a new default home web page.
- Enter i on the keyboard to edit the document in the vi editor
- Create your web page by using HTML, See below commands and image for reference.
After applying the command, Follow the below steps.
- To save the file, press Esc, Shift+Colon, and then type wq.
- To restart the server, do $ service apache2 restart.
- Once more, navigate to the mywebsite VM’s external IP address. Congo. You should see the page below.
Set up Cloud DNS for the domain name of your website.
After building first webpage for your website, you have to set DNS (Domain Name System) for the domain name of your server. Follow the below steps to make it properly.
- Return to the Navigation Menu. Select Cloud DNS under Network Services.
- Go to CREATE ZONE
- Enter the zone name under Zone name field and proceed further.
- Enter your website domain name that you want to host and build in GCP, Under DNS name.
- Describe if applicable. This is an optional task, proceed if applicable (Optional)
- See the below image for reference
- Click on the Create button.
- Now, Click on the Add Record Set button
- Select Record Reference Type as A And under IPv4 Address Enter the External IP address of the myweb
4. click on the Add Record Set button
5. Select Record Reference Type as CNAME. Enter www into DNS Name and [your domain website name] into Canonical name.
- Click on Create.
- Now click on Registrar Setup on the top-right side to the corner. And note down the nameservers on the notepad for future use. You will have to use these nameservers to mention your domain to Google Cloud for hosting to create the website.
- The Nameservers in your Domain Provider Panel should be updated.
- to Visit the website of your domain provider, such as Godaddy, Bigrock, etc.
- Open your domain’s DNS Management page by navigating there.
- As previously indicated, update your nameservers in these sections.
Now you are done. Now you have to wait only 24-48 hrs fully update the name server on your website. now you can proceed to install other database and other services to update your website and edit as per your need.
How do I create a website on the cloud?
How do I create a Web server on Google Cloud?
- Make a rule in your firewall to allow incoming traffic.
- Set Up a Static IP Address. This step is optional
- Launch A Compute Engine Instance On Google Cloud.
- Link RunCloud to a Google Cloud virtual machine.
Is Google Cloud good for websites?
The site’s content may be dispersed over several virtual servers located in various locations thanks to cloud hosting, which also makes it simple to scale up or down in response to spikes in demand. As a result, cloud hosting offers greater freedom to adjust the parameters as needed and is also more durable and dependable than web hosting.
Does Google Cloud work well for websites?
Google Cloud is the most reliable and recommended platform for your website. It is very user-friendly as well as it’s a cost-friendly service powered by Google. You can use it if your website has so many users and your current platform is not able to handle the much traffic.
How much does it cost to host a website on Google Cloud?
Furthermore, Google Cloud provides a customizable website hosting cost plan. Assuming that a website is hosted in a single location (us-central1), the approximate cost of hosting it on Google Cloud Platform is as follows: Hourly fee for Web Server: $0.12. For example, a compute engine costs $0.11 per hour.
Is Google Cloud Platform free?
Access to a restricted set of GCP services and resources is free of charge with GCP’s free tier. Along with a few other services and tools, the free tier of Google Cloud Storage, Google Compute Engine, and Google Cloud Functions is available.
Is Google Cloud web hosting free?
For the first ninety days of use, Google Cloud offers $300 in credits. Above all, though, is their free tier, which allows you to set up and run a server for free, provided that you follow some restrictions, forever. The compute engine, which has parameters available online, will be what we use.
Is AWS or Google Cloud better?
Both AWS and GCP provide a range of functions for computing services; however, AWS offers greater raw computational capacity than GCP, which concentrates on service management. Thus, developers who require greater control over their computing environment would be better off using AWS.
Can I host my own website?
With a physical server of your own, you can host your own website. It can be challenging to set up this process, and you will be the only one accountable for your website’s constant availability.
Conclusion :
Google Cloud platform is popular for its ease of use and other user-friendly features which are mainly used by those who need very much speed on their website to reach a specific level of traffic. It will reduce your costs and also increase your efficiency in building a website. For more queries on Google Cloud Platform leave a comment below. If you want any kind of suggestion or any kind of support then feel free to contact us.