This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

✨ Vultr and Linode are back on Cloudways! VIEW PLANS→

How to Install Magento Google Cloud (Managed + Manual Methods)

Updated on December 13, 2023

11 Min Read

How to Install Magento on Google Cloud (Managed + Manual Methods)

When running a successful e-commerce business, your hosting choice can make all the difference.

Whether you’re navigating through shared hosting, dedicated servers, or the cloud, the real MVP often turns out to be cloud hosting.

One of the top cloud providers is Google Cloud Engine (GCE). It steals the spotlight, especially when dealing with Magento and other PHP-based applications.

Boasting an impressive 99.99% guaranteed uptime, no wonder Magento Ecommerce store owners and developers prefer GCE.

In this blog, we’ll cover both the managed (Cloudways) and manual methods of installing Magento Google Cloud, allowing you to run a successful ecommerce business without breaking a sweat.

Why Should You Host Your Magento Store on Google Cloud Engine?

While numerous advantages exist for Magento on Google Cloud Engine, below are some key reasons to consider using Magento Google Cloud Hosting:

Uptime

One of the most popular reasons for using Magento Cloud hosting is the uptime it provides. The GCE servers rarely go down, giving you a 99.99% uptime without hiccups.

Speed

Speed is one of the basic requirements for successful Magento-powered web stores. Magento stores hosted on GCE cloud servers are extremely fast and are fully optimized for peak performance. Here are some of the network performance statistics reported by ServerDensity.

google networking performance speed

Reliability

The GCE is the backbone of various services and products offered by Google. By hosting your Magento on Google Cloud, you get a very reliable and modern infrastructure for your ecommerce store.

Simplicity

Google Cloud Engine is easy to use, with an interface similar to the well-known Google website. This makes online transactions smooth for customers. The simplicity positively affects business performance, drawing customers to websites that are easy to navigate.

Scalability

With GCE, you can easily handle unanticipated traffic hikes easily. When you feel that the server resources are getting low, you can quickly scale your GCE server by using the scaling features available on the cloud platform. It’s a 1-click operation, and you don’t have to worry about the IP addresses as they will remain intact.

Now that I have discussed the benefits of hosting Magento on Google Cloud, let’s discuss the challenges.

Unleash Superior Performance with Cloudways Managed Google Hosting

Benefit from 24/7/365 support, optimized stack, robust security, free SSL, and more. Elevate your online presence—make the switch to Cloudways today!

Why Choose Cloudways for Hosting Magento on GCE?

Cloudways saves you precious time by installing Magento with a single click. In addition, the platform comes with:

Optimize Magento Speed Like a Pro

Subscribe now and get a free eBook to your inbox.

Thank You

Your eBook is on its Way to Your Inbox.

Launch Magento on Google Cloud Engine (GCE) With Cloudways [Easy Method]

You can launch your GCE server with Cloudways in just a few clicks without any complications. You’ll get to enjoy a user-friendly UI design, a feature-rich console, and numerous other built-in features.

Follow the steps below to get started with your Magento Store on Google Cloud.

  • Select Magento from the drop-down menu, and give your server, application, and project a name.

Select Magento from the drop-down menu in the cloudways platform

  • Select GCE from the available cloud infrastructure options.

Select GCE from the available cloud infrastructure options

  • Choose your server size based on your store traffic. Next, select Bandwidth and storage size for your database and application files.

Choose your server size based on your store traffic

Select the server location nearest to your audience. Once done, hit the Launch Now button to deploy the Magento on Google Cloud.

Book a Personalized Cloudways Product Demo With One of Our Expert

Magento 2 Installation on Google Cloud via Composer [Manual Method]

In contrast to the Cloudways method we discussed earlier, the manual approach is considerably more technical, involving the execution of numerous commands. Nevertheless, the steps below outline the manual process for setting up Magento on Google Cloud hosting.

Go to Google Cloud Platform and Set up an Account

  • Start by going to Google Compute Engine and choosing VM instances. Your Google Cloud hosting can be found in the VM instances section.

