How to host Cachet on Google Cloud VM Instance - ServerAvatar

Published : Aug 2, 2024

Share This Post

cloud-platform

Google Cloud

Google is one of the most famous and reliable cloud providers among all of its competitors in the market. Google Cloud Platform provides a robust and comprehensive set of cloud computing services, catering to diverse business needs from startups to large enterprises.

Get started with Google Cloud
application

Cachet

In simpler terms, it is a tool that allows businesses to create a web page that displays the current status of their website, application, or service—letting their customer know if everything is working smoothly or any issues are being addressed.

More info

Cachet is an open-source status page system designed to help you keep track of your system status and share it with your user base. It is built to be responsive and works seamlessly across different devices. When selecting a hosting solution for Cachet, Google Cloud is a reliable option with scalable infrastructure and a simple deployment process. ServerAvatar makes it easy and user-friendly to deploy the Cachet application on the Google Cloud platform.

Create a VM Instance in Google Cloud

Getting started with Google Cloud:

Google is one of the most famous and reliable cloud providers among all of its competitors in the market. Google Cloud Platform provides a robust and comprehensive set of cloud computing services, catering to diverse business needs from startups to large enterprises. With its focus on scalability, performance, security, and innovation, GCP enables organizations to build, deploy, and scale applications and services efficiently in the cloud. Whether it's computing, storage, data analytics, machine learning, or networking, GCP offers a powerful and flexible platform for modern cloud computing requirements.

Google Cloud Platform’s Compute Engine offers robust virtual machine capabilities designed to meet the needs of modern cloud computing environments. Whether you’re looking for flexibility, scalability, performance, or integration with other Google Cloud services, Compute Engine provides a comprehensive solution for running your applications and workloads in the cloud efficiently and securely. Here’s a detailed introduction to Google Cloud as a virtual machine provider:

  • Compute Engine as a primary service: It allows you to quickly scale VMs up or down based on demand, allowing you to handle varying workloads effectively. Users have the flexibility to select VM instance types tailored to their needs for CPU, memory, and disk capacities. Google provides predefined machine types optimized for different tasks, or you can customize machine types to allocate resources according to specific requirements.
  • Key Features and Capabilities: It provides preemptible VMs at a greatly reduced price, ideal for fault-tolerant and batch-processing tasks. VM instances can be migrated live between host systems without any downtime, ensuring exceptional availability and reliability. Users have the option to either create custom VM images or utilize Google's pre-built images for quick deployment of popular software configurations.
  • Integration with Google Services: It offers Control access and permissions for VM instances by managing IAM roles and policies. Compute Engine seamlessly integrates with Google Cloud's VPC networking, enabling the creation of secure and isolated networks tailored for your VMs. It also supports VPNs, Cloud Interconnect, and Google Cloud Load Balancing to efficiently manage network traffic. Moreover, Google's Deployment Manager can be used to automate the creation and management of VMs and associated resources following Infrastructure-as-Code principles.
  • Management and Monitoring: Administer VM instances using the Google Cloud Console, which offers a graphical interface for deploying, monitoring, and managing resources. Engage with Compute Engine programmatically through Google Cloud SDK tools and APIs, enabling automation and seamless integration with other systems.
  • Security and Compliance: Compute Engine incorporates security features such as encryption of data at rest and in transit, secure boot, and IAM controls to safeguard VM instances and data. Google Cloud Platform adheres to various compliance standards (e.g., ISO, SOC, GDPR), providing assurances for regulatory requirements across different industries.

Let’s get started with creating a Virtual Machine on the Google Cloud Platform:

Step 1: Creating a VM in Google Cloud Platform

  • Click on the below link and log in to your Google account.

  • Here you can create a New project or you can select the project you want, and then click on Create a VM as shown in the image below.

Create a VM Instance in Google Cloud

Step 2: Creating a VM Instance

  • For creating a VM instance click on the sidebar, select the Compute Engine, and then click on the VM instances and Create Instance, as depicted in the images below.

Create a VM Instance in Google Cloud

Create a VM Instance in Google Cloud

Step 3: Configuring a New VM Instance

  • Click on New VM Instance, here you can give Name to your virtual machine. Additionally, you can select the Region and Zone of your choice. Moreover, you can select the machine according to your needs from the available types. Refer to the image below.

Create a VM Instance in Google Cloud

Step 4: Select the Machine type

  • Now you have the option to select a Machine Type with predefined configurations of vCPUs and memory which is suitable for most workloads. In addition to this, you can also add Availability policies according to your needs. (Recommended Standard policy)

Create a VM Instance in Google Cloud

  • Also, you can customize your machine that is suitable for your workload as shown in the image below.

Create a VM Instance in Google Cloud

Step 5: Select the Boot disk

  • In this step, you have to select the Operating System for your instance. Click on the Change button to select the boot disk as shown in the image below.

Create a VM Instance in Google Cloud

  • We recommend you to use Ubuntu 20.04 LTS x64 or Ubuntu 22.04 LTS x64. Ubuntu is easy to configure and manage. If you are using ServerAvatar to manage your instance, these operating systems are required. Moreover, you can select the disk type you want; however, we recommend you select a Balanced persistence disk with a minimum 25 GB disk size, then click on the Select button as depicted in the following image.

Create a VM Instance in Google Cloud

Step 6: Firewall rules

  • The next step is to allow firewall rules that are available at the time of creating an instance in Google. Select the checkbox next to the HTTP and HTTPS to allow incoming traffic. Click on the Create button to create a VM instance in Google as shown in the image below.

