The Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google. All GCP data centers are connected through Google’s backbone network – one of the biggest and fastest in the world.
RunCloud is a cloud server management tool that allows you to maintain full control of your server, and host multiple WordPress, WooCommerce, Laravel, and PHP applications with fast and easy configuration. With RunCloud, you don’t need to be a Linux expert to host your website on Google Cloud Platform servers.
In this tutorial, we will show you how to set up a Google Cloud server to host your website using RunCloud.
Step 1. Create a Firewall Rule to Allow Incoming Traffic
Your server needs to allow incoming TCP connections on ports 80 and 443 to server traffic from the internet. RunCloud also requires TCP port 34210 to communicate with the server. We will make a firewall rule to allow incoming traffic on all these ports.
Go to the “VPC network” > “Firewall” menu and click on “Create Firewall Rule”.
Enter the following details, and click “Create Rule” to create a firewall rule:
Description: Required by RunCloud to function properly.
Direction of traffic: Ingress
Action on match: allow
Targets: Specified target tags
Source filter: IP ranges
Source IP ranges: 0.0.0.0/0
Protocols and ports: Specified protocols and ports then select TCP and enter “80,443,34210”
Step 2. Reserve a Static IP Address (Optional)
By default, Google Cloud instances are assigned an ephemeral external IP address. This means a new ephemeral IP address will be assigned to your instance whenever it is stopped and started again.
If an instance is stopped, any ephemeral external IP addresses assigned to the instance are released back into the general Compute Engine pool, and become available for use by other projects, (GCP Documentation).
If the IP address of the cloud instance changes, you will need to manually update it in your RunCloud Dashboard. It is highly recommended to use a static IP address for your server. This static IP is dedicated to you and will not be changed when you stop and restart the server, however you will incur additional charges for a static IP.
Go to the “Reserve Static IP” option and enter the following details:
Description: Static IP address reserved for RunCloud instance.
IP version: IPv4
Region: Select your region, if you’re unsure then find out the region most suitable for you
Attached to: None
Step 3. Create A Google Cloud Compute Engine Instance
RunCloud needs a fresh Ubuntu server to function properly, and will not work on an existing production server. Go to the “VM Instances” tab in the “Compute Engine” menu, and click on “CREATE INSTANCE”.
Select Name and Region
Give your instance a name, and select the region picked in step 2. We recommend you use a region and zone that is nearest to your target users/visitors. The closer your server location is to your users, the less latency they will experience. This setting is permanent and cannot be changed later.
Select Machine Type
Under the “Machine configuration” option, select one of the predefined GCP machine types for your instance. Each machine type gives you a certain number of vCPUs (virtual Central Processing Unit), and a fixed amount of memory. We recommend starting with the “e2-small” machine type, and scale up to match your workload at a later stage.
Select Boot Disk and OS
Next, you need to attach an Ubuntu LTS boot disk to your instance. RunCloud supports Ubuntu 18.04, 20.04, 22.04 LTS 64 bit at the moment. Click the “Change” button under Boot disk, then select “Ubuntu 22.04 LTS Minimal” for x86/64 architecture.
For the “Boot disk type” option, select “Balanced persistent disk”. Alternatively, you can choose “SSD persistent disk” for better performance, or “Standard persistent disk” to reduce the storage costs. The boot disk size is customizable from 10 GB to 65,536 GB.
Apply A Custom Firewall Rule
We will leave both “Allow HTTP traffic” and “Allow HTTPS traffic” unchecked under the Firewall option because we have already created a custom firewall rule to allow internet traffic. Click on the “Advanced Options” to reveal advanced settings.
Look for “Network tags” under the Networking section and enter the “runcloud-server” tag created in step 1.
Assign the Static IP
Now we will assign the static IP reserved in step 2. If you are not using a static IP, you can skip this step.
Scroll down to “Network Interfaces” and edit the default interface settings. Leave all the settings to default, and scroll down to the “External IPv4 addresses” option. Change this from “Ephemeral” to “runcloud-server-ip”:
Click the “Create” button to start your Google Cloud server.
Step 4. Connect Google Cloud VM To RunCloud
Connect Your Server
Begin by logging in to the RunCloud dashboard, and clicking the “Connect a new server” button.
Next, select “Google Cloud Platform” from the Server Provider list. Enter the name and external IP address of your server, then click “Continue”.
Install RunCloud Agent
On the next screen, choose “Manual Installation”, and you will see the script that you have to run on your Google Cloud instance.
Go to “VM instances” on your Google Cloud dashboard, and click “SSH” next to the instance that you just created. This will launch a web browser-based terminal to log in to your server.
We need to run the RunCloud installer script command as a “root” user. Run the “
sudo su” command to start a “root” shell, and then paste and run the RunCloud installer script command. This should only take a few minutes to complete.
Once it’s completed, you will see the MySQL root password for your database management, and the “runcloud” system user password. Please save this information securely in a password manager.
If successful, data about your server will appear in your RunCloud dashboard, and you will have successfully set up your Google Cloud server with RunCloud.
Video Tutorial – Setup Google Cloud Server With RunCloud
You can watch this short video tutorial to show you all steps that we have explained above in less than 3 minutes.
You can use RunCloud with Google Cloud to simplify server management experience. RunCloud agent needs to be installed on a Ubuntu LTS release and requires TCP port 80, 443, and 34210 to function properly. After a successful install, you can manage the server and monitor its performance metrics from the RunCloud dashboard.
After setting up your Google Cloud server, you can continue to:
- Create a WordPress Staging Site in RunCloud
- Install phpMyAdmin Using RunCloud
- Configure Nginx Using RunCloud