Start by going to Google Compute Engine and choosing VM instances

  • To initiate the setup of a new Magento store, click the “Create” button. If you already have an existing store, you can opt to “import” it using the migration service. If you are uncertain, access Google Cloud’s assistance by clicking on the “Take the quickstart” button.

To initiate the setup of a new Magento store, click the Create button

For the purpose of this article, I will start from scratch.

Create a New Google Cloud Instance

To create a new instance, specify the following details:

  • Instance Name: Provide a name for the instance.
  • Region & Zone: Choose the region and zone where you intend to host your Magento store. Opt for a location close to your target audience to minimize latency and enhance server response time.
  • Machine Configuration/Resources: Define the necessary resources for hosting and running your Magento store successfully. Specify the number of CPUs, RAM, storage, and other technical details. In my case, I’ve selected a Linux environment and opted for Ubuntu OS for the installation. Feel free to choose any other Linux distribution according to your preferences.
  • API Access and Firewall: Set up API access and configure the firewall settings for your application.

Choose a name, select region & zone for optimal performance, configure machine resources, and set up API access and firewall settings

After specifying all the details for creating the instance, click the Create button

  • After specifying all the details for creating the instance, click the “Create” button.

Install Magento Pre-Requisite Tools on the Google Cloud Server

  • You will need to execute all the commands mentioned in the installation guide in the SSH terminal to install the required Magento setup tools on Google Cloud hosting:
  • To display all directories in the server on the SSH terminal, use the following command:
ls -al
  • This command will generate a list of directories in the Google Cloud server.

Step 1: Log in as a Root User

To begin, log in as the root user using the following command:

sudo su

Upon executing this command, you will be directed to the home/ubuntu directory, confirming your login as the root user.

Enter sudo su to switch to the root user, redirecting to the homeubuntu directory for confirmed root access

Step 2: Update Your Server With the Latest Tools

In the next step, update your server with the latest tools by using the following command:

apt-get update

This command will refresh and update the list of tools on your server.

Execute apt-get update to refresh and update the list of tools on your server

Step 3: Setting up Lamp (Linux, Apache, Mysql/MariaDB, PHP) Setup for Magento

Proceed with setting up the LAMP (Linux, Apache, MySQL/MariaDB, PHP) environment for Magento using the following command:

sudo apt-get install apache2 php libapache2-mod-php mysql-server php-mysql

This command will install all the necessary files for PHP, MySQL, and Apache, ensuring that your Magento environment has the required components.

Note: The entire setup covered here is for Magento version dev-2.3-develop. For the latest version of Magento (2.4.6), you can read the system requirements here.

Run sudo apt-get install apache2 php libapache2-mod-php mysql-server php-mysql to install essential files for PHP, MySQL, and Apache, setting up the necessary components for your Magento environment

To finalize the LAMP setup, run the following command:

apt-get install php7.2-gd

(Choose the PHP version based on your current Magento version requirements)

execute 'apt-get install php7.2-gd' to complete the installation, ensuring the inclusion of PHP 7.2 GD extension for enhanced functionality

apt-get install php7.2-mcrypt

(Choose the PHP version based on your current Magento version requirements)

Use 'apt-get install php7.2-mcrypt' to add the Mcrypt extension

sudo a2enmod rewrite

Execute 'sudo a2enmod rewrite' to activate the Apache module

systemctl restart apache2

Use 'systemctl restart apache2' to refresh the Apache server, ensuring that the changes take effect

Navigate to the Apache directory and execute the following commands to configure your Google Cloud hosting:

cd /etc/apache2/

Then, open the apache2.conf file with the nano text editor:

sudo nano apache2.conf

Press Ctrl + W to initiate a search, and look for the term “Indexes” in the configuration file.

Open the apache2.conf file in the etcapache2 directory using 'sudo nano apache2.conf.' Use Ctrl + W to search for 'Indexes' in the configuration file.

