back to top
Thursday, September 19, 2024
spot_img

WordPress On Google Cloud: From Scratch to Production

Share This Post

Welcome to our Google Cloud Platform guide. Today we will be discussing about hosting your WordPress on Google Cloud, GCP’s Always Free & $300 Free Credit, how to create an account, spinning up an Instance, tweaking it and installing LEMP Stack + WordPress CMS.

Here are the things you need for this tutorial:

  • A Google Cloud Account (Read More Below)
  • Domain Name.
  • Cloudflare Free Account.

Google Cloud Platform- Short Review:

Google Cloud Platform is a suite of apps and engines that Google itself uses to deliver its products; i.e. YouTube, Google Earth, ETC. In the suite, Google provides over 90 products, Such as App Engine, Kubernetes Engine, Compute Engine, Cloud Storage, Managed SQL and much more. If You like to read more about the other tools, Read our Review of Google Cloud Platform.

Step 1 : Creating an Account :

Supposing you already have a google account, Head over to GCP Portal and sign up for a new account. You will also get $300 Promotional credit which we will use to avail top-tier web hosting free for a whole year.

Step 2 : Create a new Project :

Now Head over to the Google Cloud Console and create a new project by going to the main menu bar, Select the New Project icon, Supply a name and wait for a second, your new project will be built successfully and now open by default on GCP Console. If not, Select it to make it active. Think of projects as working directory, each project can have different structures and resources.

Step 3 : Enable Cloud Compute Engine API :

To use Cloud engines, You must first enable its API on your project. To do this, Go to the Cloud Console API Library, Select your project, Search for Compute Engine API, Select it and enable it for your project.

Step 4 : Creating a Compute Engine Instance :

Head again to your console, With your project selected and Compute Engine API Enabled, Open the Compute Engine Menu, Select Create New Instance. Provide it with a name (Default host.domain.tld), Select region and zone to US-Central1.

On Machine configuration, Select
Machine family : General Purpose;
Series : N1;
Machine Type : N1-Standard-1 (1v Core, 3.75GB Of RAM)

Scroll Down to the Boot disk Section, Click on it and set these parameters :
Operating System : Debian;
Version : 10;
Boot disk type : SSD, Space 15GB; (Increase if required)

Scroll Down to the Identity and API access, Select Compute Engine Default Service Account. In Access Scope Allow Default Access and in Firewall select Allow HTTP and HTTPS service checkbox.

Now click on Management, security, disks, networking, sole tenancy icon, Select Networking and insert a proper hostname (host.yourdomain.com) in hostname section. Also select the External IP Section to get an external IP that you’ll need to map to your DNS.

Click Create. This whole setup will cost you about $26 per month and for the first year the whole cost will be deducted from your free credits.

Step 5: Setting up the instance:

Connect to your new instance by using SSH -> Connect in Browser Window.
Start Issuing these commands:

//Getting elevated privileges and updating system:

sudo -i
apt-get update
apt-get upgrade

//Setting up swap:

fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
nano /etc/fstab
paste : /swapfile swap swap defaults 0 0
nano /etc/sysctl.conf
paste : vm.swappiness=10

//Installing Wordops For LEMP Stack automation:

wget -qO wo wops.cc && bash wo
source /etc/bash_completion.d/wo_auto.rc
wo stack install
wo site create host.example.com -le
wo stack install --ufw

Step 6 : Making Connections :

Now Forward your Domain to your google cloud instance IP by setting proper A, AA and CNAME Certificates. When you have pointed then correctly, you can access the default WordPress website on your domain and WordOps Dev Tools on port 22222 (add exception in google cloud firewall) of your domain.

Note : Other Methods for installing WordPress:

In this tutorial we used a Compute Engine to launch our custom LEMP Stack, there are other ways in which we can install WordPress on google cloud, some are even easier. You can deploy a scalable version of WordPress across multiple container (Docker) instances on GKE or You can deploy a scalable version of WordPress across multiple App Engine (full-managed server) instances.

Pilāni
broken clouds
26.8 ° C
26.8 °
26.8 °
77 %
2.1kmh
63 %
Thu
27 °
Fri
32 °
Sat
35 °
Sun
37 °
Mon
38 °

Related Posts

Using Seeed Studio mmWave Module with ESPHome

In the ever-expanding universe of smart technology, the fusion...

Raspberry Pi Automatic Fans Using L298n PWM

Welcome, We all know Raspberry Pi SBC Likes to...

MotionEye on Raspberry Pi: Proper Surveillance Software?

Welcome to another Raspberry Pi Post, this time we...

DIY Home Automation: ESP Home & Home Assistant

ESPHome is a powerful tool that simplifies the process...

Raspberry Pi Zero Explained: Comparing the Zero Family

The Raspberry Pi Zero series, known for its compact...

Aliens Guide to Earth’s Solar System

Position 00 - The Sun. Position: #0. The gravitational...
- Advertisement -spot_img