Create a VM Instance in Google Cloud

Step 7: Creating New Firewall Rule

  • Now, you have to go to the VPC network by clicking on the sidebar and then clicking on the Firewall section. After that click on Create Firewall Rule as shown in the images below.

Create a VM Instance in Google Cloud

  • Here you have to enter the details such as the Name of the rule and its description. You can also turn on firewall logs. In addition to this leave the network and priority sections as default. The direction of traffic should be Ingress and Allow the action. In the Targets section, you have three options: All instances in the network, Specified target tags, and Specified service accounts, select from them according to your needs. Furthermore, set the Source filter to IPv4 ranges you can specify the ranges as per your requirement in the Source IPv4 ranges input field. To understand it better refer to the image below.

Create a VM Instance in Google Cloud

  • Lastly, you need to specify the Protocols and ports. ServerAvatar requires 43210 port to be open and the protocol is TCP so add the port number in that field and click on Create as shown in the image below.

Create a VM Instance in Google Cloud

  • Congratulations! You have successfully created your instance in Google Cloud which is now ready to connect with ServerAvatar.

Initial Server Configuration

The Initial server configuration includes the installation and configuration of various packages required to host your website. Usually, You have to write commands and modify configuration files. Luckily, With ServerAvatar, Your full server configuration and optimization can be automated.

Here are the three ways to automatically configure your server with ServerAvatar.

Install and Setup Cachet status page system with ServerAvatar

Step 1: Create a PHP application

To create an application, go to the ServerAvatar server panel, navigate to the Applications tab, and click the Create button like the following image.

image

1. Fill in basic detail

In the first step, fill in the basic details, including the Application Name, select the Domain type, and type the Primary Domain/Test Domain Name.

Note that:

If you want to host Joomla CMS on your domain, then make sure to point your domain to the current IP address of your server, and for that:

  1. Log in to your hosting provider site, where you buy your domain. You can check your domain information with one click.
  2. Access DNS Manager to edit your DNS records(contact the support team if you don’t find them)
  3. Change the IP address of A Record of your website to the current server’s IP address.

Note that:

For accessing Cachet on the subdomain, you need to add your subdomain on A Record that points to the current IP address of your server. To point to an IPV6 address, you would need to use an AAAA record

image

Click the Next Step to continue.

2. Select the application creation method

image

Here you can fill in the required details. It includes-

  1. Select the Git method and GitHub as a service provider so we can deploy an application from Git public repository.
  2. Mark on Public Repository.
  3. Type/Paste the GitHub project URL. You’ll find the link on GitHub in the image below.

image

  1. Type the Branch of the GitHub project.

image

  1. Type the below commands in the deployment script.

php7.3 /usr/bin/composer install cp .env.example .env php7.3 artisan key:generate

Note that:

Note that: Cachet supports PHP7.1 To 7.3, we need to specify the version in the command in the deployments script.

3. Allocate system user

System users manage the resources of the application. You can create a new application user or give permission to the existing user.

image

Click the Next Step to continue.

4. Other Options

In this step, select PHP version 7.3. Cachet supports PHP 7.1 - 7.3. Type Public in the Custom Webroot field.

image

5. Review your application details

Review your application details. Click the Create Application button.

image

Step 2: Create a Cachet database

On the server panel, navigate to the Databases tab from the sidebar and click the Create button to create a MySQL database.

image

Fill in database details, including-

  • Database Name
  • Database Username
  • Database Password

image

Step 3: Delete the .env.example file and update the database information

To delete the .env.example file, go to the application panel>>file manager and access the public_html folder. Now check the Show Hidden Files. The .env.example file is at the top of the multiple hidden files. Please select the file and delete it like the following image.

image

Now open the .env file and change the database details we created in the second step. It includes-

DB_DATABASE: Database Name DB_USERNAME: Database Username DB_PASSWORD: Database Password

image

Don’t forget to save the file(CTRL+s) after making appropriate changes.

Step 4: Install SSL

To install SSL for your application. Go to your application panel and click the SSL Certificate from the sidebar.

image

You can install Automatic SSL or a Custom installation method to secure your site with an SSL certificate. It is recommended to install automatic SSL for your application.

Step 5: Install and Set up Cachet

1. Environment set up

Access your domain/subdomain on the browser to install and set up Cachet. The setup screen will look like the following image.

image

Fill in the required details in the above image and click the Next button.

2. Status Page Setup

On the next page, you’ll need to set up the status page. Here you can fill up the details, including your Website Name, Website Domain, Timezone, and Language.

image

Click the Next button to continue.

3. Administrator Account

Fill up admin details, including** Admin Username**, Email, and Password.

image

Once you enter all the details, click the Complete Setup button. The message will display like the following image. Click the Go To Dashboard button to continue.

Notice: you may see the error “An error occurs, and this resource cannot be displayed.”

image

If it occurs, log in to your application using an SSH connection. You can see the credentials in the application panel in the following image.

image

Execute the following command in your terminal to log in to your application-

ssh Username@Host

Now go to your application path using “cd Application_Name/public_html” and execute the following command.

Php7.3 artisan migrate:refresh

After that, go to your setup page and click the Complete Setup button. It will configure cachet successfully.

image

Once you access the dashboard, you’ll create and manage components and incidents, including updating incidents with additional information and marking them as resolved when the issue is fixed.

image

That’s it. Your CacheT instance should be live and you can start working on your status pages. We hope this tutorial was helpful to you. You can also refer to other deployment tutorials given below.