Replace ‘None’ with ‘all’ (as shown in the image below):

Replace 'None' with 'all'

After making the necessary changes in the apache2.conf file, press Ctrl + X, then press ‘Y’ to confirm the changes, and hit ‘Enter’ to save the file.

Next, restart the Apache services with the following command:

systemctl restart apache2.service

Once the services are restarted, navigate to the public root directory and clone Magento 2 from GitHub:

cd /var/www/html

You are now in the directory where you can clone Magento 2.

After editing apache2.conf, press Ctrl + X, type 'Y' to confirm, and press 'Enter' to save. Restart Apache with 'systemctl restart apache2.service.' Navigate to varwwwhtml to clone Magento 2 from GitHub

Execute the following commands to clone the Magento 2 repository from GitHub and navigate into the cloned directory:

git clone https://github.com/Magento/Magento2.git
cd Magento2

These commands will download the Magento 2 source code from the specified GitHub repository and change your current directory to the Magento2 directory.

Use 'git clone httpsgithub.comMagentoMagento2.git' to clone the repository-1

To install the necessary dependencies using Composer, run the following command:

composer install

If you encounter an error similar to the one shown in the image below, please provide details about the error message so that I can assist you in resolving it.

Execute 'composer install' to install the required dependencies using Composer

In my case, I tried running the following command:

apt-get install php7.2-bcmath

This command installs the php7.2-bcmath package, which might address your encountered error.

Run 'apt-get install php7.2-bcmath' to install the php7.2-bcmath extension

I encountered the same error again while installing Composer using the command composer install.

installing Composer using the command composer install

If you’re still facing difficulties with installing Composer, as shown in the provided screengrab, try resolving the issue by running the following command:

sudo apt-get install php-soap

This command installs the php-soap package, which may address the obstacle encountered during the Composer installation.

sudo apt-get install php-soap

After successfully running the sudo apt-get install php-soap command, I again executed the composer install command. This time, I was able to install Composer.

Successful installation of Composer after executing 'sudo apt-get install php-soap' and running 'composer install' command

To finalize the Magento setup and ensure the installation of required files, adjust the folder permissions using the following commands:

chmod -R 755 /var/www/html/Magento2/
chmod -R 777 /var/www/html/Magento2/var/
chmod -R 777 /var/www/html/Magento2/pub/
chmod -R 777 /var/www/html/Magento2/app/etc
chmod -R 777 /var/www/html/Magento2/generated

These commands set the necessary permissions for the specified directories. Once done, restart the Apache service to apply the changes:

sudo service apache2 restart

sudo service apache2 restart

This restart is an important step because otherwise, the php extension will be missing, and the Magento installation process cannot proceed.

Step 4: Setup the Database

In Step 4, proceed to set up the database by logging into MySQL using the following command:

mysql -u root -p

This command allows you to access MySQL with the root user and prompts you to enter the password when executed.

mysql -u root -p

Once you are in the MySQL terminal, execute the command below to create the Magento database.

create database magento;

This sequence of commands creates a database named ‘magento,’ establishes a user ‘magento’ with the password ‘magento,’ grants all privileges on the ‘magento’ database to the ‘magento’ user, flushes the privileges to apply the changes, and then exits the MySQL terminal.

create database magento;

Now your database is created. To check your database, run this command:

SHOW DATABASE;

Now, to create a user and grant the necessary privileges, run the commands below:

create user magento IDENTIFIED BY 'magento';
GRANT ALL ON magento.* TO magento@localhost IDENTIFIED BY 'magento';
flush privileges;
exit;

Verify the new database with 'SHOW DATABASE;' and create a user ('magento') with privileges using 'create user magento IDENTIFIED BY 'magento';', 'GRANT ALL ON magento. TO magento@localhost IDENTIFIED BY 'mage

Cloudways Magento Hosting That’s Better Than the Rest

Benefit from advanced caching, automatic scaling, PHP 8.x, and expert technical support. No need to deal with slow load times. Experience a high-powered, stable Magento store.

