This article provides complete guide for hosting WordPress Multisite on Google cloud platform. Currently, two WordPress multisite stacks are available on Google cloud platform- one Certified by Bitnami and other Click to deploy.
Want to learn complete Web Development with certification? Enroll Now for Web Development Certification Training By Edureka and increase your chances to get hired by Top Tech Companies.
We will go through following steps for hosting reliable, safe and fully functional wordpress multisite websites (through this process, our WordPress Multisite Certified by Bitnami and Automatticstack will be deployed on Google Cloud compute engine).
- Create Gmail Account
First of all, we need to create our google account (Gmail Account) because that Gmail will be required to sign up for Google Cloud Platform (GCP). Gmail is required for signing up with all the Google services. If you already have Gmail account, you may proceed to the next step. Create Gmail Account.
- Create Free Trial GCP Account
After creating your Gmail Account, head over to Google Cloud Platform (GCP). Sign up for your Free Trial GCP Account. On GCP website, Click Get Started for Free button and follow the Account creation steps on the screen. Enter all required Personal Information details and Billing Information to create your GCP Account. You need to provide your credit card information for setting up billing account and verifying payment transaction. Rest assured, Google does not charge your credit card ever without you entering in an agreement to do so for some service. After GCP Account is set up, you can use all the technology resources available on the platform.
- Deploy WordPress Multisite Instance
Sign in to your GCP Account with your Gmail. Then go to Console. Click on Project menu on top and create new project by giving Project Name you like. By default, a project by name My First Project is created.
Then, click on the Hamburger icon (≡) on top left and click the menu Marketplace. Type WordPress on Search bar. Many WordPress solutions will be listed. Go to WordPress Multisite Certified by Bitnami and Automattic. This is one of the best WordPress packages available.
Click Launch button which will take you to New WordPress Multisite Certified by Bitnami and Automattic Deployment screen. Fill up your Zone and Disk size details or you may go with the defaults. Then click Deploy button. Deployment will take a couple of minutes and you will see details of your WordPress Multisite instance deployment on the right side. You may check your deployment here or as described in next the step.
- Check your WordPress Multisite Deployment
Click on Hamburger icon (≡) on top left and select Deployment Manager. Select your WordPress Multisite Deployment. If you click on the Site Address URL, you will be redirected to the Sample page of your WordPress Multisite website. If you click on the Admin URL, you will be redirected to the WordPress Admin Login page. Here, fill up your Admin User ID and Admin Password from your Deployment details. Thereafter you will reach on Admin Dashboard of your WordPress multi-site. Here you will be building and making changes (edits) to your website(s) as Administrator, after all the following set up steps are complete.
- Reserve static external IP Address
Now, Click on Hamburger icon (≡) on top left corner and select VPC Network >> External IP Addresses. Click on Reserve IP Address. Fill up all details and click Reserve. Here, change External IP Address Type from Ephemeral to Static. We do this because, when a stopped instance is started again, a new ephemeral external IP address is assigned to the instance, and we don’t want the IP Address to change each time our instance is restarted.
- Create and Configure DNS Zone for your WordPress Multisite Hosting
Click again on Hamburger icon (≡) on top left corner of GCP screen and select Networking >> Network Services >>Cloud DNS. Here, click on Create Zone button. Fill up Zone name (usually your website domain name, in lower case, eg. example) and DNS Name (your domain name address, eg. example.com). Select Zone Type Public and DNS Sec OFF. Click Create. DNS Zone will be created.
Now create “A” Record and “C” Record:
To create “A” record, click on Add Record Set. In DNS Name field, type subdomain name or leave blank, as is the case. You may type * to indicate any Sub-Domain. In Record Type field, choose ‘A’. In IPv4 field, type or paste External IP Address. Click Save.
To create “C” record, click on Add Record Set. In DNS Name field, type subdomain “www”. In Canonical Name field, type alias this www Sub-Domain refers to (website Address, e.g., example.com).
- Do Modification in DNS Zone of your Domain Name Provider/ Registrar
Log in to Domain Name Registrar’s website and go to DNS Records or DNS Zone. Here, either change Name servers to point to your hosting or add the ‘A’ record of your hosting.
(i) Change Name Servers – Add all four Name Server Records of your hosting (as provided in DNS Zone of your deployment at GCP, e.g., ns-cloud-d1.googledomains.com, ns-cloud-d2.googledomains.com, ns-cloud-d3.googledomains.com, ns-cloud-d4.googledomains.com) replacing the existing Name Server records. Save Records.
(ii) Add the “A record” – Click Add Records. Leave blank or type ‘@’ in ‘Host’ field (as specified by Domain Registrar). You may type ‘*’ to indicate any sub domain. Type or paste external IP Address of your hosting (deployment on GCP) in ‘DNS Name/ Points To/IP Address’ field, as the case may be.
- Create Sub-Domains of your WordPress Multisite Network
WordPress Multisite is designed for subdomains, so it’s easy to add a separate blog (Website) for each subdomain of your primary domain. In this example, let’s assume we’re adding two blogs: hr.example.com and sales.example.com.
Follow these steps to associate a new blog with a subdomain:
In the WordPress Multisite Admin dashboard, select the “My Sites >> Network Admin >> Sites” option.
Click “Add Site” to create the new blog or website. Fill up details and Save.
Repeat the above steps for all the subdomains and blogs you wish to create. Once you’re done, you can see a list by selecting the “My Sites >> Network Admin >> Sites” option.
At this point, you also need to update your domain’s DNS settings, specifically adding A records for your subdomains that point to the static IP address of your cloud server. Following these changes, entering the subdomain name into the browser address bar should take you to the blog (website) for that subdomain.
- Set up WordPress Multisite in Server Database
On your GCP console, click on Hamburger icon (≡) on top left corner and select Deployment Manager – Deployments. Select your Deployment and Open SSH from Right lower side of the screen. After getting SSH access of the server, type following commands to set up WordPress Multi-Site:
Get access to the WordPress directory:
Configure Host Name:
sudo ./bnconfig –machine_hostname example.com
Remove Bitnami Banner (If you want) from right bottom corner of WordPress website pages:
sudo /opt/bitnami/apps/wordpress/bnconfig –disable_banner 1
Disable bnconfig tool
sudo mv bnconfig bnconfig.disabled
(Enable bnconfig tool if previously disabled — sudo mv /opt/bitnami/apps/wordpress/bnconfig.disabled /opt/bitnami/apps/wordpress/bnconfig)
Install SSL for all main Domain and all Sub-Domains by following command (Replace Your Email… and example Domains with your Email Address and Domains)
sudo /opt/bitnami/letsencrypt/scripts/generate-certificate.sh -m Your Email Address -d example.com –d hr.example.com -d sales.example.com
Acknowledge the prompts and exit.
Install SSL with Auto-installer script by typing following command [New Tool]
When asked, provide DOMAINS eg. example.com hr.example.com sales.example.com
Acknowledge the prompts and exit.
10. Install and activate Really Simple SSL WordPress Plugin to force ssl certificates on websites (How to install Really Simple SSL).You may need to fix mixed content issue if you are using Elementor plugin on your website (How to fix mixed content issue in Elementor after moving to SSL).
- Setup Mail SMTP Setup Mail SMTP for the WordPress websites to be able to send Emails either with:Gmail API or Other Email service.
- Final Words
Your WordPress Multisite is setup. Now Login as Administrator in WordPress eg. https://example.com/wp-admin/ . Go to Website Dashboard >> Settings and do required basic setup and save changes. Then, Install required Theme and Plugins and start building functional websites. All the Best. For any queries, please write to firstname.lastname@example.org.
One final step, you may improve the security and performance of your Website (s) by signing up (Free Signup available) at Cloudflare and adding your website at cloudflare.com.
You may be interested in How to host and set up WordPress Multisite click to deploy on gcp.
That’s it! Keep editing and design stunning websites. All the best!