So you want to host WordPress on Google Cloud?
This guide will take you step-by-step through the process of deploying a WordPress website to Google Cloud.
Start by reading through the Introduction section of this guide to learn about hosting WordPress on Google Cloud, then complete each of the three sections in this guide.
Let’s get started!
In the first section of this guide you’ll learn how to Configure WordPress on Google Cloud. Then, in the second section, you’ll learn how to Configure a Domain Name. Lastly, in the third section, you’ll learn how to Configure SSL for your website.
Good luck, and don’t forget to reach out to the WordPress Cloud Hosting Support group if you get stuck on any section of the tutorial!
Introduction
I. Configure WordPress
II. Configure Domain Name
III. Configure SSL
Next Steps…
Introduction
In this introduction section of the guide, you will learn about the pros and cons of moving to Google Cloud. You will also learn about the costs of hosting WordPress on Google Cloud, including the importance of deploying a solution that balances efficiency with performance.
After you’ve read through this introdution, the guide will then walk you through the process of deploying a WordPress website to Google Cloud.
Why host WordPress on Google Cloud?
Google Cloud is an excellent platform for hosting WordPress websites that require scalability, resiliency, and performance.
The #1 reason why you should host WordPress on Google Cloud is because you’re developing a website that you predict will grow in size and complexity over time, and you require a highly-scalable infrasture that can grow with your website.
Below is a list of pros and cons to consider when determining whether to host your WordPress website on Google Cloud:
Pros of Google Cloud hosting
- Significantly Increased performance
- Virtually unlimited scalability
- Highly cost-effective for large projects
- Greater control and flexibility
- Native integration with Google products
Cons of Google Cloud hosting
- Steep learning curve for beginners
- Requires significant time investment
- No customer support options included
- Greater risk exposure for new users
Cost of Hosting WordPress on Google Cloud
The cost of hosting WordPress websites on Google Cloud (compute engine) varies widely, and depends on many factors. Generally, the cost ranges between $1-$30 per month for typical WordPress websites.
Balancing efficiency and performance
When selecting the infrastucture to use for hosting your WordPress website on Google Cloud, it’s important to understand the need for balancing efficiency and performance.
Below is a side-by-side comparison of an efficiency ($0.08/month) vs. performance ($29.71/month) based configuration for hosting WordPress on Google Cloud.
Efficiency Configuration
The efficiency configuration is optimal for low traffic websites (under 1000 daily users). This configuration takes full advantage of Google Cloud’s generous Always-Free Tier, which provides an f1-micro instance, as well as 30GB of HDD persistent disk storage, all at no cost.
This strictly efficiency-based model will allow you to host your WordPress website on Google Cloud at a very low cost, however, larger websites strictly adhering to the efficiency model may incur performance issues.
Performance Configuration
The performance configuration is optimal for websites with higher traffic volumes (over 1000 daily users). However, unlike the efficiency configuration, neither the n1-standard instance nor the 30GB SSD persistent disk are covered under Google’s Always-Free tier.
This strictly performance-based model will allow for your website to out-perform the efficiency model, especially under heavy load. However, low-traffic websites that utlize this configuration may be allocating resources inefficiently.
Which configuration should you choose?
One of the benefits of migrating to Google Cloud is that you can take advantage of their ‘pay-as-you-go’ model, which means only paying for the resources that your website requires, and nothing more. That being said, a good rule of thumb is to start small, and upgrade only when necessary. To determine whether upgrading is necessary, you will need to monitor your instance’s performance metrics.
To access your instance’s performance metrics, start from the Google Cloud sidebar menu and navigate to Compute Engine > VM Instances, then click on your instance. From here, you’ll see a Monitoring tab at the tob of the page, which links to a dashboard displaying your instance’s performance merics.
The most important metric to assessing the performance of your instance is CPU usage. CPU usage consistently under 60% is ideal. If CPU usage is consistently over 60%, you may want want to consider upgrading your machine size.
In addition to CPU usage, you’ll also want to monitor the free space available on your persistent disk. To check available disk space, use the df command, as shown in the Linux commands tutorial.
Now that you’ve learned about balancing costs with efficiency and performance considerations, it’s time to get started deploying your website.
Part I
Configure WordPress
In this section of the guide, you will deploy a WordPress website on Google Cloud using the efficiency configuration, which consiststs of an f1-micro instance and a 32GB HDD persistent disk, at an estimated cost of around $1 per month.
1. Deploy WordPress
2. Customize Deployment
Part II
Configure Domain
Now that your WordPress instance has been deployed, you will configure a domain name for your new WordPress website. Although the tutorial uses Namecheap as the domain name provider, the configuration is universal and will work with any domain name provider.
3. Copy Instance IP Address
4. Enable DNS Settings
5. Create DNS Record
Part III
Configure SSL
Now that your website’s domain name has been configured, you will learn how to enable SSL for your domain name. To do this, you will connect to your WordPress instance via the SSH terminal, then execute a script which will automate the process of configuring SSL for your website.
6. Connect to WordPress Instance
7. Execute SSL Script
sudo /opt/bitnami/bncert-tool
After you’ve pressed Enter the script will prompt you with a series of questions, which you will answer by entering either y (for yes), or n (for no). We recommend answering each question in the following way, remembering to replace each bolded instance of 1pagezen with your own domain name or email:
Domain list []: 1pagezen.com www.1pagezen.com
Enable HTTP to HTTPS redirection [Y/n]: y
Enable non-www to www redirection [Y/n]: n
Enable www to non-www redirection [y/N]: y
Do you agree to these changes? [Y/n]: y
E-mail address []: [email protected]
Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: y
Next Steps…
Well done! You’ve successfull deployed a fully-functional WordPress website on GCP, however, there are still some very important concepts that need to be covered. In this Next Steps… section of the guide you will learn how to retrieve your login credentials and login to your WordPress website, and optionally import an existing WordPress website.
8. Login to WordPress
9. Assign a Static IP Address
By default, your WordPress instance is assigned an ephemeral IP address, which means that if your WordPress instance is ever stopped or restarted, it’s IP address will change. This is not desirable, and can cause networking problems for your website.
To prevent this issue, you need to reserve a static IP address for your WordPress instance. To do this, follow these instructions (use method 1).
10. Import a WordPress Website
You can use the All-in-One WP Migration Unlimited Plugin to quickly export and import your existing WordPress website to it’s new location on Google Cloud.
Check out this tutorial for a list of step-by-step instructions.
11. Get Community Support
If you need help with this tutorial (or any other tutorial), then make sure to join the WordPress Cloud Hosting support group on Facebook.
Did it work?
Now that you’re hosting WordPress on Google Cloud Platform, be sure to check out these other great WordPress on Google Cloud tutorials.
If you have general questions or comments about this tutorial, please feel free to leave them below. If you get stuck on a specific tutorial, please post your questions and comments on that tutorial’s page.
Thanks,
shanmuganathan says
tutorial is simple and working, but if we go to ipaddress/wp-admin then one wordpress loads and domain.com/wp-admin then one wordpress loads. can you chack and reply
Leron Amin says
Hello Shanmuganathan,
Make sure your WordPress site URLs are pointing to your domain and not your IP. You can change your domain name from the wp-config.php file, by following step 7 of this tutorial, then restarting your server (as shown in step 8).
Let me know if you have questions,
Joe
Mark Askew says
Padlock didn’t work. When opened conf file all changed. Problems started with duplicatring a site over.
Can you do a tut on the config file please?
In this post you mention Azure by accident.
Well done! You’ve successfull deployed a fully-functional WordPress website on Azure, however, there are still some very important concepts that need to be covered. In this Next Steps… section of the guide you will learn how to retrieve your login credentials and login to your WordPress website, and optionally import an existing WordPress website.
Leron Amin says
Hi Mark,
This configuration uses a different conf file than the one used in the previous versions of the tutorial. I haven’t done any in-depth analysis at this point, as this tutorial is only intended to be used on new WordPress on GCP installs.
That being said, if you’re trying to configure these certs to work with your existing configuration, you will need to copy the file paths to each of the certs (which you’ll find in the new conf file), and then replace the existing SSL file paths in your previously used conf file with the new ones.
And thanks for pointing out the issue with “Azure” being mentioned instead of GCP. I try to review these tutorials as best I can before publishing, but I always end up missing things.
Let me know if you have other questions,
Joe
Anny says
Finally I found this!! Thank you so much.
Leron Amin says
Thanks for the feedback Anny – I’m glad to hear the guide was helpful to you!
Beer says
hi i’m Beer
i got the problem
projects/omega-winter-242807/zones/asia-south1-c’ does not have enough resources available to fulfill the request. Try a different zone
how to fixing please help
Leron Amin says
Hi Beer,
This happens sometime with specific zones. Sadly, you may have to move to a zone with a higher resource quota.
Let me know if you have other questions,
Joe
Bhagwat Pawar says
is there wordpress multisite installation article on google cloud platform?
Leron Amin says
Hi Bhagwat,
I don’t have one, as I generally don’t recommend using WordPress Multisite.
However, Bitnami has comprehensive docs on getting started with the Multisite stack, which you can view here.
Let me know if you have other questions,
Joe
lorenzo says
Hi, thanks for this tutorial, it’s great. I have a question I hope you can answer,
I have a website running on Compute Engine, and I am running it with a different CMS. As we’re about to launch a little micro-website on a subdomain, I though I would do use WordPress for it.
Now, bear with me cause I’m quite the newby, but I’m afraid of deploying the wordpress image for fear it would overwrite my existing settings, and basically all the information I have on my main domain. Is thhat a real risk?
thanks a lot for your help
Leron Amin says
Hi Lorenzo,
That’s not a real risk assuming you’re running your website in a separate VM instance.
Let me know if you have other questions,
Joe
louisa says
Hi, if you have time, can you do a tutorial on how to update php in Bitnami?
Leron Amin says
Hi Louisa,
Unfortunately, there’s no easy way to update PHP in WordPress Bitnami.
The recommended best practice is to migrate the WordPress install to a new Bitnami WordPress solution with all upgraded software components.
Let me know if you have other questions,
Joe
Bhupendra Lodhi says
Hi there,
I am newbie and found your are doing great job on this blog.
I want to update my wordpress php version for security purpose.
Can you please share a step by step article on how to update php version for Click-to-deploy.
Waiting for that please share
Leron Amin says
Hi Bhupendra Lodhi,
I’d recommend exporting your WordPress site and migrating it to a stack with all newer components. You can use this tutorial for instruction on exporting a WordPress site using the All-in-one WP Migration plugin.
Let me know if you have questions,
Joe
Remmel Kemp says
Great article. I used this to deploy wordpress on google cloud and its running great since 2017.
Recently I got a warning from wordpress that I need to update PHP to 7.
Will you please tell how to ?
Leron Amin says
Hi Remmel,
Thanks for the feedback!
I will make a guide on this soon, as it’s something people have been asking about recently. Now, keep in mind that at this point, most of your other software components are outdated besides just PHP, so it’s probably a good time to move migrate your WordPress installation to a new instance with up-to-date software components.
To do this, deploy a new WordPress instance from the Google Cloud Marketplace, then export your existing WordPress site using the All-in-one WP Migration plugin. Once this is done, import the exported site to your new WordPress instance.
Let me know if you have questions,
Joe
Remmel Kemp says
Thank you for your suggestion.
I created a new instance and transferred my site with migration pluggin.
Thanks a lot for your help.
Leron Amin says
Glad to hear it – well done Remmel!
Emilian says
This suggestion is not working for me – I hosted my website on Google Cloud following your 2018 tutorial for beginners.
Today I created a new instance, migrated everything with Updraft Plus since WP Migration allows only 40mb and my website is 240mb.
Result ? My SSL certificates aren’t working anymore. I tried to reinstall using your tutorial, I receive an error than the Apache cannot be restarted and it isn’t working. I tried everything, deleted everything even the Cloud DNS … everything. Always stuck without SSL.
After snapshot restore, I’ve tried the manual SSH sudo method to directly upgrade the php, the site isn’t working at all after the manual upgrade.
Fortunately I backup everything, so I restored the latest snapshot, registered again the SSL certificates for my website using your SSL tutorial and everything’s back to normal, on PHP 7.0.3 … but at least the website is back online, with SSL enabled.
Leron Amin says
Hi Emilian,
Running scripts to update PHP generally won’t work with the Bitnami stacks – as they don’t use conventional directory structures for with stacks. With Click-to-deploy, it’s possible but you need to make sure you have a solid understanding of which version of PHP your OS is running, and then locate the required steps from a reputable source.
The following are good practices to keep in mind when upgrading PHP:
1. Don’t upgrade PHP every time there’s a new release. Most security plugins will produce warnings along the lines of “your PHP version is out of date and it’s a security concern”. Oftentimes, this can causes users to panic, when in reality, it’s not necessary to always be running the latest version of PHP.
2. Have a ‘why’ for upgrading to a later PHP version, and don’t just do it because a plugin says so. For instance, if a security vulnerability is discovered in the version of PHP that you’re running, and through your own research you’ve determined that said vulnerability has the potential to affect your site, then that’s a solid justification for going ahead with an upgrade.
3. If you’ve been running WordPress on the same VM instance for a few years, it’s likely that PHP isn’t the only component that’s outdated. If you’re running WordPress Bitnami, you should manually migrate your WordPress install to the latest Bitnami solution from the Google Cloud Marketplace.
4. If running Click-to-deploy, it’s possible to upgrade according to the documentation for your particular OS. For instance, if your instance is running Debian 8, you’d do a web search for “How to upgrade php on debian 8 jessie”.
Hope you find this information helpful, and please don’t hesitate to reach out if you have other questions!
Joe
Emilian says
Thank you for your reply and for your time.
I guess my mistake was trying to migrate my Bitnami install to the click to deploy version and this is why it didn’t work … I didn’t know they’re using different directory structure (I was greedy seeing that Google’s click to deploy is using php 7.4 and bitnami is still on 7.3).
I will try it as soon as I have few free hours.
Leron Amin says
Hi Emilian,
You can use the All-in-one WP Migration plugin for generating your export. Once the export is generated, you can import it to either a Click-to-deploy or Bitnami WordPress install. That being said, this is just importing the WordPress files themselves – so all of the server-side configuration still needs to be handled, and these configurations are completely different depending on if you’re using Click-to-deploy or Bitnami.
So – the most import thing is this: regardless of whether you’re importing your WordPress install to Click-to-deploy or Bitnami, you should have your bare-bones WordPress website configured before doing the import. That is to say, the domain name, SSL certificates, etc. should all be fully configured before proceeding with the import.
Hope this additional information is helpful – and good luck!
Joe
Chris Chong says
Hi there Leron, thanks for reminding me about the stuff that matters the most before making a decision to host and setup a WordPress site using Google Cloud 🙂
I was about to make a decision based on the value-for-money that Google has to offer for its GCP services 😀
I finally made up my mind for now to host using the “traditional” method instead of shifting to cloud hosting because the command line interface is quite daunting if you were to ask me. It’s just like learning a new programming language.
Don’t forget to follow my YT channel too if you wanna learn about ALL THINGS DIGITAL MARKETING 😉
Leron Amin says
Hi Chris,
Glad to hear you made an informed decision when choosing your hosting provider! As with everything, there are pros and cons to either solution.
Anyways – I will be sure to check out your channel!
Take care,
Joe
Janio Souza says
what to do when the site goes down? left once, I restarted the instance, but left again a few days later and even restarting the VM did not come back.
Leron Amin says
Hi Janio,
You should create regular disk snapshots of your VM in order to quickly recover from these sorts of situations.
To learn more about how to configure disk snapshots, check out this tutorial.
Let me know if you have questions,
Joe
Shahbaaz says
Hi Joe,
First, I am following your tutorials for some time now, and I have to admit – onepagezen.com is the best website for GCP tutorials.
Second, my WordPress websites site health tab shows a performance issue –
“The optional module, Imagick, is not installed, or has been disabled.” how do I fix that? My website is hosted on GCP deployed using WordPress certified by Bitnami.
How can I fix that issue? What are the performance gains I can expect from that? It would be great if you can put this all in a tutorial. Thank you so much for such an incredible website and guides.
Leron Amin says
Hi Shahbaaz,
Thanks for the great feedback!
I’m not sure about the Imagick module – I’ve never used it before. Although the module is recommended, it is not required for WordPress to function properly.
Let me know if you have any other questions,
Joe
Thallyson Dias says
i have a same problem…
i add the line “extension=imagick.so” on php.ini
but dont stay enable…
Leron Amin says
Hi Thallyson,
Did you remember to save the file then restart the server?
Talk to you soon,
Joe
sanchit says
Hello Sir,
I really like your content and the solutions you provided it really helped me in setting up the GCP. And now I’m facing a problem.
I have taken a backup of my existing wordpress site via Cpanel. and Would like to migrate my site to google cloud. My previous hosting provider is expired thus can’t use All in one Migration WP.
Please provide the solution on how to setup cpanel and restore the WP files via GCP.
Looking forward to your warm responses.
Leron Amin says
Hi Sanchit,
Thanks for the great feedback!
The process of setting up cPanel on Google Cloud isn’t something I cover in any of the tutorials.
If you’re interested in configuring cPanel on your Google Cloud instance, check out this tutorial.
Let me know if you have questions,
Joe
Nik Edmiidz says
I think you can do it even cheaper using Google App Engine (standard environment) instead of Google Compute Engine. If you don’t mind about domain, you can also get an appspot.com subdomain with their SSL cert.
Leron Amin says
Hi Nik,
It’s possible – but the cost would probably be free regardless of whether you deploy the solution on App Engine or Compute Engine.
If you’re looking for an almost completely no-cost option on Compute Engine, you’d have to use the f6-micro machine with the 30GB HDD persistent disk. In addition to that, using CloudDNS would incur a small cost as well (which isn’t covered under the free tier) – so forgoing all of these options would allow a near zero-cost solution on Compute Engine.
That being said, I’d recommend paying for CloudDNS and an SSD persistent disk, as those both come with benefits that far exceed their negligible cost per month.
If you haven’t already, check out this page for more information about what’s included in the GCP free tier.
Talk to you soon,
Joe
Bhupendra says
Hello Sir,
I loved your articles and I have done migration on GC.
But Cost of GC in very High for my single WordPress website.
(Approx $1.5 per day and $45 monthly )
I am using Click to develop (WordPress)
Machine type: g1-small (1 vCPU, 1.7 GB memory)
Zone: asia-south1-b
Website Size: 250MB
Traffic: 2.5k User per day
Is it possible to reduce cost ?
If yes please help me.
My website loading speed also very bad after using GC
Before GC Website loading speed was 1.5 Second (GTmetrix) but now on GC is 3.5 Seconds (GTmetrix).
I also want to know about Load Balance on GC Please publish article about it.
Leron Amin says
Hi Bhupendra,
Are you using SSD or HDD storage? Are you using Google Cloud DNS? Where were you testing the load times from?
The load times on GTMetrix showed 0.7 seconds for Mumbai and 3.2 seconds for Vancouver. This is expected since your instance is deployed in a region around India. If you’re trying to increase performance for your Canadian visitors, for instance, then you will have to configure a CDN to cache and serve your static assets to visitors based in North America.
As far as the issue with cost, take a look at your instance’s monitoring statistics and see if you actually need to be running a g1-small instance. Your website may perform just as well on an f1-micro machine – which would be significantly cheaper.
Let me know if you have questions,
Joe
Bhupendra says
I will try f1-micro machine for my website hope it will help to reduce cost.
Thank you for creating this helpful blog.
Leron Amin says
Sounds good Bhupendra – let me know if you have any questions!
Bhupendra says
I tried f1-micro machine but it goes down my website if I use this machine.
Where I can check about SSD or HDD, and Google Cloud DNS?
What is the use of SSD OR HDD and Google cloud DNS?
Is it required to run a wordpress website?
How can i reduce cost please help because I love Google cloud but can not afford it.
Otherwise I will move on digital ocean after free tire.
Leron Amin says
Hi Bhupendra,
HDD, SSD, and Cloud DNS are all core concepts of Google Cloud Platform. Before hosting your site on Google Cloud, I’d recommend researching these GCP services to better understand the role they play in your website.
Let me know if you have questions,
Joe
waqas says
Hello Leron,
First of All Thank you so much for publishing this great and helpful content. I was able to follow through but hard work paid off and I had my first site up on the google cloud. I am much familiar with bitnami stack for wordpress now.
I just came across this one article below which simply compares openlitespeed vs nginx for wordpress as they are also available. I would like your opinion as an expert what do you think is it worth it to change to openlitespeed. Also if you can make a tutorial on youtube channel if possible how to make allocate a swap file from sd storage micro for the bitnami stack. Please answer this is my first time posting like this. Thanks.
https://wpspeedmatters.com/openlitespeed-vs-nginx-in-wordpress/
Leron Amin says
Hi Waqas,
Nginx has a huge support community and is a widely used solution, much more than openlitespeed. I always recommend going with the more established/better supported solution vs. the latest and greatest. Based on the article that you linked to, the marginal performance benefits don’t merit the long-term costs of switching from Nginx to a less established solution.
Hope this helps and let me know if you have questions,
Joe
Nishant says
Hi,
thanks for the tutorial. I followed the tutorial but I have now got 2 options on WordPress panel. One is for user where I don’t get kind of admin related permission and another is network where admin related features exists. And so every time I need to switch between 2 profiles.
Leron Amin says
Hi Nishant,
It sounds like you may have installed the Multisite version of WordPress on Google Cloud.
Also, would it be possible to share a screenshot of issue that you’re seeing?
Talk to you soon,
Joe
george says
Hi Joe,
i would like to ask if there is a way to host a second website on my compute engine? i already have one website hosted and it runs smoothly. is there a way to add another one?
thank you.
Leron Amin says
Hi George,
You can host an unlimited number of applications on the same virtual machine, however, this is not necessarily best practice.
I would recommend deploying your website as a separate virtual machine instance.
Hope this helps and let me know if you have any questions!
Joe
Linshuang says
Hi Joe,
I deployed WordPress Certified by Bitnami. However, I CAN NOT “log into the admin panel” when I click the botton. Could you help me?
Leron Amin says
Hi Linshuang,
Can you please provide more details of what happens when you try to login? Does it say the password is incorrect? Does it load a 404 page?
Let me know and I will see how I can help,
Joe
Abu Monsur says
Boss, how are you? You told me
”Yes – I would recommend using Cloudflare CDN.
I’m going to be publishing a tutorial on the process in the next couple of weeks.”
Is the tutorial ready?
Thanks
Abu
Leron Amin says
Hi Abu,
I’ve published the tutorial for configuring Cloudflare CDN with WordPress on Google Cloud, which you can view here.
Let me know if you have questions,
Joe
george says
Dear Joe ,
I have followed all your video and everything was smooth for 1 year during the trial period. but after it finished i cannot access my website
i get this on the explorer www.”mydomainname’’s server IP address could not be found.
Try running Windows Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN
i enabled payment in the google cloud but still nothing. is something i can do? do i have to restart something?
thank you
Leron Amin says
Hi George,
Did you enable billing for your project? It could be that the project was frozen because the trial expired.
The good news is that Google typically won’t delete projects after the trial has expired, but they will ‘pause’ the VM instances and any resources that your project is using, until billing is enabled. Once billing is enabled, go to your VM instances dashboard, select the VM instance that’s running your website, then click the ‘start’ icon at the top of the page.
Let me know if this appears to be the issue, and I will help guide you forward.
Talk to you soon,
Joe
george says
Goodmorning Joe,
You are right. After trial we have to enable billing, which i had done, and then start the instance again because google pauses it. now it runs smoothly again.
thank you Joe.
Shelley Scheepers says
Hello
I am having a similar issue I hope you can help me with. My trial also expired and after enabling billing, the site is not loading. I restarted the VM instance as you mentioned above, but it still hasn’t reyuned. Can you advise whether this just takes time, or if I need to try something else?
Thanks!
Shelley
Leron Amin says
Hi Shelley,
After you’ve enabled billing and restarted your instance and/or server, your site should work again. You may have to wait a few minutes or clear your cache if you’re not seeing the changes reflected.
Let me know if you have questions,
Joe
Ayaz says
I have a website in Blogger which has monthly 100k visitors which plan I should choose in Google cloud.
Jay says
Thanks to the great article OS, starting with Google Cloud, Auto Renew SSL is not being installed on my site. Showing error is mv: cannot move ‘certbot-auto’ to ‘/etc/letsencrypt/’: Not a directory
Please help me.
Leron Amin says
Hi Jay,
Did you make sure that the /etc/letsencrypt/ directory exists? You can check by executing the following command:
The directory get’s created when you execute the certbot-auto script – so if you haven’t done this yet, then it’s likely the directory doesn’t exist. If you’d like to create the directory manually, you can do so by executing the following command:
Let me know if you have have any other questions,
Joe
Romain says
Hi there!
Thanks a million for helping with all this.
I had lots of issues at first and had to delete everything and start from scratch, but I finally managed to get everything running.
One question I haven’t seen in your tutorials: how can we update the php version on google cloud?
In my wordpress site health status, it is highlighted as “critical”. Can you help on this?
Thanks!
Leron Amin says
Hi Romain,
I’m glad to hear the tutorials have been helpful to you.
If you’re using Bitnami’s WordPress, you will have to re-deploy and migrate your existing installation to a new VM instance. For Click-to-deploy, you can upgrade PHP just as you would with any other LAMP stack. Here’s a guide for upgrading PHP on Ubuntu 14.04 – though you will have to check your machine’s operating system to make sure you’re following the tutorial for the correct operating system. You can check your operating system by executing:
lbs_release -a
As long as you’re running PHP 7+ you shouldn’t be too concerned. If you’re not yet running at least PHP 7.0, it’s time to upgrade.
Let me know if you have any questions,
Joe
paul says
WOW Great site, full of so much critical info, as a Sys admin it covered move than i could have hoped, great explanation covering not just word press but valuable hands on google cloud covering off not just what to do but why this direction. THANK U.
Leron Amin says
Thanks for the great feedback Paul! I’m happy to hear the tutorials were helpful to you!
Mukeshwar Singh says
Hello Sir, I followed your tutorial. The first time it worked but I did something wrong while installing SSL so I deleted the whole project and started with a new one. After that, I have tried like 5 times but my website is not opening. The WordPress IP is opening but not my website.
Leron Amin says
Hi Mukeshwar,
It sounds like there are several factors at play here.
I would recommend starting again, and then if something goes wrong while installing SSL, don’t delete the project – just leave a comment at the bottom of the tutorial or on the WordPress Cloud Hosting Support page.
Let me know if you have questions,
Joe
Thomas says
Hi
How do you get WordPress to send out emails?
Contact Forms, Newsletter Subscriptions, User Registration, Forgot Password etc don’t work.
Thanks
Leron Amin says
Hi Thomas,
I would recommend configuring SMTP by following the instructions in this tutorial here.
Let me know if you have questions,
Joe
Harinderpreet singh says
hi i thinking about migration about my wp blog
My traffic is 30000 day 38% from india csn you tell me that how much it cost
20 gb space is enough for me i also need ssl
Leron Amin says
Hi Harinderpreet,
For a 20GB SSD instance on a n1-standard-2 machine, you would be looking at around $100-150 month. You may be able to get by on a n1-standard-1 machine for about half the price. Keep in mind that this is only a rough estimate, as 30,000 visitors/day is a significant amount of traffic, and your total cost depends on other variables such as the type of content you’re serving on your website (video/images/etc).
Hope this helps, and good luck.
Joe
Harinderpreet singh says
I’m WordPress blogger
Leron Amin says
You may want to look at a managed solution. It will cost more, but that’s the route I would recommend, especially if you’re generating income from your 30,000 daily visitors. Good luck!
Umar Farooq says
Hi, thanks for great article. I came here from an answer on Qoura. My question is simple:
I host my small business website on GoDaddy and I’m planning to buy G suite for me and my team. Will it be wise to move my domain as well as hosting to G suite and Google cloud? (by wise I mean cost effective and improved performance)?
I don’t feel it to be great that email is on Google while WordPress website and domain on GoDaddy. Your recommendations?
Leron Amin says
Hi Umar,
It doesn’t matter where you have the domain name. As long as you use Google’s nameservers, you shouldn’t run into any issues with configuration.
Let me know if you have any questions,
Joe
Joan Osler-Lane says
Hi Joe
I have deleted and re-deployed WordPress a number of times but do not seem to be able get my links to work. Any ideas?
I have googled it and used a vid that shows how to update the htaccess file but it is still not working an my links. 404 page not found keeps showing????
I have used click to deploy and also set up FileZilla. All I have on that is folders:- wp-admin; wp-content and wp-includes.
yours Hopefully
Jo Osler-Lane
Leron Amin says
Hi Jo,
Did you follow my instructions from this comment?
Talk to you soon,
Joe
Fairuz Magnus says
Hi, I love your tutorials, it was so helpful when installing WordPress OneClick Deploy Google Cloud Engine.
I am also using Woocommerce with my wordpress site and some plugins requires SoapClient
“SoapClient: Your server does not have the SoapClient class enabled – some gateway plugins which use SOAP may not work as expected.”
“PHP version: 7.0.33-0+deb9u3 – We recommend using PHP version 7.2 or above for greater performance and security.”
Could you please help me on how to install SoapClient on GoogleCloud and also how to update the PHP version from 7.0 to 7.2.
Leron Amin says
Hi Fairuz,
I’d recommend migrating your application to an instance with all update components, instead of just updating PHP.
I am unfamiliar with configuring SoapClient – if you get it working, please reply with your solution.
Thanks,
Joe
Jo Osler-lane says
Hi Joe
I deleted the instance and redeployed WordPress. I have set up a theme on the site and all seemed to be going well, except when I create new pages and try to use them from the menu it is saying –
Not Found
The requested URL /about-us/ was not found on this server.
I am at a loss as what has happened and why I’m getting this 404 error.
I did also try and change my sql password but now it seems not to be working either. I can’t access the database at all??? is there any way I can gain access again. All your help vids are for Bitnami and I used Click to Deploy.
Hoping you can help
Jo Osler-Lane
Leron Amin says
Hi Jo,
Connect to your instance via SSH then run the following command to open your Apache2.conf file:
Use the down-arrow key to scroll toward the bottom of the file, and locate this block of code:
On the line that says:
Change it to:
Save and exit the file (CTRL + X, then Y, then ENTER), then restart your Apache server:
Regarding your database error, you will need to provide more information. I visited your homepage and noticed that phpmyadmin is indeed accessible, so is it your login credentials that are being rejected? What are you using for your username when you try to login to phpMyAdmin?
Talk to you soon,
Joe
Ram says
Joe,
We are facing the same issue – After migrating to GCP – the main page works fine. The links from the main page don’t show up and giving 404 error.
Did the Permalink save. Modified the AllowOverride All. IP is static. What are we missing?
(our wordpress was built using a theme and then creating a child scheme so we could make further changes.)
Thank you so much.
Ram
Leron Amin says
Hi Ram,
When I reproduced the error, I was able to solve it by setting the AllowOverride directive to “All” in the Apache2.conf file.
If it’s still not working for you, then make sure you saved the file properly after making the changes, and that you restarted Apache. If it still doesn’t work, I would try doing a Google search for the error and see what you can find on StackOverflow. I know this issue isn’t unique, as I’ve found numerous threads that addressed this issue.
Here are a few resources to get started:
1) Do a Google search for “wordpress permalink post name 404”
2) HTTP 404 with Post name permalink
Let me know if you have questions,
Joe
Melinda says
Hi, Your Tutorial Very helpful, If you have more time, please make an tuturial aboutHow to Install Ion Cube on Google Cloud(WordPress Click Deploy).
ThankYou:)
Leron Amin says
Hi Melinda,
I will look into doing an ionCube tutorial in the future.
Thanks for the great suggestion!
Joe
ggrobot says
Hi again ,
i am keep having the same issue. i upload a photo from media through wordpress dashboard. it shows fine and then it disappears after 2 days.
as you said pagespeed is rewriting it and it doesnt find it afterwards so it returns a 404 error not found.
i searched some threads in the net and found this
”
I am getting 404s for rewritten resources (like example.png.pagespeed.ic.LxXAhtOwRv.png) or for the mod_pagespeed_admin console 🔗
The most common reason that the rewritten resources 404 is because of mod_rewrite RewriteCond rules. For example:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /404 [L,R=301]
This rule causes 404 for all requests which don’t exist on the filesystem, including mod_pagespeed rewritten resources and the mod_pagespeed admin console.
In order to fix this you must add an exception for mod_pagespeed URLs:
RewriteCond %{REQUEST_URI} !pagespeed
This will allow rewritten resources, the admin console and static resources necessary for some filters.
my question is where do i add the exception below where is that file??
RewriteCond %{REQUEST_URI} !pagespeed
Leron Amin says
Hi ggrobot,
The general process is outlined below. However, this is outside of the scope of support that I offer for this tutorial, and I recommend reaching out to Bitnami for exact configuration instructions.
First you will have to make sure that mod_rewrite is enabled in your:
Then add the block to your httpd-app.conf file, adding the pagespeed exception
RewriteCond %{REQUEST_URI} !pagespeed
inside of this block in this file:This is how I would go about doing it, but I haven’t tested this method so proceed at your own risk. As I mentioned before, I’d recommend reaching out to Bitnami to notify them of the issue.
Thanks,
Joe
ggrobot says
Hi joe,
i dont undestand what is going wrong. i uploaded 3 photos to change for my home page, they show fine for 1-2 days and then they disappear or mozilla shows them and chrome doesnt.
i restarted the apache no problem there. i ran gmetrix and there is an error 404 for those specific photos
There are 5 requests that are 404 Not Found. the weird thing is that the file name has changed to something strange https://www.myblog/wp-content/uploads/2018/09/xfilename.jpg.pagespeed.ic.Y281WFqmAM.webp
as you can see file name has an x in front and some other title after jpg.
i saw the same in the log error file
xfilename.jpg:0: Resource based on https://www.mywebsite/wp-content/uploads/2018/09/filename.jpg but cannot access the original
[Tue Sep 25 10:49:43.212925 2018] [pagespeed:warn] [pid 27113:tid 139742257858304] [mod_pagespeed 1.13.35.2-0 @27113] [0925/104943:WARNING:resource_fetch.cc(195)] Fetch failed for resource url https://www.mywebsite/wp-content/uploads/2018/09/xfilename.jpg.pagespeed.ic.Y281WFqmAM.webp
[Tue Sep 25 10:49:43.212956 2018] [pagespeed:warn] [pid 27113:tid 139742414706432] [mod_pagespeed 1.13.35.2-0 @27113] Fetch failed for https://www.mywebsite/wp-content/uploads/2018/09/xfilename.jpg.pagespeed.ic.Y281WFqmAM.webp, status=404
the same applies for the 4-5 photos. not sure what to do here.
will wait for any help you can provide. thank you
ps
[Tue Sep 25 10:56:10.275378 2018] [ssl:warn] [pid 31794:tid 140515660121792] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
i also get this warning but the above problem with the photos is more important as they change after 2-3 days for some reason!!
Leron Amin says
Hi ggrobot,
Your image URLs are being rewritten by mod_pagespeed to optimize them for performance. If you don’t want this feature, you can disable mod_pagespeed by following the instructions here. That being said, there seems to be a problem with your WordPress configuration as your image URLs aren’t showing the .com TLDs – this is a separate issue and is not likely related to pagespeed.
Regarding the certificate error – this indicates that the certificate was issued incorrectly. It was probably caused by a typo when you first issued the certificate. You may need to delete the certificates and reissue them.
Hope this helps,
Joe
ggrobot says
how can i delete the certificates? you mean the ssl that i created with your video right?
ggrobot says
before i disable mod_pagespeed do i need it?? why it affects only the ones i upload now? i dont have .com blog, it is .gr . should i do something with it? should i change the ip in php wp options and make it www. my website .gr?
ggrobot says
Hi joe ,
i encounter a serious problem with the cloud. i have a slider on my website with 3-4 pictures . i changed them and uploaded through the admin page of wordpress in media. but when i open the browser the next day the slider cant read the pictures. they are just blank as if the cloud cant read the url of the pictures correctly. i am not sire what to do here.
have you encounter such thing?
Leron Amin says
Hi ggrobot,
This sounds like a front-end issue and isn’t something I offer support for. I’d recommend reaching out to one of the WordPress groups on Facebook and seeing if someone from the community can help you! I recommend WordPress Experts and WordPress Cloud Hosting Support.
Good luck and talk to you soon,
Joe
ggrobot says
hi joe i have followed every video of your and it is the first time everything works like charm. you are great at what you do.
1.i have a question , i have set up my website on a 0,6 gram engine. will an 3.75gb ram engine improve my loading speed time??
2. i have also entered a static ip address. does it really cost 7 $ per month?? does it worth it over share ips?? i am asking as i dont want to go too high with monthly costs.
thank you
Leron Amin says
Hi ggrobot,
Thanks for the feedback – I’m glad to hear that everything is working correctly!
Increasing the RAM on your machine won’t likely have a noticeable impact on performance, as you’re simply running a WordPress website. The most important upgrade you can make is choosing SSD instead of HDD storage when first configuring your machine. [1][2]
The static IP address will cost around $7 dollars per month if it isn’t attached to a running instance, in which case it is billed at a higher rate of $0.010 per hour. Therefor, assuming 730 hours in a month, the cost can be calculated as follows: 730 x 0.010 = $7.30. Now remember – if your instance is running AND has a static IP address attached to it, you won’t be billed at the higher rate and there will be no extra charge for having your IP set as static.
Let me know if if you have any questions,
Joe
ggrobot says
I thought that going to higher ram cpu’s would help the page but it is good to know there will be no difference in simple wordpress sites.
2. if i may clarify about the static ip , i changed it as you showed it this video.
https://onepagezen.com/reserve-static-ip-address-google-cloud/
i have chosen the micro project. how can i know if it attached to my instance and not charged?
i am concerned as my package now is close to 6-7 dollars while if i am charged with static ip it will go to 14 dollars per month !
Leron Amin says
Hi ggrobot,
Navigate to VPC Network > External IP addresses to view whether or not your static IP is connected to an instance.
Let me know if you have any other questions!
Joe
ggrobot says
Yes it is connected to my website. i guess this means no charge.
1.One last question (for now 🙂 ), will google cloud cdn help me with my page load speed. does it worth it? have you seen monthly costs on average? do you have any video on that?
2. we are all facing the info @ website .gr email problem. is there a way to set up an info business mail? i am using smpt now for the contact forms of the blog.
3. if i need more ram or ssd space how can i change it without stoping the instance. (i read in a pop up that stoping it may corrupt the files?!)
thank you again.
Leron Amin says
Hi ggrobot,
1. Yes – Google Cloud CDN will help with your page load times, but it is expensive and requires the use of a load balancer, which would not be appropriate for your use case. A more appropriate option for you would be Cloudflare CDN, which I go over how to configure in this tutorial.
2. You want to know about configuring email accounts for your domain? I don’t have a tutorial on this right now, but hope to soon.
3. To edit RAM, stop your instance and click on the ‘Edit’ button in order to change the machine type (RAM) settings. To change SSD size, click on ‘Disks’ in the ‘Compute Engine’ left-sidebar column, then click on the persistent disk that’s attached to your VM, then click the ‘Edit’ button at the top of the page to edit the disk’s size.
Hope this information is helpful!
Joe
Mark says
Hi Leron,
Thanks for this wonderful tutorial.
I followed above tutorial step-by-step up to Step 3: Assign a Static IP Address but on Step 2: Configure a Domain Name, I bump into an issue after 5: Edit WordPress URL. After implementing it, I can’t access my website anymore. Initially I thought this is normal since it says domain name changes could take 48 hours to take effect but it’s more than 48 hours already and I still can’t access my website using the URL.
I can still access the website using the IP address but it’s styling was inactive since the site’s layout is pretty messed up.
Other info:
– I used namecheap to register the domain name
– I removed the (.) at the end of the four Google NS records under namecheap’s Custom DNS
NOTE:
I’m new to both setting up WordPress and Google Cloud Hosting. I wanted to use the free trial of Google Cloud Hosting to learn setting up a WordPress site.
Hopefully you can help me on this.
Jeff Cooper says
I am having this same problem, except a little worse.
I was following every step of the tutorial very closely. Nameservers, DNS etc. is all set up correctly, have checked it over and over again.
I pasted the IP/wp-admin in to browser, came up fine, edited the two fields to my url just as in the tutorial, and the SECOND I clicked “save changes” the page switched to an error screen saying it could not load. Any further attempts to go to url/wp-admin OR IP/wp-admin result in same failure to connect error message, however if I simply try and view the site by going to the url.com, I see the default WordPress theme and dummy content, but I am unable to do ANYTHING else.
Did you ever get a resolution to this?
li says
hi, i followed you tut to install the wp on cloud. I found it was max out the cpu so stopped the instance to upgrade the machine and now I’ve turned it back on and it will not connect to the site. I’m not sure where to start troubleshot. Any advice you can offer would be greatly appreciated.
Leron Amin says
Hey Li,
If your website isn’t running after the resize, you should check the following things:
Is your VM started?
Is your Apache server running?
Is your Apache config correct?
Let me know if you’d like a summary on how to check for the things mentioned in the above list.
Talk to you soon,
Joe
Li says
Hey Joe, thank you for you reply, yes if you could direct me to where to I can check those things would be awesome!
Leron Amin says
Hi Li,
If your VM is started, it will have a green ‘check mark’ icon next to it.
To make sure your server and all services are running, run:
To check your Apache configuration for any errors, run:
Hope this helps and let me know if you have any questions,
Joe
Abu Monsur says
Cordial thanks for the informative post. If I use Google Cloud do I need to use a CDN like cloudflare separately for better speed?
Leron Amin says
Hi Abu,
Yes – I would recommend using Cloudflare CDN.
I’m going to be publishing a tutorial on the process in the next couple of weeks. Basically, when using Cloudflare make sure to use the SSL (Strict) mode, and ensure that SSL is configured on your origin server (aka the server that’s running on your VM) prior to enabling this setting. This will provide the highest level of encryption/security for your website.
For instructions on how to configure SSL for your WordPress website on Google Cloud, check out the tutorials for Click-to-deploy or Bitnami, depending on which version you’re using.
Let me know if you have any questions,
Joe
Udi says
Is there a version on GCP cloud launcher for WordPress + cPanel?
Why wouldn’t google add a cPanel option to their “Click to deploy” version? They didn’t include a cPanel on purpose?
Thanks,
Udi
Leron Amin says
Hi Udi,
There isn’t a cPanel configuration because most developers on the Cloud don’t use cPanel.
cPanel is simply a graphical user interface to simplify the website management process for users who haven’t had much experience using the command line interface.
Here’s a detailed tutorial with instructions on how to configure cPanel on Google Cloud.
Hope this helps and let me know if you have any questions!
Joe
Udi says
Cool Thanks!
Michael says
Hello Joe,
Thanks for the great post.
Can you provide a guide on installing ioncube Loader on Google Cloud? Some plugins on WordPress requires Ioncube Loader.
Thanks
Himanshu says
Can we host a site perfectly using 300$ credit? N is it really worth shifting namecheap shared to this plan just for the sake of free for year?
Cheers!!
Leron Amin says
Hi Himanshu,
You should not move to Google Cloud just to save money – you will spend a huge amount of time learning how to use the platform itself. If all you’re looking to do is find the cheapest host possible, try a managed hosting provider such as BlueHost.
Let me know if you have any questions,
Joe
Michael Russ says
I have the following questions:
1. How do you know the verdict n of cURL libraries that is installed?
2. How do you enable or install ioncube loader?
3. How do you configure the Php.ini?
Ehab Aly says
Hello my friend
Thanks for the great tutorial
Really we need to learn how to setup load balancer and Cdn after that tutorials
Leron Amin says
Thanks for the feedback Ehab!
CDN tutorial is coming soon so stay tuned!
Joe
Chandresh says
I am using google easy to deploy wordpress multisite option after deployment not able to login to database tried via putty making tunnel but didn’t worked. How to login to access database. 2nd thing I created subdirectory using milti site getting error as example.com/india/wp-admin.php not found. Kindly advice
Leron Amin says
Hi Chandresh,
For Click-to-Deploy, phpMyAdmin is installed automatically when you deploy the WordPress stack. Access it through your domain: yourdomain.com/phpmyadmin
At this point I don’t offer support for Multisite, but I would recommend using the Bitnami Multisite stack as they have an excellent documentation on the subject.
Hope this helps!
Joe
ansri says
I have installed WordPress following your article. What I want to know is how secure is my site now on Google cloud. Is there Firewall and other security enabled by default or do I need to setup or configure firewall or anything?
Leron Amin says
Hi Ansri,
The default firewall rules are configured as required by your application – WordPress – so I wouldn’t mess with them because they are already optimized.
If you get started with advanced configurations such as load balancing/CDN, make sure to follow the walk-through from Google Cloud, as they document best practices regarding firewall settings.
Hope this helps,
Joe
Sandy says
Thanks mate – the tutorial helped a lot. Could you guide on how to host multiple WordPress websites on a single VM please?
Leron Amin says
Hi Sandy,
I will be releasing a Multisite tutorial soon, so stay tuned!
Mike says
This will be great! Bitnami or regular? Any idea when it will be out around? Your tutorials are great man.
Leron Amin says
Hi Mike,
Thanks for the feedback on the tutorials. 🙂
I will do a tutorial for both of them, Click-to-Deploy and Bitnami.
You can expect one of them sometime next week!
Thanks,
Joe
nuthalapati sivakumar says
hi leron
thank you for this great tutorial waiting for
How to host multiple websites on Google Cloud compute engine?
thank you
Leron Amin says
Hello Nuthalapati,
Multisite tutorials are coming!
Please take the poll on the Facebook page to vote on whether the tutorials should be made for Multisite Bitnami or Multisite Click-to-Deploy.
You can learn more about the difference between the two here.
Let me know if you have any questions, 🙂
Joe
Afry says
Hi Leron,
Thank you for the great article os getting started with Google Cloud,
i have a question, how to host multiple domain on google cloud compute engine?
Can you please make a tutorial for that?
i have googled for my question and it just made me confused.
Leron Amin says
Hi Afry,
Were you wondering about:
How to host multiple websites on Google Cloud compute engine?
or How to host multiple websites with different domains on a single compute engine virtual machine?
or How to point multiple domains to a single website on Google Cloud?
Let me know and I will look into making a tutorial on the subject.
Talk to you soon, 🙂
Joe
Afry says
so yeah, i’ve found the way, so my original question is how to host multiple domain (wordpress website) in a single compute engine, so i just used the server pilot to install the wordpress and make the new Zone in the Cloud DNS at the google cloud console, and then i setup the DNS at the registrar.
if you want to make your website to have a secure HTTPS, you can use cloudflare service (remember to install the cloudflare plugin in your wordpress and set the SSL to be flexible at the cloudflare control panel on their website), just be patient as the process to change the HTTP to HTTPS can take up to 12 hours
Leron Amin says
Hi Afry,
I am glad you were able to find a solution!
Anyways, thanks for sharing the tips on CloudFlare. I’ve personally never tried their SSL service, but I am glad to hear that it has worked for you.
Talk to you soon,
Joe
ggrobot says
hi guys i was wondering the same thing. can i host multiple domains in one single compute engine?
how can i do it? please shed your lights
thank you
Benjamin Waller says
Hello Joe,
This is another excellent article. I like that you have nicely packaged your tutorials into easily to follow steps. Also doing a cost and “is it right for me” comparison are great additions.
BTW. I don’t see the links to the Bitnami tutorials you did for installing and setting up WordPress on the Google Cloud Platform anymore. In doing so, are you advising not to go in that direction? I haven’t started yet because I am too busy and don’t have the time to re-develop my website and setting it up on the CGP right not but I was thinking of going down the Bitnami path.
If you don’t think Bitnami is a good option, I be curious to know you reasons.
Best regards,
Ben Waller
Leron Amin says
Hey Benjamin,
Thanks for leaving a comment!
I felt it was important to include the section about cost because of the significant variations in cost between the various configurations. I also felt it was important to include the “is it right for me” section to make sure that people are aware of what they are getting themselves into 😛
The reason I didn’t include the Bitnami tutorials in the ‘beginners guide’ is simply because I’ve found that the Bitnami version of WP on GCP is harder to configure than the Click-to-deploy version. Additionally, troubleshooting is easier on the Click-to-Deploy version because it uses a very standard LAMP stack configuration. This means that users are more easily able to use Linux/Apache support forums ‘out of the box’, without having to consider the unconventional directory structure of Bitnami’s WP configuration.
The thing that I like about Bitnami, however, is their thorough documentation and support forums. I also like how they use an almost ‘standardized’ configuration across all of their stacks, which makes it easy to jump between stacks and/or integrate new ‘solutions’ from their extensive library.
If you wanted to go down the ‘Bitnami’ route, the only thing you would have to change is to use the Bitnami versions of tutorials 1 and 6, instead of the Click-to-Deploy versions. Easy enough 🙂
Thanks again for taking the time to post a comment. And when you do get started with WP on GCP, feel free to reach out to me with any questions/concerns/issues you run into during setup.
Talk to you soon, 🙂
Joe
Leron Amin says
What did you think of this tutorial?
Please share your questions and comments below!
Thanks, 😀
Joe