Install and Configure Magento on GCE

Navigate to your public IP address:

Access your Magento installation by navigating to the public IP address

To continue with the Magento setup, copy and paste the following URL into your browser’s address bar, replacing “xx.xxx.xxx.xx” with the actual IP address or domain of your server and appending “/Magento2/setup”:

http://xx.xxx.xxx.xx/Magento2/setup

This URL will direct you to the Magento setup process in your web browser. Follow the on-screen instructions to complete the Magento installation.

Magento setup process in your web browser

If you encounter the following screen, it indicates that you are ready to install Magento on Google Cloud. Congratulations!

readiness check in magento setup

The first step in the Magento installation process is the Readiness Check, in which PHP details and file permission requirements are validated.

Magento installation process is the Readiness Check, in which PHP details and file permission requirements are validated

You will find the database details created in the earlier steps for Magento on Google Cloud displayed in this section.

View the Magento database details created on Google Cloud

Now, proceed to configure the store domain and admin domain for your Magento store.

configure the store domain and admin domain for your Magento store

Customize the fundamental details of your store based on your preferred region.

Customize the fundamental details of your store based on your preferred region

Input your preferred admin credentials for the Magento store. Take note that these credentials will serve as your login information for accessing the Magento admin panel.

Input your preferred admin credentials for the Magento store

Finally, check all the details highlighted below.

Finally, check all the details

Following the successful installation of the Magento store, here are the screenshots showcasing both the Magento Frontend and Backend.

P.S: I trust this provides a clear perspective on why I chose Cloudways for hosting Magento on the Google Cloud server.

Frontend Store View

here is the screenshots showcasing the Magento Frontend

Backend Admin Panel View

here is the screenshots showcasing the Magento backend

Final Thoughts

We hope you found this guide on installing Magento Google Cloud useful. Cloudways provides the most convenient Magento hosting platform for GCE cloud servers.

For those who are interested in hosting their sites on the cloud with blazing-fast speed and top-notch optimized performance, Cloudways-managed GCE is a viable solution.

You can test and deploy your apps on Cloudways’ preconfigured testing environments and experience the best possible results for your Magento-based ecommerce stores.

Q.1: What are the benefits of Magento Google Cloud?

One of the great reasons to choose Magento Google Cloud due to its simplicity which also empowers the search engine. Hosting your Magento on Google Cloud offers many features that ensure your online stores’ stability.

Q.2: What is the easiest way to host on Magento Google Cloud?

Hosting your Magento on Google Cloud isn’t a piece of cake. However, on Cloudways, it’s very easy to host Magento on Google Cloud even if you’re not tech-savvy because it offers a 1-click Magento installation.

Q.3: How much does Magento 2 Google Cloud cost with Cloudways?

As Magento 2 is a powerful ecommerce platform to maintain its performance, we recommend you start with at least 4GB or higher server to meet our Managed Performance requirements. This will cost you $0.1172 Hourly or $84.36 Monthly.

Q.4: How can Magento on Google Cloud benefit ecommerce stores compared to other infrastructure providers available on the Cloudways platform?

The following are the points that make the GCP more compatible among different cloud infrastructure providers:

  • GCP is cheaper than Amazon.
  • The biggest and most powerful contender for Amazon.
  • GCP Backup/restore processes are a bit slower in comparison to Amazon.
  • AWS offers Quick backup/restore processes
  • While hosting your Magento on Google Cloud, your bandwidth’s allocated budget may exceed as compared to other cloud infrastructure providers.
Share your opinion in the comment section. COMMENT NOW

Share This Article

Abdul Rehman

Abdul is a tech-savvy, coffee-fueled, and creatively driven marketer who loves keeping up with the latest software updates and tech gadgets. He's also a skilled technical writer who can explain complex concepts simply for a broad audience. Abdul enjoys sharing his knowledge of the Cloud industry through user manuals, documentation, and blog posts.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now