How to setup WordPress on Windows in GCP

To setup a WordPress server in GCP, the easiest way is to install our WordPress Windows VM solutions from the GCP marketplace.  Its the recommended way to deploy WordPress on Windows using MySQL server into Google GCP.  Also comes preinstalled with phpMyadmin, MySQL, PHP, Apache.  Click on the links below to deploy to your GCP project.

Setting up WordPress on Windows 2019 in GCP

 

Deploy WordPress on Windows 2019 on GCP

Setup WordPress in GCP

Setting up WordPress on Windows 2016 in GCP

 

Deploy WordPress on Windows 2016 on GCP

Google wordpress

RDP into new WordPress Server

 

Once you have deployed our WordPress server, the first step is to RDP into the new instance once it has fully booted up.  The following links explain how to connect the VM once it has finished being deployed:

 

 

Once logged in, you’re now ready to start setting up WordPress as per the getting started section next

Getting Started

 

Once you’ve deployed the WordPress server to GCP you’re ready to start using it. The below sections explain how to use and login to your new WordPress server and making any configuration changes.

 

Login / Server Details

 

MySQL database credentials are (also used for phpMyadmin login):
MYSQL Username: root
MYSQL Password: Password is the VM Instance ID. To find the Instance ID you will find on the property details of the VM within your GCP console. Here is a screenshot of where you will find it:

setup wordpress in GCP

NOTE: If you find the root password doesn’t work. Wait 5 mins as during the first boot a start script is setting the root MySQL password and could still be running. You can see if its still running by viewing any Windows task schedule jobs. Wait for it to finish and then try logging in again.

 

WordPress files location:

C:\Apache24\htdocs\

 

PHP Files location:

C:\php

 

Apache location

C:\Apache24

 

PhpMyadmin location:

C:\Apache24\htdocs\phpmyadmin

 

MySQL location

C:\tools\mysql\current\

 

Setting up WordPress

 

The first step is to create a MySQL database and MySQL user account that will be used to host WordPress.

 

Launch PhpMyadmin (http://localhost/phpmyadmin)

 

Login with:

Username: root
Password: Password is the VM Instance ID. To find the Instance ID you will find on the property details of the VM within your GCP console.

NOTE: If you find the root password doesn’t work. Wait 5 mins as during the first boot a start script is setting the root MySQL password and could still be running. You can see if its still running by viewing any Windows task schedule jobs. Wait for it to finish and then try logging in again.

 

Click on the Databases Tab and enter a database name for the database you want to create and from the dropdown menu choose ‘utf8mb4_unicode_ci‘ as the DB collation as in the following screenshot:

GCP wordpress

 

Once you press ‘create’ the DB is now created. Next we need to create a user account and give it privileges on the newly created DB.  Select the Privileges tab and select Add user account

 

setup GCP WordPress

 

Fill in a username and password and make sure ‘Native MySQL authentication‘ is selected under ‘Authentication Plugin’ from the drop down menu. Then select ‘Grant all privileges on database‘ and ‘Global privileges‘ Check all is selected and then press Go as per the screenshot:

 

DB-USER-Privileges

 

Next we are ready to start the WordPress setup step. Open the desktop shortcut called localhost. It points to (http://localhost)

wordpress setup

 

Choose your language and select continue.  On the welcome page continue to the database setup screen pressing ‘Lets go’ and enter the newly created database and user details:

install wordpress on GCP

 

After hitting submit, on the next screen press ‘Run the installation‘.

wordpress GCP setup

 

Now enter your sites title, a username and your email address and press Install WordPress

hosting wordpress in google cloud

 

And that should now be completed and you are now ready to use WordPress.

Access WordPress over the Internet

 

If you want to access the website externally. You will need to make sure your VM has a public IP address (External IP).

 

Within the WordPress directory (C:\Apache24\htdocs) – Open the (wp-config.php) file and add the following lines towards the top

 

define(‘WP_HOME’,’http://Public-IP’);
define(‘WP_SITEURL’,’http://Public-IP’);

 

As shown in my example

 

Then restart ‘Apache’ 

 

Also make sure any GCP firewalls have port 80/443 open to the internet.

 

If you want to access the website using a domain name, you’ll need to configure a CName record in your public DNS to point to the public IP address of your virtual machine hosting your WordPress website.  You will be able to do this in your domain registrar where your domain name is hosted.

 

Within your domains registrar DNS settings, add new CName record

 

Under host add “@” and “www” the value it should point to the public IP address of your GCP virtual machine where your WordPress website is hosted.

 

Depending how quickly DNS propagates accross the internet, may take a few hours, you should be able to use your domain name to access your Google wordpress website

 

Next is to update your (wp-config.php) file with your domain name settings as we did previously, instead of public ip.

 

Within the WordPress directory (C:\Apache24\htdocs) – Open the (wp-config.php) file and add the following lines towards the top

add your domain name as per the following example:

 

define(‘WP_HOME’,’http://www.domain.com’);
define(‘WP_SITEURL’,’http://www.domain.com’);

 

 

Then restart ‘Apache’ 

 

WordPress Firewall Ports

 

The apache webserver uses the following ports:

 

TCP/80 – (http traffic)

TCP/443 – (https traffic)

 

Mysql uses the following port:

TCP/3306

 

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Support

 

If you have any questions about this WordPress deployment or are experiencing any issues with your deployment leave your comments below and i will answer them for you within 24 hours.

 

If you would like to hire us to setup your WordPress server for you, get in touch and we can get you up and running 

.

Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud

No Comments

Post a Comment

Comment
Name
Email
Website