In this post, I am going to walkthrough on how to set up WordPress on ServerPilot ($10 free credit) with Google Cloud Platform (GCP). This is completely free for Serverpilot and GCP (12-month free trial) and is very easy to set up.
The first thing that you have to do is create a ServerPilot account and this will be used to manage your Wordpress backend. What you have to do first is get the free $300 credit from Google Cloud Platform which will be valid for 12 months.
Once you have registered for both platform you will see the page that looks like this.
Please note that I have create a Project for the Google Cloud Platform with a name of MikaTeach. Name this project based on your project name.
On the sidebar, we are going to select the Compute Engine and create new instance.
An instance is basically just a machine / server if you have used Vultr before. So create a new instance and choose the machine type as well as the disk type. To start off, I will pick the cheapest plan.
For the name, you can name it whatever you want and choose the zone that’s closer to your area. Make sure to use ubuntu image because ServerPilot only accepts ubuntu OS. For the firewall part, allow both http/https traffic so that later you can set up SSL easily.
Once you have created the instance, head back to ServerPilot and connect the server.
Tick the I don’t have a root password or public IP address because we are going to install it manually. The hostname would be the name of the server that’s in ServerPilot and I will call it wp-on-gcp. We are going to access the machine via SFTP so you can choose a password for it. But because you are registered on free account of ServerPilot, the username would be serverpilot and unless you upgrade your account to pro, you are going to log in to the server with that username and your preferred password.
On the next page you will see some codes that will allow you to install ServerPilot Installer inside the server. What you have to do is copy the code that’s generated for you and then SSH into Google Compute Engine.
sudo apt-get update && sudo apt-get -y install ca-certificates wget && \ sudo wget -nv -O serverpilot-installer https://download.serverpilot.io/serverpilot-installer && \ sudo sh serverpilot-installer \ --server-id=SOME_CODE_HERE\ --server-apikey=SOME_CODE_HERE
Copy the whole thing and paste the codes in the terminal / command line, this code will install all the tools required such as (Nginx, Apache, PHP, and MySQL) that’s used to run our WordPress website. To ease the process, let’s just use Google Cloud Shell.
When you press the SSH link, it will SSH into the server and from there you can paste in the code to connect it to Server Pilot. It will take about 1-2 minutes, go grab something to drink ☕.
When you check the server pilot page, you will see this installation bar. This means it’s currently doing the installation.
WordPress on Cloud
Once the server has been created, what you want to do is create an App. You can create multiple app on top of the same server but I recommend to only have one app in a server if you choose the cheapest machine.
Upon pressing the Create App button, you will see form that will contain all of the credentials of your new wordpress account. I have filled in the credentials for an example, so make sure to fill in your credentials. For the dataabse, they will automatically create one for you and all the credentials is available on ServerPilot for future reference.
ServerPilot will also install the WordPress for you, and you can set up the domain, database, SSL, and settings from the ServerPilot control panel. In short, it’s just like the traditional CPanel, just cleaner and better in my opinion.
Now you can visit the IP address of the GCP instance that you have just created and you should be able to see the WordPress website. Please note that there’s no installation screen for wordpress because the credentials that you have put in at ServerPilot is the one that will be used.
You will be able to access the website through the IP address such as 126.96.36.199 please do note that you need to change this IP address and map it with your domain name.
This is the end of the tutorial and I hope you find it useful. If you have any suggestions, please do comment below and good luck. Share this post to help me write better content.
If you just want to set up ServerPilot on top of Google Cloud Platform you can read my other tutorial on Setting up ServerPilot on Google Cloud Platform. It provides more thorough step by step guides.
Setting up WordPress on top of GCP or any other cloud platforms is a breeze. With a rich and flexible control panel like ServerPilot, you can ease this process and delegates all of the hard work task to them while focusing on building your application.
If you have any further questions, do comment below or check out their extensive documentation linked above. Thank you for checking out this post and hopefully you managed to learn something new.