{"id":3824,"date":"2018-10-10T12:18:40","date_gmt":"2018-10-10T12:18:40","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=3824"},"modified":"2018-12-19T13:00:41","modified_gmt":"2018-12-19T13:00:41","slug":"install-magento2-on-google-cloud","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/","title":{"rendered":"Magento 2 Installation on Google Cloud via Composer"},"content":{"rendered":"<h2>Introduction:<\/h2>\n<p>&nbsp;<\/p>\n<p>In our previous blogs, we discussed on creating a Compute Engine VM instance and installing LAMP server on Google Cloud Platform(GCP). In this blog, we will discuss about installing magento2 on google cloud platform(GCP). For installing magento on GCP, you will need a registered GCP account. You can then create a\u00a0 VM on google cloud to setup a LAMP server and finally install magento framework on it.<\/p>\n<p>&nbsp;<\/p>\n<h2>Create a VM on GCP and Setup LAMP server:<\/h2>\n<p>&nbsp;<\/p>\n<p>For installing magento2, we will need to setup a LAMP server on GCP. For this blog, we will use the following LAMP configurations:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>OS: Ubuntu 16.04<\/li>\n<li>Database: MySQL 5.7<\/li>\n<li>PHP: php v7.0<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>First of all, we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento. You can follow my blog for the steps for <a href=\"https:\/\/cloudkul.com\/blog\/running-compute-engine-vm-on-google-cloud\/\">creating and connecting to Compute engine VM<\/a> and <a href=\"https:\/\/cloudkul.com\/blog\/lamp-installation-on-google-cloud\/\">setting up a LAMP server<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h2>Download Magento2:<\/h2>\n<p>&nbsp;<\/p>\n<p>Now let us download and install the latest source code from github. At the time of this blog, the latest version is 2.2.6.<\/p>\n<p>To install magento2 with composer, first create the Access keys of <a href=\"https:\/\/marketplace.magento.com\/\">magento marketplace<\/a>. If you have an account on Magento Marketplace, simply signin and generate the access keys. If you don&#8217;t have an account, create an account by registering yourself on <a href=\"https:\/\/marketplace.magento.com\/\">marketplace.magento.com<\/a><\/p>\n<p>For generating Access keys, login in to <a href=\"https:\/\/marketplace.magento.com\/\">magento marketplace<\/a> and from the top right corner of the page where your user name is displayed, navigate to <strong>My profile &gt; Marketplace &gt; My products &gt; Access Keys<\/strong><\/p>\n<p>Now create a new pair of Access keys. You need to provide the public Key as username and Private Key as password when prompt.<\/p>\n<p>First install composer on the server.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">sudo wget -O \/usr\/local\/bin\/composer http:\/\/getcomposer.org\/composer.phar\r\nsudo chmod +x \/usr\/local\/bin\/composer<\/pre>\n<p>&nbsp;<\/p>\n<p>The syntax for installing magento2 through composer is as follows.<br \/>\n<strong>composer create-project &#8211;repository=https:\/\/repo.magento.com\/ magento\/project-community-edition &lt;install-directory-name&gt;<\/strong><\/p>\n<p>You can use the below command for installing magento2 latest version through composer.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">composer create-project --repository=https:\/\/repo.magento.com\/ magento\/project-community-edition magento2<\/pre>\n<p>&nbsp;<\/p>\n<p>For installing a specific version of magento2, mention the magento version at the end of the command as follows.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">composer create-project --repository=https:\/\/repo.magento.com\/ magento\/project-community-edition magento2 v2.2.6<\/pre>\n<p>&nbsp;<\/p>\n<p>During this process, you will be asked to provide the username and password. Provide the generated Access Keys where the public Key is the username and Private Key is the password. Also, you will be asked whether you want to store the credentials in auth.json. You can select &#8220;n&#8221; if you don&#8217;t wish to save your credentials on the server.<\/p>\n<p>Then copy the magento2 files to the Document root of the webserver.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">sudo mv magento2 \/var\/www\/<\/pre>\n<p>&nbsp;<\/p>\n<p>Give the proper web-server permissions.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">sudo chown -R www-data:www-data \/var\/www\/<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Configure Apache:<\/h2>\n<p>&nbsp;<\/p>\n<p>Configure the Apache with the below configuration. If you need to run the magento on a domain , uncomment the ServerName and ServerAlias\u00a0 section and update your domain name. Else you can leave it as it is.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">sudo vim \/etc\/apache2\/sites-enabled\/000-default.conf<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">&lt;VirtualHost *:80&gt;\r\n\r\n#ServerName mydomain.com\r\n#ServerAlias www.mydomain.com\r\nDocumentRoot \/var\/www\/magento2\r\n\r\n&lt;Directory \/var\/www\/magento2&gt;\r\nOptions Indexes FollowSymLinks MultiViews\r\nRequire all granted\r\nAllowOverride all\r\n&lt;\/Directory&gt;\r\n\r\nErrorLog \/var\/log\/apache2\/error.log\r\nCustomLog \/var\/log\/apache2\/access.log combined\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>Restart Apache server.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">sudo service apache2 restart<\/pre>\n<p>&nbsp;<\/p>\n<h2><b>Create a MySQL Database and User:<\/b><\/h2>\n<p>&nbsp;<\/p>\n<p>Login to your MySQL server and create a user and database for your Magento application. Change the database name, database user and password as per your need.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">mysql -h &lt;mysql-instance-public-ip&gt; -u root -p<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">&gt; CREATE DATABASE magento2;\r\n&gt; CREATE USER 'magento_user'@'%' IDENTIFIED BY 'user_pwd';\r\n&gt; GRANT ALL PRIVILEGES ON magento2.* TO 'magento_user'@'%';\r\n&gt; FLUSH PRIVILEGES;\r\n&gt; exit<\/pre>\n<p>&nbsp;<\/p>\n<h2>Installing Magento2:<\/h2>\n<p>&nbsp;<\/p>\n<p>You can install magento2 by hitting the public IP of the instance or the domain name if configured in DNS on the web browser.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3877\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m8.png\" alt=\"\" width=\"741\" height=\"543\" \/><\/a><\/p>\n<p><span class=\"crayon-o\">\u00a0<\/span><\/p>\n<p><span class=\"crayon-o\">Follow the web GUI interface and provide the required information to install magento2 on the server.<br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3835\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m6.png\" alt=\"\" width=\"824\" height=\"551\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Note: If your installation screen on web browser seems stuck, you can also check the installation logs to check if the installation is complete.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">tailf \/var\/www\/magento2\/var\/log\/install.log<\/pre>\n<p>&nbsp;<\/p>\n<p>After the installation of magento2 is complete, you can access the frontend and backend with the associated URLs. You can note the admin URL displayed after the installation is complete.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/luma1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3836\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/luma1.png\" alt=\"\" width=\"903\" height=\"637\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/luma2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3837\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/luma2.png\" alt=\"\" width=\"1080\" height=\"636\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Congrats, you have successfully installed Magento2 on Google Cloud Platform.<\/p>\n<p>Stay Connected!<\/p>\n<p>&nbsp;<\/p>\n<p>You can also check <a href=\"https:\/\/cloudkul.com\/gcp-hosting\/magento2-gcp-hosting\/\">Cloudkul GCP hosting plans<\/a> for Magento 2 and <a href=\"https:\/\/cloudkul.com\/gcp-hosting\/\">other e-commerce platforms<\/a>.<\/p>\n<p><strong><em>In case of any help or query, please\u00a0<a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\" rel=\"noopener noreferrer\">contact us<\/a><\/em><em> or raise a ticket at <a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/em><em><br \/>\n<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: &nbsp; In our previous blogs, we discussed on creating a Compute Engine VM instance <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,87,86,20,21],"tags":[203,24,205],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 Installation on Google Cloud via Composer - Cloudkul<\/title>\n<meta name=\"description\" content=\"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 Installation on Google Cloud via Composer - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-10T12:18:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-19T13:00:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m8.png\" \/>\n<meta name=\"author\" content=\"Kamal Verma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\",\"name\":\"Magento 2 Installation on Google Cloud via Composer - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2018-10-10T12:18:40+00:00\",\"dateModified\":\"2018-12-19T13:00:41+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051\"},\"description\":\"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 2 Installation on Google Cloud via Composer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051\",\"name\":\"Kamal Verma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Kamal Verma\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/kamaldev-cloudkul308\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2 Installation on Google Cloud via Composer - Cloudkul","description":"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/","og_locale":"en_US","og_type":"article","og_title":"Magento 2 Installation on Google Cloud via Composer - Cloudkul","og_description":"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.","og_url":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/","og_site_name":"Cloudkul","article_published_time":"2018-10-10T12:18:40+00:00","article_modified_time":"2018-12-19T13:00:41+00:00","og_image":[{"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2018\/10\/m8.png"}],"author":"Kamal Verma","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/","url":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/","name":"Magento 2 Installation on Google Cloud via Composer - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2018-10-10T12:18:40+00:00","dateModified":"2018-12-19T13:00:41+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051"},"description":"we need to create a Compute Engine VM on GCP along with a MySQL database using SQL service of GCP. Then you setup LAMP server on it for installing magento2.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-google-cloud\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Magento 2 Installation on Google Cloud via Composer"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/06c6ea4ff7ba3c7c066fa1ee606bf051","name":"Kamal Verma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cc4ebeffa54b7ceb9b2d552926f2f6?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Kamal Verma"},"url":"https:\/\/cloudkul.com\/blog\/author\/kamaldev-cloudkul308\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3824"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=3824"}],"version-history":[{"count":29,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3824\/revisions"}],"predecessor-version":[{"id":3991,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3824\/revisions\/3991"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=3824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=3824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=3824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}