1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice
  2. The hosting section is sponsored by Hostwinds visit the BHW Partnership program for your exclusive BHW member hosting benefit today.
    MUST be signed into your BHW account.
    Dismiss Notice

How to setup a fast loading WordPress on GCP

Discussion in 'Web Hosting' started by Emmanuel A, Apr 30, 2019.

  1. Emmanuel A

    Emmanuel A Newbie

    Joined:
    Feb 19, 2018
    Messages:
    42
    Likes Received:
    10
    Gender:
    Female
    A step-by-step guide to launching high-performance WordPress site on Google Cloud Platform (GCP) using WordPress.

    When you start as a blogger or running a small business then shared hosting is fine as it cost less and no hosting skills required to install/setup/maintain the infrastructure platform.

    However, when your traffic or user base increase then you need a robust hosting platform to serve millions of customer without slowing down the site.

    There are some premium hosting providers for heavy traffic website, but that would easily cost $100+ per month.

    Note: Kinsta recently announced starter plan starting at $30 per month which leverage GCP.

    However, if you are ok to spend a little bit of time learning and doing by yourself, then you can think about VPS/Cloud servers.

    In this article, I will explain how to get WordPress site running on Google Cloud Platform in less than 15 minutes.

    This setup would cost around $25 per month and ready to serve 500,000 page views per month. Post setup, I will do a load test to verify the performance.

    Prerequisite
    • I assume you already have a domain, if not you can buy from Namecheap or Google.
    • Google cloud account with billing enabled
    • Some WordPress theme but I will use Newspaper by Tag die
    Provision New Google Cloud Server
    • Login to Google Cloud and go to Compute Engine >> VM Instances (direct link)
    • Click “Create Instance” and enter the required information
    • Select the zone (choose the nearest location of your targetted audience)
    • Choose the machine type
    • Change boot disk to Ubuntu 18.04 LTS and boot disk type to SSD persistent disk with 10 GB size
    • Allow HTTP and HTTPS firewall and click Create
    [​IMG]

    In a few seconds, you will have the new instance ready.

    [​IMG]

    Installing WordPress using WordOps
    There are multiple ways to install WordPress, but one of the easiest ways is using WordOps

    WordOps is a script wrapper which takes care of installing required components like a database, PHP, Nginx, WordPress, etc.

    If you install them manually, then it may take longer and room for human errors.

    • Login to newly created Google Cloud VM and switch to root user
    Note: it’s recommended to setup sudo access to root from a normal user in production, but in this exercise, I will use root.

    • Install WordOps with the below command
    wget -qO wo wordops.se/tup && sudo bash wo
    It will take a minute or two and once done; you will be returned to the prompt

    Finished processing dependencies for wo==3.9.1
    Running post-install steps
    Synchronizing wo database, please wait…

    For WordOps (wo) auto completion, run the following command

    source /etc/bash_completion.d/wo_auto.rc

    Yay! WordOps (wo) installed/updated successfully
    WordOps (wo) help: https://wordops.org/docs
    Now it’s time to create a WordPress site. WordOps gives you an option if you want to install WordPress with caching plugins.

    Currently, it supports WP Super, W3 Total, Nginx, Redis. I’ve tried all and Redisalways performed better for me.

    • Let’s create a site with Redis cache.
    wo site create yourwebsite.com –wpredis
    Above, I am asking WordOps to create a site for geekflarelab.com (It’s my lab domain) with Redis cache.

    • You will get an experimental information configuration, type,y and press Enter
    [email protected]:~# wo site create geekflarelab.com –wpredis
    Redis is experimental feature and it may not work with all CSS/JS/Cache of your site.
    You can disable it by changing cache later.
    Do you wish to enable Redis now for geekflarelab.com?
    Type “y” to continue [n]:y
    It will take a few seconds, and you will be returned to the prompt with WordPress login credential.

    WordPress admin user : Chandan
    WordPress admin user password : xxxxxx
    Configure redis-cache: http://yoursite.com/wp-admin/options-general.php?page=redis-cache
    Object Cache: Enable
    Successfully created site http://yoursite.com
    [email protected]:~#
    • Save the password in secure place.
    WordPress is successfully installed, and it’s time to point your domain to server IP.

    Getting Static IP
    By default, Google Cloud assign an ephemeral IP to the instance which you don’t want to configure with the domain as it may change in next instance reboot.

    To avoid the risk, we will reserve a static IP.

    • Go to VPC Network >> External IP addresses from the left navigation
    • Drop-down Ephemeral type and select static
    [​IMG]

    • Give the name and click RESERVE
    • You will notice type is changed to Static
    [​IMG]

    GCP VM is ready with the static external IP and WordPress, and the last thing to do is map domain to the static IP.

    Update Domain A Record
    • Go to a domain registrar
    • Update the A record for your domain to the external IP you just reserved
    It may take some time to get propagated globally. You can use the DNS record lookup tool to verify.

    Once domain A record is updated, you can access WordPress site with the domain you used with WordOps command. In my example – http://geekflarelab.com

    Performing Load Test
    Let’s see how newly setup WordPress site on Google Cloud Platform performs. Before doing a speed test, I will install a theme by Tagdiv as mentioned earlier.

    This is not necessary but to ensure I have some post/media files to simulate real-site scenario.

    [​IMG]

    So as you can see geekflarelab.com is ready on GCP.

    There are multiple ways to perform benchmarking, and one of the easiest ways is to do from a cloud. I used Loader.io to put a load for 100 to 500 users for a one-minute duration, and the results are:

    Average response time = 695 ms

    [​IMG]

    I know this is a basic WordPress setup and require to install additional plugins, add security, SSL certificate, etc. in a production environment. But that would increase the load time by few percentages.

    I hope this gives you an idea of how to set up WordPress on Google Cloud Platform to serve over 100 users concurrently per minute.

    This requires a little bit of time to set up and skills, but if you would like to save $$ per month, then I believe it’s worth it.

    Alternatively, if you don’t have time to set up or manage WordPress and at the same time want to enjoy Google Cloud, then you can try Cloudways managed hosting platform.
     
    • Thanks Thanks x 1
  2. mhtro

    mhtro Supreme Member

    Joined:
    Dec 3, 2017
    Messages:
    1,243
    Likes Received:
    1,467
    Change text colour and most images dont work.
     
    • Thanks Thanks x 2
  3. Finn

    Finn Jr. VIP Jr. VIP

    Joined:
    Apr 22, 2013
    Messages:
    2,065
    Likes Received:
    1,271
    Occupation:
    SEO Consulting & Support:
    Home Page:
    @Emmanuel A - Please update the font color as long as you are able to edit your post.

    That is how your text looks on the black theme, which most members are using by default:

    [​IMG]
     
  4. grnugroho

    grnugroho Jr. VIP Jr. VIP

    Joined:
    Jan 6, 2014
    Messages:
    246
    Likes Received:
    76
    Occupation:
    Bounty Hunter
    Location:
    Terra
    MY EYES HURT.

    No seriously you should change the text color
     
  5. RoiBox

    RoiBox Regular Member

    Joined:
    Apr 4, 2009
    Messages:
    411
    Likes Received:
    233
    Occupation:
    Internet Entrepreneur
    Location:
    Gothenburg | Sweden
    Home Page:
    I did not even bother to try and read that bad text color .. Umpf .. =(
     
  6. nahid133

    nahid133 Jr. VIP Jr. VIP

    Joined:
    May 7, 2011
    Messages:
    1,662
    Likes Received:
    505
    Gender:
    Male
    Occupation:
    finding intruders
    Location:
    192.168.0.1
    Home Page:
    It looks like I'm watching GOT S8 E03
     
    • Thanks Thanks x 1
  7. Kingsmarque

    Kingsmarque Junior Member

    Joined:
    Jun 28, 2017
    Messages:
    135
    Likes Received:
    36
    Gender:
    Male
  8. grnugroho

    grnugroho Jr. VIP Jr. VIP

    Joined:
    Jan 6, 2014
    Messages:
    246
    Likes Received:
    76
    Occupation:
    Bounty Hunter
    Location:
    Terra
    I understood that reference.
     
  9. kindablack

    kindablack Jr. VIP Jr. VIP

    Joined:
    Aug 10, 2014
    Messages:
    329
    Likes Received:
    93
    Occupation:
    Your 'Speed' Guy
    Home Page:
    How to become blind in 2 minutes
     
    • Thanks Thanks x 1
  10. Topg338

    Topg338 Newbie

    Joined:
    Aug 26, 2015
    Messages:
    31
    Likes Received:
    6
    Thought my phone went to shit.
     
  11. Emmanuel A

    Emmanuel A Newbie

    Joined:
    Feb 19, 2018
    Messages:
    42
    Likes Received:
    10
    Gender:
    Female
    A step-by-step guide to launching high-performance WordPress site on Google Cloud Platform (GCP) using WordOps.

    When you start as a blogger or running a small business then shared hosting is fine as it cost less and no hosting skills required to install/setup/maintain the infrastructure platform.

    However, when your traffic or user base increase then you need a robust hosting platform to serve millions of customer without slowing down the site.

    There are some premium hosting providers for heavy traffic website, but that would easily cost $100+ per month.

    Note: Kinsta recently announced starter plan starting at $30 per month which leverage GCP.

    However, if you are ok to spend a little bit of time learning and doing by yourself, then you can think about VPS/Cloud servers.

    In this article, I will explain how to get WordPress site running on Google Cloud Platform in less than 15 minutes.

    This setup would cost around $25 per month and ready to serve 500,000 page views per month. Post setup, I will do a load test to verify the performance.

    Prerequisite
    • I assume you already have a domain, if not you can buy from Namecheap or Google.
    • Google cloud account with billing enabled
    • Some WordPress theme but I will use Newspaper by Tag die
    Provision New Google Cloud Server
    • Login to Google Cloud and go to Compute Engine >> VM Instances (direct link)
    • Click “Create Instance” and enter the required information
    • Select the zone (choose the nearest location of your targetted audience)
    • Choose the machine type
    • Change boot disk to Ubuntu 18.04 LTS and boot disk type to SSD persistent disk with 10 GB size
    • Allow HTTP and HTTPS firewall and click Create
    [​IMG]

    In a few seconds, you will have the new instance ready.

    [​IMG]

    Installing WordPress using WordOps
    There are multiple ways to install WordPress, but one of the easiest ways is using WordOps

    WordOps is a script wrapper which takes care of installing required components like a database, PHP, Nginx, WordPress, etc.

    If you install them manually, then it may take longer and room for human errors.

    • Login to newly created Google Cloud VM and switch to root user
    Note: it’s recommended to setup sudo access to root from a normal user in production, but in this exercise, I will use root.

    • Install WordOps with the below command
    wget -qO wo wordops.se/tup && sudo bash wo
    It will take a minute or two and once done; you will be returned to the prompt

    Finished processing dependencies for wo==3.9.1
    Running post-install steps
    Synchronizing wo database, please wait...

    For WordOps (wo) auto completion, run the following command

    source /etc/bash_completion.d/wo_auto.rc

    Yay! WordOps (wo) installed/updated successfully
    WordOps (wo) help: https://wordops.org/docs
    Now it’s time to create a WordPress site. WordOps gives you an option if you want to install WordPress with caching plugins.

    Currently, it supports WP Super, W3 Total, Nginx, Redis. I’ve tried all and Redisalways performed better for me.

    • Let’s create a site with Redis cache.
    wo site create yourwebsite.com --wpredis
    Above, I am asking WordOps to create a site for geekflarelab.com (It’s my lab domain) with Redis cache.

    • You will get an experimental information configuration, type,y and press Enter
    [email protected]:~# wo site create geekflarelab.com --wpredis
    Redis is experimental feature and it may not work with all CSS/JS/Cache of your site.
    You can disable it by changing cache later.
    Do you wish to enable Redis now for geekflarelab.com?
    Type "y" to continue [n]:y
    It will take a few seconds, and you will be returned to the prompt with WordPress login credential.

    WordPress admin user : Chandan
    WordPress admin user password : xxxxxx
    Configure redis-cache: http://yoursite.com/wp-admin/options-general.php?page=redis-cache
    Object Cache: Enable
    Successfully created site http://yoursite.com
    [email protected]:~#
    • Save the password in secure place.
    WordPress is successfully installed, and it’s time to point your domain to server IP.

    Getting Static IP
    By default, Google Cloud assign an ephemeral IP to the instance which you don’t want to configure with the domain as it may change in next instance reboot.

    To avoid the risk, we will reserve a static IP.

    • Go to VPC Network >> External IP addresses from the left navigation
    • Drop-down Ephemeral type and select static
    [​IMG]

    • Give the name and click RESERVE
    • You will notice type is changed to Static
    [​IMG]

    GCP VM is ready with the static external IP and WordPress, and the last thing to do is map domain to the static IP.

    Update Domain A Record
    • Go to a domain registrar
    • Update the A record for your domain to the external IP you just reserved
    It may take some time to get propagated globally. You can use the DNS record lookup tool to verify.

    Once domain A record is updated, you can access WordPress site with the domain you used with WordOps command. In my example – http://geekflarelab.com

    Performing Load Test
    Let’s see how newly setup WordPress site on Google Cloud Platform performs. Before doing a speed test, I will install a theme by Tagdiv as mentioned earlier.

    This is not necessary but to ensure I have some post/media files to simulate real-site scenario.

    [​IMG]

    So as you can see geekflarelab.com is ready on GCP.

    There are multiple ways to perform benchmarking, and one of the easiest ways is to do from a cloud. I used Loader.io to put a load for 100 to 500 users for a one-minute duration, and the results are:

    Average response time = 695 ms

    [​IMG]

    I know this is a basic WordPress setup and require to install additional plugins, add security, SSL certificate, etc. in a production environment. But that would increase the load time by few percentages.

    I hope this gives you an idea of how to set up WordPress on Google Cloud Platform to serve over 100 users concurrently per minute.

    This requires a little bit of time to set up and skills, but if you would like to save $$ per month, then I believe it’s worth it.

    Alternatively, if you don’t have time to set up or manage WordPress and at the same time want to enjoy Google Cloud, then you can try Cloudways managed hosting platform.
     
  12. Elegante

    Elegante Regular Member

    Joined:
    Jul 6, 2015
    Messages:
    246
    Likes Received:
    80
    Some of the worst copy and paste I've ever seen. You didn't even bother updating the old thread, you just fixed the color on a new post...
     
    • Thanks Thanks x 1
  13. Emmanuel A

    Emmanuel A Newbie

    Joined:
    Feb 19, 2018
    Messages:
    42
    Likes Received:
    10
    Gender:
    Female
    Sorry am unable to edit the old post......... I will appreciate if the Mod could help with that.

    it might truely be a copy and Paste article but am sure some people might need it, like people who need to host a WordPress website for a short period of time, as they might get it WordPress hosting freely using the GCP $300 free credit.

    Even i do use it lot of times when working on a project for the first time. Am sorry for any inconveniences i might have caused, but if you have any issue drop me a P.M and i will be glad to help, as have gained a lot from this platform and have not come across GCP, tutorial the few times have used the platform which is why i think this will be useful for some.
     
    Last edited: Apr 30, 2019
  14. Elegante

    Elegante Regular Member

    Joined:
    Jul 6, 2015
    Messages:
    246
    Likes Received:
    80
    No problem, I didn't know you were not able to. You should be able to see "Edit" on the bottom left, right under your first message. ;)
     
  15. Emmanuel A

    Emmanuel A Newbie

    Joined:
    Feb 19, 2018
    Messages:
    42
    Likes Received:
    10
    Gender:
    Female
    The option is not there. Am sure the Moderators will be able to help with that when they come across the post. Sorry bro.
     

    Attached Files:

  16. Gorkonn

    Gorkonn Newbie

    Joined:
    Apr 5, 2019
    Messages:
    3
    Likes Received:
    2
    Gender:
    Male
    Is this blackhat SEO on the Blackhat world forum lol... why everything is black color?

    WordOps is just only Easyengine fork same Webinoly from my research, why is Bash command so difficult for everyone these days? too much Facebook and UI for them maybe

    try SlickStack alternative script is include Bash CLI only with LEMP stack can use in any cloud network like Vultr, DigitalOcean, SSDnodes, AWS, Google etc

    the main problem in Wordpress stack is not about Nginx (mostly everyone can install Nginx these days) , the real problem is good environment to limit WP Core bloatware and shitty plugins that bundle some malware, spamware, or bloated scripts, and this is why SlickStack is focus about good LEMP configuration and also MU plugins optimization too